fix VM create error caused by VM image not ready #678
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If two VM create operations are running at the same time, one of them might fail because it tries to use a VM image that is still being created:
P1 -> check image -> does not exist -> create VM image -> wait for VM image operation to finish -> once finished VM create
P2 -> check image -> exists (in creating state from P1) -> VM create -> fails with OperationNotAllowed
Checklist:
Please check each of the boxes below for which you have completed the corresponding task:
Please include below the summary portions of the output from the following 2 scripts:
NOTE: Please see how to setup dev environment and run unit tests in docs/development.md.
Unit Test output:
Finished in 9.73 seconds (files took 0.84091 seconds to load)
1030 examples, 0 failures
Coverage report generated for RSpec to /workspaces/dev_bosh-azure-cpi-release/bosh-azure-cpi-release/src/bosh_azure_cpi/coverage. 4225 / 4248 LOC (99.46%) covered.
Rubocop output:
191 files inspected, 412 offenses detected, 405 offenses autocorrectable
rubocop find some issues.
Changelog