# vmware\_guest - VM is created but the name "none"

**URL:** <https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [March 8, 2021, 3:57am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735 "2021-03-08T03:57:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 8, 2021, 3:57am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735/1 "2021-03-08T03:57:23Z")

</div>

Hi folks

When i use below on a Ubuntu 20.04 ansible control node , vm is created but the OS name shows “none”

Same playbook i am running on a CentOS7 ansible control node the then the vm name is not none but correct one

Any suggestions on this Please ?

cat vm-create-paramater.yml

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [March 8, 2021, 5:57am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735/2 "2021-03-08T05:57:28Z")

</div>

The Linux distro on the control node is largely irrelevant. It’s the way you define the variables that is the problem.  
Add a debug task and check what does variables really are.

What is in that vars file? Typo? Etc etc

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 8, 2021, 6:04am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735/3 "2021-03-08T06:04:42Z")

</div>

Well - /etc/ansible/playbooks/vm-provision/vars/var.yml in my case only has credentials

All variables are passed with -e

So i do not think the issue is with vars in this case

ansible-playbook /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml --extra-vars "vm\_name=xxx xxx xxx "

i will try run with -vvvv

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 8, 2021, 6:29am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735/4 "2021-03-08T06:29:15Z")

</div>

Here is the output

ansible-playbook /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml -f 5 --extra-vars “vm\_name=vm-name-XXX vm\_ip=IPXXXX vcenter\_name=DC-vc01.DOMAIN vcenter\_folder=DC-C-Infra vcenter\_rp=DC-Prod vcenter\_dc=DC vcenter\_cluster=DC-C-Cluster01 vcenter\_template=DC-XXXX-TEMPLATE vm\_disk\_size=101 vcenter\_datastore=DATSTOREXXXX vm\_mem\_mb\_size=16384 vm\_cpu\_size=1 vm\_core\_size=1 vcenter\_network=VLANXXXX vm\_gateway=GWXXXX vcenter\_OS=CentOS7 vcenter\_Location=DC vcenter\_LOB=Infra vcenter\_Environment=Test vcenter\_Application=test1” -vvvv  
ansible-playbook 2.9.6  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python3/dist-packages/ansible  
executable location = /usr/bin/ansible-playbook  
python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]  
Using /etc/ansible/ansible.cfg as config file  
setting up inventory plugins  
host\_list declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
auto declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
Parsed /etc/ansible/hosts inventory source with ini plugin  
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’  
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python3/dist-packages/ansible/plugins/callback/default.py

PLAYBOOK: vm-create-paramater.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Positional arguments: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml  
verbosity: 4  
remote\_user: ansible  
connection: smart  
timeout: 10  
become\_method: sudo  
tags: (‘all’,)  
inventory: (‘/etc/ansible/hosts’,)  
extra\_vars: (‘vm\_name=vm-name-XXX vm\_ip=IPXXXX vcenter\_name=DC-vc01.DOMAIN vcenter\_folder=DC-C-Infra vcenter\_rp=DC-Prod vcenter\_dc=DC vcenter\_cluster=DC-C-Cluster01 vcenter\_template=DC-XXXX-TEMPLATE vm\_disk\_size=101 vcenter\_datastore=DATSTOREXXXX vm\_mem\_mb\_size=16384 vm\_cpu\_size=1 vm\_core\_size=1 vcenter\_network=VLANXXXX vm\_gateway=GWXXXX vcenter\_OS=CentOS7 vcenter\_Location=DC vcenter\_LOB=Infra vcenter\_Environment=Test vcenter\_Application=test1’,)  
forks: 5  
1 plays in /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml  
Read vars\_file ‘/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml’  
Read vars\_file ‘/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml’  
Read vars\_file ‘/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml’

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
META: ran handlers  
Read vars\_file ‘/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml’

TASK [set\_fact] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:9  
ok: [localhost] =\> {  
“ansible\_facts”: {  
“creationdate”: “2021/03/07 22:16”  
},  
“changed”: false  
}  
Read vars\_file ‘/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml’

