Hello folks,
I'm having difficulties using the vmware_guest module to create a guest vm
on my VMware vCenter 6. My playbook looks as follows:
# Create a new VM on an ESX server
- hosts: localhost
tasks:
- vsphere_guest:
hostname: <name of vcenter server>
username: 'domain\user'
password: "password"
name: rhel-t4
state: powerdon
folder: JKA
disk:
- size_gb: 18
type: thin
datastore: <name of the datastore cluster>
nic:
- type: vmxnet3
network: VLAN30
hardware:
memory_mb: 2048
num_cpus: 1
osid: rhel64guest
scsi: paravirtual
datacenter: "HRZ-TEST4"
esxi_hostname: <fqdn of the esxi host>
template: RHEL72-EN
When running the playbook I get the following error:
ansible-playbook create_vm_on_vcenter.yml -C
PLAY [localhost]
***************************************************************
TASK [setup]
*******************************************************************
ok: [localhost]
TASK [vsphere_guest]
***********************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg":
"unsupported
parameter for module: datacenter"}
NO MORE HOSTS LEFT
*************************************************************
[WARNING]: Could not create retry file 'create_vm_on_vcenter.retry'.
[Errno 2] No such file or directory: ''
PLAY RECAP
*********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1
The error message implies that the parameter "datacenter" is not supported
by the module vmware_guest. But fromwhat is written in vmware_guest -
Manages virtualmachines in vcenter
<http://docs.ansible.com/ansible/vmware_guest_module.html> this is a
required parameter. Could some explain what's wrong here, please?
Best regards,
Joerg
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/9f42379c-a5a0-42f5-b5af-7adb1acf302a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.