add 'power_state' attribute to reflect desired power state #15232
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.
Adds a new
power_state
(string) attribute tovsphere_virtual_machine
, with behavior as follows:ignored' (default): if the target vm is in a
powered off` state, instead of crashing terrraform during read operations (the current behavior), an error will be thrown indicating that the vm must be powered on in order to properly read it's state via terraform.poweredOn
: if the target vm is not in apowered on
state, the vm will show as requiring a change topoweredOn
; additionally, network interfaces will be reconstructed from the current (last known) state where they cannot be read from the govmomi api while the vm is not 'powered on'.This fixes #13803 and #14910; see those issues for more details.
Notes:
poweredOn
state ANDpower_state
value ispoweredOn
AND there are changes to the networking configuration, those changes will not be listed in the things needing change, although the overall resource will show as needing change.