TASK [create vm using template] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:10  
\<127.0.0.1\> ESTABLISH LOCAL CONNECTION FOR USER: jenkins  
\<127.0.0.1\> EXEC /bin/sh -c ‘echo ~jenkins && sleep 0’  
\<127.0.0.1\> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755`” && echo ansible-tmp-1615184214.498803-105323394432755=“`echo /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755`” ) && sleep 0’  
Using module file /usr/share/ansible/plugins/modules/vmware\_guest.py  
\<127.0.0.1\> PUT /var/lib/jenkins/.ansible/tmp/ansible-local-66186ul4257xf/tmp8ptpb1st TO /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/AnsiballZ\_vmware\_guest.py  
\<127.0.0.1\> EXEC /bin/sh -c ‘chmod u+x /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/ /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/AnsiballZ\_vmware\_guest.py && sleep 0’  
\<127.0.0.1\> EXEC /bin/sh -c ‘/usr/bin/python3 /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/AnsiballZ\_vmware\_guest.py && sleep 0’  
\<127.0.0.1\> EXEC /bin/sh -c ‘rm -f -r /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/ \> /dev/null 2\>&1 && sleep 0’  
changed: [localhost] =\> {  
“changed”: true,  
“instance”: {  
“annotation”: “Created On -2021/03/07 22:16”,  
“current\_snapshot”: null,  
“customvalues”: {},  
“guest\_consolidation\_needed”: false,  
“guest\_question”: null,  
“guest\_tools\_status”: “guestToolsNotRunning”,  
“guest\_tools\_version”: “11269”,  
“hw\_cluster”: “DC-C-Cluster01”,  
“hw\_cores\_per\_socket”: 1,  
“hw\_datastores”: [  
“DATSTOREXXXX”  
],  
“hw\_esxi\_host”: “DC-c-esx02.DOMAIN”,  
“hw\_eth0”: {  
“addresstype”: “assigned”,  
“ipaddresses”: null,  
“label”: “Network adapter 1”,  
“macaddress”: “MACXXXX”,  
“macaddress\_dash”: “MACXXXX”,  
“portgroup\_key”: null,  
“portgroup\_portkey”: null,  
“summary”: “VLANXXXX”  
},  
“hw\_files”: [  
“[DATSTOREXXXX] vm-name-XXX/vm-name-XXX.vmx”,  
“[DATSTOREXXXX] vm-name-XXX/vm-name-XXX.nvram”,  
“[DATSTOREXXXX] vm-name-XXX/vm-name-XXX.vmsd”,  
“[DATSTOREXXXX] vm-name-XXX/vm-name-XXX.vmdk”  
],  
“hw\_folder”: “/DC/vm/DC-C-Infra”,  
“hw\_guest\_full\_name”: null,  
“hw\_guest\_ha\_state”: false,  
“hw\_guest\_id”: null,  
“hw\_interfaces”: [  
“eth0”  
],  
“hw\_is\_template”: false,  
“hw\_memtotal\_mb”: 16384,  
“hw\_name”: “vm-name-XXX”,  
“hw\_power\_status”: “poweredOn”,  
“hw\_processor\_count”: 1,  
“hw\_product\_uuid”: “422149dc-a95f-50e3-bfa4-9a94a74c38eb”,  
“hw\_version”: “vmx-15”,  
“instance\_uuid”: “502171fb-4b14-7161-0e44-aec34593c194”,  
“ipv4”: null,  
“ipv6”: null,  
“module\_hw”: true,  
“moid”: “vm-34125”,  
“snapshots”: ,  
“vimref”: “vim.VirtualMachine:vm-34125”,  
“vnc”: {}  
},  
“invocation”: {  
“module\_args”: {  
“annotation”: “Created On -2021/03/07 22:16”,  
“cdrom”: ,  
“cluster”: “DC-C-Cluster01”,  
“convert”: null,  
“customization”: {  
“autologon”: null,  
“autologoncount”: null,  
“dns\_servers”: [  
“xx”,  
],  
“dns\_suffix”: null,  
“domain”: “DOMAIN”,  
“domainadmin”: null,  
“domainadminpassword”: null,  
“existing\_vm”: null,  
“fullname”: null,  
“hostname”: null,  
“hwclockUTC”: null,  
“joindomain”: null,  
“joinworkgroup”: null,  
“orgname”: null,  
“password”: null,  
“productid”: null,  
“runonce”: null,  
“timezone”: null  
},  
“customization\_spec”: null,  
“customvalues”: ,  
“datacenter”: “DC”,  
“datastore”: null,  
“delete\_from\_inventory”: false,  
“disk”: [  
{  
“datastore”: “DATSTOREXXXX”,  
“size\_gb”: “101”,  
“type”: “thin”  
}  
],  
“esxi\_hostname”: null,  
“folder”: “DC-C-Infra”,  
“force”: false,  
“guest\_id”: null,  
“hardware”: {  
“boot\_firmware”: null,  
“cpu\_limit”: null,  
“cpu\_reservation”: null,  
“hotadd\_cpu”: null,  
“hotadd\_memory”: null,  
“hotremove\_cpu”: null,  
“max\_connections”: null,  
“mem\_limit”: null,  
“mem\_reservation”: null,  
“memory\_mb”: 16384,  
“memory\_reservation\_lock”: null,  
“nested\_virt”: null,  
“num\_cpu\_cores\_per\_socket”: 1,  
“num\_cpus”: 1,  
“scsi”: “paravirtual”,  
“version”: null,  
“virt\_based\_security”: null  
},  
“hostname”: “DC-vc01.DOMAIN”,  
“is\_template”: false,  
“linked\_clone”: false,  
“name”: “vm-name-XXX”,  
“name\_match”: “first”,  
“networks”: [  
{  
“dns\_servers”: [  
“XXXX”,  
“XXXX”,  
“XXXX”  
],  
“gateway”: “GWXXXX”,  
“ip”: “IPXXXX”,  
“name”: “VLANXXXX”,  
“netmask”: “255.255.255.0”,  
“start\_connected”: true,  
“type”: “static”  
}  
],  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“port”: 443,  
“proxy\_host”: null,  
“proxy\_port”: null,  
“resource\_pool”: “DC-Prod”,  
“snapshot\_src”: null,  
“state”: “poweredon”,  
“state\_change\_timeout”: 0,  
“template”: “DC-XXXX-TEMPLATE”,  
“use\_instance\_uuid”: false,  
“username”: “account@DOMAIN”,  
“uuid”: null,  
“validate\_certs”: false,  
“vapp\_properties”: ,  
“wait\_for\_customization”: false,  
“wait\_for\_customization\_timeout”: 3600,  
“wait\_for\_ip\_address”: false,  
“wait\_for\_ip\_address\_timeout”: 300  
}  
}  
}  
Read vars\_file ‘/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml’  
Read vars\_file ‘/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml’

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [March 8, 2021, 7:03am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735/5 "2021-03-08T07:03:41Z")

</div>

And a similar output of a successful attempt on your other control node?

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 8, 2021, 8:01am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735/6 "2021-03-08T08:01:19Z")

</div>

Thanks will share momentarily

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 8, 2021, 8:34am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735/7 "2021-03-08T08:34:25Z")

</div>

None o/p from Ubuntu20x box …

FYI same template… same vcenter … same everything …

2.9.6 is ansible which comes with OS

on other node i did pip3 so version is 2.10 …

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [March 8, 2021, 9:05am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735/8 "2021-03-08T09:05:00Z")

</div>

> None o/p from Ubuntu20x box ..

What do you mean no output?  
Why is there no output?

> FYI same template... same vcenter .. same everything ..
> 
> 2.9.6 is ansible which comes with OS
> 
> on other node i did pip3 so version is 2.10 ..

Sounds like you have two totally different control nodes, with  
different ansible installs, possibly multiple installs, mixed with  
Jenkins.  
And oh yeah they're also different OS-es.  
Since there are so many differences it's will be very hard to tell why  
things work on one box and not on the other.

You could start with eliminating the differences between ansible installs.  
For instance using a venv on both will help.

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 9, 2021, 9:23am UTC](https://forum.ansible.com/t/vmware-guest-vm-is-created-but-the-name-none/34735/9 "2021-03-09T09:23:08Z")

</div>

Thanks, for now i will keep on hold on this very interesting problem as i have work-around with centos 7
