Failed to create a virtual machine : Cannot complete customization

185 views
Skip to first unread message

esxi...@gmail.com

unread,
Aug 26, 2020, 8:05:13 PM8/26/20
to Ansible Project
Hi

Any help is much appreciated ..  Here is summary of issue :

Module :
vmware_guest

Error :

"msg": "Failed to create a virtual machine : Cannot complete customization."

Ansible Version : 
ansible 2.9.10

Playbook :

---
- hosts: localhost
  gather_facts: false
  connection: local
  vars_files:
    - ./vars/xxx.yml


  tasks:
    - name: create vm using template
      vmware_guest:
        hostname: "{{ vcenter_server }}"
        username: "{{ vcenter_user }}"
        password: "{{ vcenter_pass }}"
        datacenter: "{{ vcenter_datacenter }}"
        cluster: "{{ vcenter_cluster }}"
        template: "{{ vcenter_template }}"
        validate_certs: no
        name: "{{ item }}"
        folder: /xxx
        state: poweredon
        wait_for_ip_address: true
        disk:
        - size_gb: 80
          type: thin
          datastore: xxx
        hardware:
          memory_mb: 8192
          num_cpus: 4
          num_cpu_cores_per_socket: 4
          scsi: paravirtual
        networks:
        - name: xxx
          start_connected: true
        customization:
          domain: xxx
          dns_servers: xx
          dns_suffix: xxx
          joindomain: xxx
          autologon: true
          domainadmin: "xx"
          domainadminpassword: "xx"
          hostname: "{{ item }}"
      with_items: "{{ servers }}"
  
  
  
Issue :

VM is created but is power-off & is not joined to domain ..basically failed custimization

-vvvv does not show much 

Manually if done ie from vCenter UI, works as expected 

esxi...@gmail.com

unread,
Aug 26, 2020, 9:06:10 PM8/26/20
to Ansible Project

I found the issue, the admin account was disabled & auto login was on...made auto login false & is good now 

Piyush Bansal

unread,
Aug 26, 2020, 10:25:42 PM8/26/20
to ansible...@googlegroups.com
Dear Friend,

You can remove waitforip because you are not giving network ip .. atleast as per your playbook shown. Instead, you can mention waitforcustomization as true....!!

Also, you are not mentioning network ip address/subnet/gateway details... How is it supposed to contact the domain controller ?

Must make sure VMware tools are installed and not corrupted on the template from which You are deploying vm.

Also, give password directive in customisation section for the vm. This will be your vm administrator password. 
If I may ask... What's the OS version in template ?? 2008r2/2012/2012r2 etc ??

Thanks,
Piyush


--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3b7cb677-02fb-4e0c-8b82-dbc9d76aec82n%40googlegroups.com.

esxi...@gmail.com

unread,
Aug 27, 2020, 2:34:35 AM8/27/20
to Ansible Project
I am using a subnet which is DHCP , hence no need to have IP mentioned

The OS is windows 10 

Thanks for the info, i will investigate on -  waitforcustomization as true   

Reply all
Reply to author
Forward
0 new messages