Open Stogrammus opened 4 years ago
Files identified in the description: None
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
Hi @Stogrammus,
Can you please check if you face the same problem with the vmware_guest_disk
module? https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_disk_module.html#parameter-disk/type
I can confirm guest disk thick provisioning works but template cloning does not.
I have figured out why this happens. Pretty much throughout the VMWare community modules disk specs are being set to eagerlyScrub even though just changing this flag does nothing. When creating a new disk, this is fine because the specs are respected. Unfortunately, when editing a cloned or previous disk just setting disk_spec.device.backing.eagerlyScrub = True does not take effect. What is needed is to actually call eager scrub on the back-end which would be something like this self.content.virtualDiskManager..EagerZeroVirtualDisk_Task(disk_device.backing.fileName, datacenter) at which point when re-configuring the VM the disk will now be flagged as eager zeroed thick because the disk is actually fully eager zeroed.
Worst part about the eager zero task is that the VM must be powered off to run this so In my opinion there currently exists no reliable way to deploy a template to eager zero thick provision if changing the disk size (not including vmotion). If you are doing a direct clone where the disk size doesn't change VMWare will respect the eagerlyScrub flag because doing the eager scrub task above isn't required if the template itself is eagerly zeroed. If it isn't eagerly zeroed then we will be back at square one because it'll lazy zero it to the same "zeroed" state of the template.
Hope my assumption is correct and this makes sense.
SUMMARY
When I create a virtual machine from a VMware template and change the disk size The disk always changes its type to "Lazy zeroed thick disks". An ansible playbook disc type is "Eager zeroed thick disks". I tried to use an option "convert: eagerzeroedthick", but the disk type remains "Lazy zeroed thick disks" after the virtual machine was created. I tried to use in playbook: type: eagerzeroedthick type: "Eager zeroed thick disks" But disk type still is "Lazy zeroed thick disks". Option "type" in disk doesn't work.
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Hypervisor: VMware ESXi, 6.5.0, 14990892 pyvmomi 7.0 pysphere 0.1.7
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS