# \[vsphere\_guest\] esxi.hostname is mandatory?

**URL:** <https://forum.ansible.com/t/vsphere-guest-esxi-hostname-is-mandatory/23185>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [December 6, 2016, 4:01pm UTC](https://forum.ansible.com/t/vsphere-guest-esxi-hostname-is-mandatory/23185 "2016-12-06T16:01:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martino\_Vigano](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@Martino\_Vigano](https://forum.ansible.com/u/Martino_Vigano)\
**Post date:** [December 6, 2016, 4:01pm UTC](https://forum.ansible.com/t/vsphere-guest-esxi-hostname-is-mandatory/23185/1 "2016-12-06T16:01:01Z")

</div>

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”}
