Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix VM create error caused by VM image not ready #678

Merged
merged 2 commits into from
Feb 17, 2023

Conversation

MSSedusch
Copy link
Contributor

@MSSedusch MSSedusch commented Jan 27, 2023

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:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All unit tests pass locally (after my changes)
  • Rubocop reports zero offenses (after my changes)

Please include below the summary portions of the output from the following 2 scripts:

pushd src/bosh_azure_cpi
  ./bin/test-unit
  ./bin/rubocop_check
popd

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

  • Fix OperationNotAllowed error

@MSSedusch MSSedusch marked this pull request as ready for review January 27, 2023 14:19
@rkoster rkoster requested review from a team, selzoc and lnguyen and removed request for a team February 2, 2023 15:46
Copy link
Member

@lnguyen lnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rkoster
Copy link
Contributor

rkoster commented Feb 9, 2023

ping @selzoc

Copy link
Member

@selzoc selzoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rkoster
Copy link
Contributor

rkoster commented Feb 17, 2023

Thanks! @MSSedusch

@rkoster rkoster merged commit 879c4ed into cloudfoundry:master Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants