community.vmware icon indicating copy to clipboard operation
community.vmware copied to clipboard

vmware_guest does not reconfigure hardware boot_firmware or scsi on template

Open MallocArray opened this issue 8 months ago • 0 comments

SUMMARY

Similar to https://github.com/ansible-collections/community.vmware/issues/64 After deploying a VM from a Content library OVF, attempting to use vmware_guest to configure the hardware of this present VM reports a status of OK, but boot_firmware and scsi type are not changed to match configuration

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.vmware.vmware_guest

ANSIBLE VERSION
ansible [core 2.14.11]
  config file = /runner/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /runner/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.18 (main, Sep  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection       Version
---------------- -------
community.vmware 3.9.0  
CONFIGURATION
COLLECTIONS_PATHS(/runner/ansible.cfg) = ['/runner/collections']
CONFIG_FILE() = /runner/ansible.cfg
DEFAULT_FILTER_PLUGIN_PATH(/runner/ansible.cfg) = ['/runner/custom_filters']
DEFAULT_ROLES_PATH(/runner/ansible.cfg) = ['/runner/roles']
DEFAULT_STRATEGY_PLUGIN_PATH(/runner/ansible.cfg) = ['/runner/custom_plugins/mitogen-0.3.4/ansible_mitogen/plugins/strategy']
DEFAULT_TIMEOUT(/runner/ansible.cfg) = 40
HOST_KEY_CHECKING(/runner/ansible.cfg) = False
PARAMIKO_LOOK_FOR_KEYS(/runner/ansible.cfg) = False
OS / ENVIRONMENT

EE built on centos Stream9 vCenter 7.0 U3o

STEPS TO REPRODUCE
- name: VM other hardware settings when powered off
  community.vmware.vmware_guest:
    hostname: "{{ vcenter }}"
    username: "{{ vcenter_user }}"
    password: "{{ vcenter_password }}"
    validate_certs: "{{ vmware_validate_certs }}"
    datacenter: "{{ vcenter_datacenter }}"
    cluster: "{{ vcenter_cluster }}"
    folder: "{{ vcenter_vm_folder }}"
    name: "{{ computername }}"
    hardware:
      boot_firmware: "{{ boot_firmware | default(omit) }}"
      scsi: "{{ scsi | default(omit) }}"
    force: true
  when:
    - vm_creation.instance.hw_power_status == 'poweredOff'
  delegate_to: localhost
EXPECTED RESULTS

The VM is configured for EFI boot and SCSI controller is set to paravirtual, since those are what the variables are set to

ACTUAL RESULTS

Task results in an OK status, but these settings are not changed in the VM, even when it is powered off.

Based on the previous Issue mentioned above, I see this is maybe expected for a Template VM, but not indicated in the documentation anywhere, and the mentioned replacement modules vm_hardware_boot do not appear to exist at this time.

Gives false confidence that a VM will be configured the way that Ansible has been told to configure it, when it is not. Seems like if it cannot modify it, and it does not match the desired config, that the task should fail, as reporting OK when it is not configured causes confusion and needless troubleshooting.


MallocArray avatar Dec 11 '23 20:12 MallocArray