r/virtual_machine: Validate exact disk type when using linked_clone #277
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.
A VM that's cloned with
linked_clone
and different disk mode optionsthat what is set on the source template will end up with inconsistent
settings post-clone, causing a read-update failure that will leave the
VM in a state that is irrecoverable to Terraform - the only way to
rectify the situation is to delete the VM and start over with a new
state.
This adds extra validation to make sure that
thin_provisioned
andeagerly_scrub
are set to the same settings as the source template'scounterpart disk, along with validating that the disk is the exact same
size (something that wasn't done yet).
Fixes #275.
PS: There will be a larger-ish PR (mainly because of adjustments to tests) that will follow this one to add
thin_provisioned
andeagerly_scrub
attributes to thevsphere_virtual_machine
data source. This will help ensure that these can be fetched in the same way we have the data source fetchingdisk_sizes
currently.