Search code examples
ansiblevmwarevspherepyvmomi

Failed to create a VmWare VM via ansible 2.6, pyvmomi 5.5.0, vsphere 5.5 and ESXI 6


I use a playbook with :

- hosts: localhost
  vars_prompt:
    name: passwd
    prompt: "{{ vcenter }} passwd for {{ login }} ? >>> "

  tasks:
  - name: Create a virtual machine "{{ vm_name }}"
    vmware_guest:
      datacenter: '{{ datacenter }}'
      hostname: '{{ vcenter }}'
      username: "{{ login }}"
      password: "{{ passwd }}"
      folder: "{{ folder }}"
      name: "{{ vm_name }}"
      template: '{{ template }}'
      cluster: "{{ cluster }}"
      state: poweredon
      disk:
      - size_gb: "{{ disksizeGB }}"
        autoselect_datastore: yes
        datastore: '{{ datastore }}'
      hardware:
         memory_mb: '{{ ramsizeMB }}'
         num_cpus: '{{ vcpu_num }}'

The error in French (sorry, tried with LANG=C without success) :

TASK [Create a virtual machine "TEST-ANSIBLEBUILD-261"] ***********************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to create a virtual machine : La personnalisation du système d'exploitation client 'debian8_64Guest' n’est pas prise en charge dans cette configuration. Les clients Microsoft Vista (TM) et Linux avec Logical Volume Manager (LVM) sont pris en charge uniquement sur la dernière version de l’hôte ESX et la dernière version de VMware Tools. Consulter la documentation du vCenter pour connaître les configurations prises en charge."}

I tried to install open-vm-tools from debian9 with no more success (in the template).

The error says that configuration of the OS 'debian8_64Guest' is supported only with last ESX version and last VmWare tools. It talk about a doc, but not provides any link, it's not clear enough.

Any clue ? It works very well with debian9 and redhat7


Solution

  • The VmWare SDK have limits, it can't create nics with Debian8 as-is. Better try ovf tools and/or govc.

    If you know a workaround or a hack, please share !

    But you can run vmware_shell module commands as well.

    Debian9 works very well with all of this, but is not listed there: http://partnerweb.vmware.com/programs/guestOS/guest-os-customization-matrix.pdf