[vsphere_guest] esxi.hostname is mandatory?

9 views
Skip to first unread message

Martino Viganò

unread,
Dec 7, 2016, 9:31:10 AM12/7/16
to Ansible Project
Hello,

I have to create a new virtual machine using the vsphere_guest form.

I will not place my new virtual machine on a single host but I want to create the cluster, and I want it to vmware host more appropriate to place it.

Is there a way to do it?

My play book is done this way:

 vcenter_hostname: xxxx
        username: xxxx
        guest: martino_ansible
        password: xxxxx
        power_on_after_clone: ​​no
        clusters: Cluster
        were: present
        vm_extra_config:
                vcpu.hotadd: yes
                mem.hotadd: yes
                notes: ansible VM test
                folder: QA
        vm_disk:
           disk1:
            size_gb: 10
            type: thin
            datastore: vmware6_V1
        vm_nic:
           nic1:
            type: vmxnet3
            network: 103-server-qa
            NETWORK_TYPE: Standard
        vm_hardware:
           memory_mb: 1024
           num_cpus: 1
           OSID: centos64Guest
           scsi: paravirtual
        resource_pool: Reitek
        esxi:
           datacenter: Reitek
           hostname: Cluster

When I run the playbook, however, I get this error:

TASK [vsphere_guest] ********************************************** *************
fatal: [127.0.0.1]: FAILED! => { "Changed": false, "failed": false, "msg": "Can not find esx host named: Cluster"}
Reply all
Reply to author
Forward
0 new messages