Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stable-4.x: Fix disk creation resulting in 'invalid configuration for…
… device' error (ansible-collections#2245) Backport ansible-collections#2009 SUMMARY Under some circumstances, disk creation fails with an invalid configuration for device error. Once this error shows up for a VM, it persistently happens whenever trying to add disks, however, I do not know how to make it show up for a VM, sometimes it is just there. In comparing the API calls done by VCenter (which works) and ansible (which fails with the error above), I noticed that VCenter sets fileOperation to create. Setting this in ansible, as done in this patch, fixes the disk creation in ansible. The docs describe the fileOperation parameter like this: Type of operation being performed on the backing of the specified virtual device. If no file operation is specified in the VirtualDeviceSpec, then any backing filenames in the VirtualDevice must refer to files that already exist. The "replace" and "delete" values for this property are only applicable to virtual disk backing files. So it really must be set when the backing file does not exist, (which it ofc doesn't when creating a disk). ISSUE TYPE Bugfix Pull Request COMPONENT NAME vm_device_helper
- Loading branch information