nutanix.ansible icon indicating copy to clipboard operation
nutanix.ansible copied to clipboard

[Imprv] add functionality uefi boot_order to module ntnx_vms_v2

Open lm-sig opened this issue 1 month ago • 0 comments

Describe the request

The v4 API module ntnx_vms_v2 has the boot order parameters defined for legacy BIOS but not for UEFI.

The v4 API supports setting boot order but this was left out of the Ansible module. Adding 3 lines of code makes this work.

Current behaviour

Setting:

  boot_config:
    uefi_boot:
      boot_order:
        - DISK
        - CDROM
        - NETWORK

Fails.

Expected behaviour

Successful VM creation. VM boots from disk first.

I have modified my collection locally and this works as intended.

Modify: plugins/module_utils/v4/vmm/spec/vms.py

Add "boot_order" to the uefi_boot_spec definition.

Line 321 of version 2.0.0

    uefi_boot_spec = dict(
        is_secure_boot_enabled=dict(type="bool"),
        nvram_device=dict(
            type="dict", options=nvram_device_spec, obj=vmm_sdk.NvramDevice
        ),
        boot_order=dict(
            type="list", elements="str", choices=["CDROM", "NETWORK", "DISK"]
        ),
    )

You could also add "boot_device" to UEFI as well as the v4 API also supports setting it.

lm-sig avatar Jan 21 '25 03:01 lm-sig