Add error handling for unsupported disk conversion #705
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.
Summary
Certain Azure storage account types, such as
PremiumV2
, can't be converted automatically, as detailed in issue #699. Attempting to change the storage type would result in an error from the Azure API, e.g.:Currently, bosh does not specifically handles this error, but interprets it as a general Azure error, which causes a deployment failure when attempting to switch to a storage type that is incompatible with conversion in the manifest.
Example
In response to such errors from the Azure API, we now raise a
NotSupported
exception. This instructs bosh to follow the standard disk update process, which involves creating a new disk, attaching both the new and the old disks to the VM, copying the data to the new disk, and then detaching the old disk.This approach prevents issues for users who might have accidentally chosen such a disk type and wish to revert, avoiding a scenario where the deployment fails and cannot be fixed in any other way.
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:
Unit tests
Rubocop output:
There are 52 offenses. None of them were introduced by the code changes of this PR.
Changelog