# The customization\_spec feature of the vmware\_guest module appears to be ignored

**URL:** <https://forum.ansible.com/t/the-customization-spec-feature-of-the-vmware-guest-module-appears-to-be-ignored/28476>\
**Category:** Ansible Project\
**Created:** [August 30, 2018, 11:25pm UTC](https://forum.ansible.com/t/the-customization-spec-feature-of-the-vmware-guest-module-appears-to-be-ignored/28476 "2018-08-30T23:25:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Smith](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@Matt\_Smith](https://forum.ansible.com/u/Matt_Smith)\
**Post date:** [August 30, 2018, 11:25pm UTC](https://forum.ansible.com/t/the-customization-spec-feature-of-the-vmware-guest-module-appears-to-be-ignored/28476/1 "2018-08-30T23:25:24Z")

</div>

Hi all,

I’m trying to set up a playbook that creates VMs on a vSphere server based on a template. I’ve created a playbook that uses the vmware\_guest module, I’ve created a template in vSphere, and I’ve also created an OS customisation specification. The VM creation works but I can’t get the OS customisation to work. It’s not giving any errors, it’s just not doing the customisation. All I’m really wanting out of it is to change the hostname of the new VM to match the VM name. If I launch a VM from the template in the vSphere web client and specify my customisation template in the wizard it works, so I’m confident everything on the vSphere side is fine.

My environment is as follows  
Target: vSphere 5.5u3  
Template: CentOS 7 with open-vm-tools and perl installed  
Control machine: MacOS 10.13.6  
Ansible version: 2.6.3  
Python version: 2.7.10

Here’s my playbook step:

`

- name: Create VM  
vmware\_guest:  
hostname: “{{ vsphere\_host }}”  
username: “{{ vsphere\_login }}”  
password: “{{ vsphere\_password }}”  
esxi\_hostname: “{{ esxi\_host }}”  
validate\_certs: False  
template: centos-basic-template  
customization\_spec: “Base Linux”  
datacenter: dev  
state: poweredon  
wait\_for\_ip\_address: yes  
folder: /  
name: “new-vm”  
`

One thing I noticed in the verbose output of the ansible-playbook command was that it seems to think the VM is RHEL7 even though the template (and the newly created VM) show the OS as Centos:

`"hw_guest_full_name": "Red Hat Enterprise Linux 7 (64-bit)", "hw_guest_ha_state": null, "hw_guest_id": "rhel7_64Guest",`

I’ve tried using the customization parameter (just specifying hostname) instead of customization\_spec but I get the error “Failed to create a virtual machine : fault.NicSettingMismatch.summary” if I do that. I haven’t gone down the troubleshooting path for that one yet as I’d much prefer to use the customisation spec defined in vSphere.

Am I missing something? Or is there a bug in the vmware\_guest module?

Thanks in advance for any help,  
Matt

---

<div class="post-metadata">

**Author:** ![Dominic\_D\_Apice](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Dominic\_D\_Apice](https://forum.ansible.com/u/Dominic_D_Apice)\
**Post date:** [February 26, 2019, 1:02pm UTC](https://forum.ansible.com/t/the-customization-spec-feature-of-the-vmware-guest-module-appears-to-be-ignored/28476/2 "2019-02-26T13:02:40Z")

</div>

check this out : [https://github.com/ansible/ansible/issues/44159](https://github.com/ansible/ansible/issues/44159)
