vmware.vmware_rest.vcenter_vm_hardware_boot_device module – Manage the boot device order of a virtual machine.
Note
This module is part of the vmware.vmware_rest collection (version 5.0.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install vmware.vmware_rest.
To use it in a playbook, specify: vmware.vmware_rest.vcenter_vm_hardware_boot_device.
New in vmware.vmware_rest 5.0.0
Synopsis
Set the ordered list of devices that a virtual machine attempts to boot from.
The order of the entries determines the sequence in which the virtual machine tries each device during boot.
Each entry identifies a device class (such as CD-ROM or floppy) or a specific bootable device such as one or more virtual disks or an Ethernet adapter.
This module replaces the entire boot device order with the list provided in
devices.This module does not support idempotence. The module will always report a change.
Parameters
Parameter |
Comments |
|---|---|
The ordered list of devices the virtual machine attempts to boot from. The virtual machine tries each entry in the order it appears in this list. Providing this list replaces the current boot device order in its entirety. |
|
The ordered list of virtual disks to boot from for this entry. Relevant only when Each element must be the identifier (MOID) of a virtual disk, as returned by vmware.vmware_rest.vcenter_vm_hardware_disk_info. |
|
The virtual Ethernet adapter to boot from for this entry. Relevant only when Must be the identifier (MOID) of a virtual Ethernet adapter, as returned by vmware.vmware_rest.vcenter_vm_hardware_ethernet_info. |
|
The kind of device this boot entry represents.
Choices:
|
|
Timeout in seconds for the whole operation including connection establishment, request sending, and response. Default: |
|
The desired state of the resource. Use Choices:
|
|
The hostname or IP address of the vSphere vCenter. If the value is not specified in the task, the value of environment variable |
|
The vSphere vCenter password. If the value is not specified in the task, the value of environment variable |
|
The port number of the vSphere vCenter. If the value is not specified in the task, the value of environment variable |
|
Optional path to a log file for HTTP REST interaction. If the value is not specified in the task, the value of environment variable |
|
The vSphere vCenter username. If the value is not specified in the task, the value of environment variable |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Choices:
|
|
Identifier of the virtual machine whose boot device order should be managed. Must be an identifier (MOID) for a |
Notes
Note
Generated from vSphere API spec 9.1.0.
Compatible with vSphere API 7.0.3.
Compatible with vSphere API 8.0.2.
Examples
- name: Look up the virtual machine by name
register: search_result
vmware.vmware_rest.vcenter_vm_info:
filter_names:
- test_vm1
- name: Boot from the CD-ROM device only
vmware.vmware_rest.vcenter_vm_hardware_boot_device:
vm: '{{ search_result.value[0].vm }}'
devices:
- type: CDROM
state: present
- name: Set a boot order that tries the CD-ROM, then a disk, then the network
vmware.vmware_rest.vcenter_vm_hardware_boot_device:
vm: '{{ search_result.value[0].vm }}'
devices:
- type: CDROM
- type: DISK
disks:
- '16000'
- type: ETHERNET
nic: '4000'
state: present
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
MOID of the virtual machine whose boot device order was managed. Returned: When state is present, or when a resource is deleted, or when state is set to a supported action. Sample: |
|
The raw API response body from the vCenter operation. The boot device update endpoint returns no content on success, so this value is typically empty. Returned: On success. Sample: |