feat(vm): deprecate enabled
attribute on cdrom
/disk
devices
#1746
+39
−75
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.
Contributor's Note
/docs
for any user-facing features or additions./fwprovider/tests
for any new or updated resources / data sources.make example
to verify that the change works as expected.Having the
enabled
attribute on a disk/CD-ROM is quite confusing since it doesn’t map to any device property in PVE. There’s no concept of “enabling” a block device in PVE -- a device either exists or it doesn’t (while there’s a concept of "unattached" disks, that's out of scope for this feature).When we set
enabled = false
in the configuration, it effectively means omitting (or removing) the block device from the VM. This makes it tricky to map the remote VM state (in PVE) to the local state in Terraform. In PVE, the absence of a device could mean either the device isn’t defined in the config at all or it’s defined but marked as disabled, which creates ambiguity.Instead of jumping through hoops to handle this across various use cases (create, update, clone, update clone, etc.), I’ve decided to remove this attribute altogether, as I don’t see a strong practical benefit to keeping it in the config.
Proof of Work
Community Note
Relates #1672