Skip to content

Commit

Permalink
Merge pull request ansible-collections#2009 from Yannik/fix-disk-add-…
Browse files Browse the repository at this point in the history
…failing-with-invalid-configuration-for-device

Fix disk creation resulting in 'invalid configuration for device' error
  • Loading branch information
mariolenz authored Nov 11, 2024
2 parents b30f870 + c784d76 commit ccf14a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bugfixes:
- vm_device_helper - Fix 'invalid configuration for device' error caused by missing fileoperation parameter.
(https://github.com/ansible-collections/community.vmware/pull/2009).
1 change: 1 addition & 0 deletions plugins/module_utils/vm_device_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def remove_cdrom(self, cdrom_device):
def create_hard_disk(self, disk_ctl, disk_index=None):
diskspec = vim.vm.device.VirtualDeviceSpec()
diskspec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add
diskspec.fileOperation = vim.vm.device.VirtualDeviceSpec.FileOperation.create
diskspec.device = vim.vm.device.VirtualDisk()
diskspec.device.key = -randint(20000, 24999)
diskspec.device.backing = vim.vm.device.VirtualDisk.FlatVer2BackingInfo()
Expand Down

0 comments on commit ccf14a9

Please sign in to comment.