Getting error while creating VM using VMWare templates

Hello,

I am new to ansible. I want to create VMs from VM template, I am not sure what should be the template format?
is it the one we directly mark VM as convert to template and then use that as template_src in playbook? or the OVF template?
I have used the converted template in playbook, since we use our domain accounts to login to VC using that for connecting to
VC. I am getting below error when I executing playbook:

fatal: [localhost]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Could not clone selected machine: [Task Error]: The operation is not supported on the object.”}

Let me know where I can share my playbook? or I am missing anything here?

Thanks,
Yogesh

Hi Yogesh, you might want to go ahead and open an issue on Github (just make sure you open it on ansible-modules-core or ansible-modules-extras, depending on which module is having problems). Sharing your playbook there would be best.

Thanks!

Hello Yogesh,

I am also getting the same error. Did you get the resolution of yours ?
Below is my playbook snippet

tasks:
  - name: Deploy an instance
    vsphere_guest:
        vcenter_hostname: 10.171.52.38
        username: testuser
        password: test
        guest: newvm001
        from_template: yes
        template_src: Ubuntu 14.04
        power_on_after_clone: No
        resource_pool: "/Resources"
        validate_certs: no

Thanks in advance.

In case it helps with anyone else who researched/googled this - I was able to reproduce the message when running directly from my laptop but in my case, the VM deployed successfully. It worked fine for me via a fresh vagrant ubuntu 14.04. Both are ansible 2.2.0.0 and pysphere 1.7 installed via pip. Here’s the playbook: