ansiblevmwarevmdk

Create VM from VMDK in VMware using Ansible


I could create VM in VMware from existing VMDK from Vsphere client. But I am not able to create it using Ansible. Can anyone suggest how to create VM from existing VMDK with Ansible?


Solution

  • From my experience, you can't do it out of the box with Ansible.

    I edited vsphere_guest module to be able to accomplish this for my client.
    Unfortunately I can't disclose this custom module's code.

    You need to modify add_disk method: remove create file operation and set existing VMDK filename for disk backing.