Hi,

Trying Ansible fisrt time.

I have deployed OVA and normal VM with Disk and CD, they work fine.

Now I’m trying to deploy Nested ESXi on a Standalone ESXi, and am trying to assign IP address to the Nested ESXi but it fails with the below error.

TASK [Create a virtual machine on given ESXi hostname] ********************************
fatal: [192.168.1.101 -> localhost]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (vmware_deploy_ovf) module: ova_hardware_networks, ova_networks, ova_properties. Supported parameters include: allow_duplicates, cluster, datacenter, datastore, deployment_option, disk_provisioning, enable_hidden_properties, esxi_hostname, fail_on_spec_warnings, folder, hostname, inject_ovf_env, name, networks, ovf, password, port, power_on, properties, proxy_host, proxy_port, resource_pool, url, username, validate_certs, wait, wait_for_ip_address (admin, ova, pass, pwd, user)."}

My playbook..

---
- name: test
  hosts: 192.168.1.101
  become: true
  collections:
    - community.vmware
  vars:
    path: '/root'
    ova: 'ESXi7.0U3n.ova'

  tasks:
  - name: stat the ova file
    stat:
      path: '{{ path }}/{{ ova }}'
    register: file_details

  - debug:
      msg: "The file or directory exists"
    when: file_details.stat.exists

  - name: Create a virtual machine on given ESXi hostname
    vmware_deploy_ovf:
      hostname: '192.168.1.101'
      username: 'root'
      password: 'password'
      datacenter: 'ha-datacenter'
      datastore: TestStore
      ovf: '{{ path }}/{{ ova }}'
      name: ESXi
      ova_networks:
        "Network 1": 'TestNetwork1'
      ova_hardware_networks:
        - name: 'TestNetwork1'
      ova_properties:
         guestinfo.ipaddress: '192.168.1.120'
         guestinfo.netmask: '255.255.255.0'
         guestinfo.gateway: '192.168.1.1'
         guestinfo.dns.server: '192.168.1.150'
      validate_certs: no
    delegate_to: localhost

I have checked with vmware_guest and vmware_guest_network and receive same type of error..

Any thoughts..

2 Spice ups

It’s telling you that these are not supported syntax;

ova_hardware_networks, ova_networks, ova_properties

try the below

  vmware_deploy_ovf:
    hostname: '192.168.1.101'
    username: 'root'
    password: 'password'
    datacenter: 'ha-datacenter'
    datastore: TestStore
    ovf: '{{ path }}/{{ ova }}'
    name: ESXi
    networks:
      "Network 1": 'TestNetwork1'
    properties:
      guestinfo.ipaddress: '192.168.1.120'
      guestinfo.netmask: '255.255.255.0'
      guestinfo.gateway: '192.168.1.1'
2 Spice ups

Thanks @Rod-IT

It works without errors but does not set the IP part of it..

PLAY RECAP ************************************************************************************************************************************************************************
192.168.1.101              : ok=3    changed=1    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0

image

2 Spice ups

Likely your OVA doesn’t allow for a static IP.

Nested ESXi (like ESXi 7.0 or 8.0) does not automatically apply static IPs from OVF properties unless:

  1. The OVA was built to support OVF environment injection.
  2. The ESXi installer or boot process is scripted (e.g. via Kickstart).
2 Spice ups

Thanks for pointing that out, I tested and this is the issue, it does not accept even values added through the GUI when importing OVA..

For now I’m using Deploy nested ESXi VMs using a Kickstart (KS) script and Ansible Automation - Matt Adam and it solves what i’m trying to achieve..

Thanks again @Rod-IT

2 Spice ups

Hi @Rod-IT

A question on the same topic on my mind..

I found that vCenter can be deployed with IP configuration with the following parameters which are found in the OVF file which is basically an XML file.

      properties:
        DeploymentOption.value: '{{ vcsa_size }}'
        guestinfo.cis.appliance.net.addr.family: 'ipv4'
        guestinfo.cis.appliance.net.mode: 'static'
        guestinfo.cis.appliance.net.addr: '{{ vcenter_address }}' 
        guestinfo.cis.appliance.net.pnid: "{{ vcenter_hostname }}.{{ domain }}" 
        guestinfo.cis.appliance.net.prefix: '{{ net_prefix }}' 
        guestinfo.cis.appliance.net.gateway: '{{ net_gateway }}' 
        guestinfo.cis.appliance.net.dns.servers: '{{ dns_servers }}' 
        guestinfo.cis.appliance.root.passwd: '{{ vcenter_password }}' 
        guestinfo.cis.ceip_enabled: "False"
        guestinfo.cis.deployment.autoconfig: 'True' 
        guestinfo.cis.vmdir.password: '{{ vcenter_password }}' 
        domain: '{{ domain }}'
        searchpath: '{{ searchpath }}'

And in Ansible the code inject_ovf_env: true needs to be added as well for the IP configuration to be injected during the OVA deployment.

My question is what is the part in the OVF file determines if an OVA will accept or allow injecting IP related configuration because I have a StarWind OVA as well which does not accept IP configuration.

I opened the OVF file of both and its not clear which part determines this.

Would you happen to know this, or where, or what to look for..

Thanks..

Since this is another query and this topic is solved, please create a new topic, so If I or someone else does help you, they can at least get credit for doing so.

Sure, no worries..