Vmware ESXI v7.03 issue with network portgroup name same on both standard and dv switches

168 views
Skip to first unread message

Jason B

unread,
Aug 15, 2022, 10:01:57 AM8/15/22
to Ansible Project

We recently upgraded our venter to 7.03 and ESXI systems to v7.03 and this issues has started rearing its ugly head. Basically the scenario is as follows:

  • Standard Switch with a port-group name that is the same as Distributed Switch port-group name exists
  • When deploying a new VM via vmware_guest module - the VM is deployed to the Standard Switch, and not the Distributed Switch.

Example:

WormHoleNet on Standard Switch
WormHoleNet on Distributed Switch

Deployment code:

---
- name: Clone Virtual Machine(s) from Template
  vmware_guest:
    state: 'poweredon'
    name: "{{ item }}"
    hostname: "{{ provision_vcenter_hostname }}"
    username: "{{ vcenter_user }}"
    password: "{{ vcenter_user_pswd }}"
    annotation: "{{ provision_notes }}"
    template: "{{ vmtemplate }}"
    datacenter: "{{ provision_vc_datacenter }}"
    datastore:  "{{ provisioning_datastore }}"
    folder: "{{ vmfolder }}"
    cluster: "{{ provision_cluster_target }}"
    hardware:
      num_cpus: 2
      memory_mb:  "{{ vmmemgb }}"
      num_cpu_cores_per_socket: 1
      hotadd_cpu: False
      hotremove_cpu: False
      hotadd_memory: False
      nested_virt: False
      scsi: 'paravirtual'
    networks:
    - name: "{{ network_zone }}"
      type: "static"
      ip: "{{ provision_ip_addresses }}"
      netmask: "{{ subnet_mask }}"
      gateway: "{{ default_gw }}"
      device_type: 'vmxnet3'
      dvswitch_name: "{{ vcenter_dvswitch }}"
      start_connected: yes
    wait_for_customization: 'yes'
    customization:
      domain: "{{ provisioning_ad_domain | lower }}"
      fullname: 'blackhole'
      orgname: 'startrek'
      password: "{{ ansible_password }}"
      timezone: '015'
      dns_servers: 123.456.890
      dns_suffix:
        - quasar
        - pulsar
    cdrom:
      type: 'none'
    force: yes
...

I am getting the standard switch  'WormHoleNet' and not the distributed switch 'WormHoleNet' -- this did NOT happen when we had 6.7U3 version of ESXI / vCenter.

Any work arounds for this ?

**

From Playbook Execution:

ansible-playbook [core 2.12.5.post0]
config file = None
configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible-playbook
python version = 3.8.13 (default, Jun 24 2022, 15:27:57) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)]
jinja version = 2.10.3
libyaml = True

**

community-vmware collection version: 2.7.0

**

See here for further discussion of this issue:

Jason B

unread,
Jan 20, 2023, 3:26:44 PM1/20/23
to Ansible Project
I found that the solution was to update my custom execution environment -- which applied the latest VMware SDK.
Reply all
Reply to author
Forward
0 new messages