# vmware\_guest: "unsupported parameter for module: datacenter"

**URL:** <https://forum.ansible.com/t/vmware-guest-unsupported-parameter-for-module-datacenter/22877>\
**Category:** Ansible Project\
**Tags:** rhel, vmware\
**Created:** [October 25, 2016, 9:09am UTC](https://forum.ansible.com/t/vmware-guest-unsupported-parameter-for-module-datacenter/22877 "2016-10-25T09:09:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorg\_Kastning](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@Jorg\_Kastning](https://forum.ansible.com/u/Jorg_Kastning)\
**Post date:** [October 25, 2016, 9:09am UTC](https://forum.ansible.com/t/vmware-guest-unsupported-parameter-for-module-datacenter/22877/1 "2016-10-25T09:09:43Z")

</div>

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:   
username: ‘domain\user’  
password: “password”  
name: rhel-t4  
state: powerdon  
folder: JKA  
disk:
- size\_gb: 18  
type: thin  
datastore:   
nic:
- type: vmxnet3  
network: VLAN30  
hardware:  
memory\_mb: 2048  
num\_cpus: 1  
osid: rhel64guest  
scsi: paravirtual  
datacenter: “HRZ-TEST4”  
esxi\_hostname:   
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

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 25, 2016, 9:22am UTC](https://forum.ansible.com/t/vmware-guest-unsupported-parameter-for-module-datacenter/22877/2 "2016-10-25T09:22:56Z")

</div>

> 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  
> &nbsp;&nbsp;tasks:  
> &nbsp;&nbsp;- vsphere\_guest:

[snip]

> 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&gt](http://docs.ansible.com/ansible/vmware_guest_module.html&gt); this is a  
> required parameter. Could some explain what's wrong here, please?

vsphere\_guest != vmware\_guest

vsphere\_guest doesn’t have datacenter  
[https://docs.ansible.com/ansible/vsphere\_guest\_module.html](https://docs.ansible.com/ansible/vsphere_guest_module.html)

vmware\_guest is a new module in the upcoming 2.2 release.

---

<div class="post-metadata">

**Author:** ![Jorg\_Kastning](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@Jorg\_Kastning](https://forum.ansible.com/u/Jorg_Kastning)\
**Post date:** [October 25, 2016, 9:27am UTC](https://forum.ansible.com/t/vmware-guest-unsupported-parameter-for-module-datacenter/22877/3 "2016-10-25T09:27:52Z")

</div>

Ah ok, I see I mixed that up. Thank you for your quick reply.
