You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a new VM with the vmware_guest module using a template, the MAC address is automatically assigned even if you pass a custom MAC address.
I reported this in this forum post, and other users confirmed the bug.
ISSUE TYPE
Bug Report
COMPONENT NAME
vmware_guest module
ANSIBLE VERSION
% ansible --version
ansible [core 2.16.3]
python version = 3.11.1 (main, Jun 23 2023, 15:42:22)
COLLECTION VERSION
community.vmware 4.0.1
OS / ENVIRONMENT
vCenter 7.0.3
ESXi 7.0.3
STEPS TO REPRODUCE
Run a playbook with a single task that builds a new VM and passes a custom MAC address.
Replace the values in this example task with ones that match your environment.
- name: Create a VM with specific MAC addresscommunity.vmware.vmware_guest:
hostname: "{{ vcenter_hostname }}"username: "{{ vcenter_username }}"password: "{{ vcenter_password }}"validate_certs: falsedatacenter: "{{ vcenter_datacenter }}"cluster: "{{ vcenter_cluster }}"folder: /{{ vm_folder | default('dev-vms') }}name: test-custom-mac-addressstate: presenttemplate: "{{ vm_template | default('template_2024')}}"disk:
- size_gb: 30type: thindatastore: "{{ vm_info.datastore_url }}"hardware:
memory_mb: "{{ vm_memory | default('8192') }}"num_cpus: "{{ vm_cpus | default('2') }}"num_cpu_cores_per_socket: "{{ vm_cpu_cores | default('1') }}"scsi: paravirtualversion: latestboot_firmware: "efi"cdrom:
- controller_number: 0unit_number: 0state: presentnetworks:
- name: "{{ vm_network | default('VM Network')}}"mac: "00:11:22:aa:bb:cc"# put a valid mac address here
EXPECTED RESULTS
Task creates a new VM with the custom MAC address.
ACTUAL RESULTS
Task created a new VM with an automatically-supplied MAC address.
WORKAROUNDS
If you create the VM from scratch, you can pass a custom MAC address and it works.
If you create the VM from the template, you can add a second NIC with the custom MAC address, power the VM down, remove the NIC with the automatically-supplied MAC address, and power the VM back up again. Once that's done, your eth0 will have the correct MAC address.
The text was updated successfully, but these errors were encountered:
SUMMARY
Possibly related to #1391 and/or #1158.
When building a new VM with the
vmware_guest
module using a template, the MAC address is automatically assigned even if you pass a custom MAC address.I reported this in this forum post, and other users confirmed the bug.
ISSUE TYPE
COMPONENT NAME
vmware_guest
moduleANSIBLE VERSION
COLLECTION VERSION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Run a playbook with a single task that builds a new VM and passes a custom MAC address.
Replace the values in this example task with ones that match your environment.
EXPECTED RESULTS
Task creates a new VM with the custom MAC address.
ACTUAL RESULTS
Task created a new VM with an automatically-supplied MAC address.
WORKAROUNDS
eth0
will have the correct MAC address.The text was updated successfully, but these errors were encountered: