using vsphere-guest on esxi 6.0 (free version)

55 views
Skip to first unread message

Albert Uy

unread,
May 5, 2016, 9:35:32 AM5/5/16
to Ansible Project
Hi All,

      Any suggestions on what to set the datacenter: parameter to?

      i have an ESXi 6.0 whitebox at home, and am running Ansible 2.2.0 on an Ubuntu 16.04 vm. i've tried setting the datacenter: parameter to the hostname/ip of the whitebox, but i still end up getting this(i've added an entry in /etc/hosts for vms01.auy.com, and have verified that i can resolve it):


############################################################################################################################################
 ./ansible-playbook esx.yml

PLAY [test] ********************************************************************

TASK [vsphere_guest] ***********************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "msg": "Cannot find datacenter named: vms01.auy.com"}

NO MORE HOSTS LEFT *************************************************************
        to retry, use: --limit @/home/auy/test/esx.retry

PLAY RECAP *********************************************************************
127.0.0.1                  : ok=0    changed=0    unreachable=0    failed=1

############################################################################################################################################




      i am running the ff playbook(i just added an entry in  /etc/hosts file for vms01.acme.com ):


############################################################################################################################################

---
- name: test
  hosts: 127.0.0.1
  connection: local
  #user: root
  #sudo: false
  gather_facts: false
  serial: 1

  tasks:
  - vsphere_guest:
       vcenter_hostname: vms01.acme.com
       validate_certs: no
       username: root
       password: passwordispassword
       #power_on_after_clone: no
       guest: test-vm
       vm_hardware:
          memory_mb: 1024
          num_cpus: 1
          osid: centos64Guest
          scsi: paravirtual
       vm_disk:
          disk1:
            size_gb: 10
            type: thin
            datastore: datastore1
            folder: /vmfs/volumes/datastore1/test-vm
       vm_nic:
          nic1:
            type: vmxnet3
            network: VM network
            network_type: standard
       esxi:
          datacenter: vms01.acme.com
          hostname: vms01.acme.com
...
############################################################################################################################################


tia





Albert Uy

unread,
May 5, 2016, 8:00:58 PM5/5/16
to Ansible Project
Hi All,

   Sorry i mixed up the results from two different tests...i ran another test and made sure the datacenter parameter matched the entry i made in /etc/hosts(vms01.acme.com), but i still got the same result.
Reply all
Reply to author
Forward
0 new messages