scale_computing.hypercore.vm_boot_devices module – Manage HyperCore VM’s boot devices
Note
This module is part of the scale_computing.hypercore collection (version 1.6.0).
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 scale_computing.hypercore
.
To use it in a playbook, specify: scale_computing.hypercore.vm_boot_devices
.
New in scale_computing.hypercore 1.0.0
Synopsis
Use this module to reconfigure VM boot devices.
VM boot devices can be set exactly to provided list, or provided list can be inserted before or after current VM boot devices.
Parameters
Parameter |
Comments |
---|---|
Scale Computing HyperCore instance information. |
|
Select login method. If not set, the value of the Value local - username/password is verified by the HyperCore server (the local users). Value oidc - username/password is verified by the configured OIDC provider. Choices:
|
|
The HyperCore instance URL. If not set, the value of the For example “https://10.1.2.3:443”. |
|
Password used for authentication. If not set, the value of the |
|
Timeout in seconds for the connection with the Scale Computing HyperCore API instance. If not set, the value of the |
|
Username used for authentication. If not set, the value of the |
|
Only relevant if state=present. If you want to assign the device the first order, set the value of Choices:
|
|
Can VM be forced to power off and on. Only used when modifications to the VM require it to be powered off and VM does not respond to a shutdown request within shutdown_timeout limit. Before this is utilized, a shutdown request is sent. Choices:
|
|
The boot devices items we want to change. Default: |
|
If setting the boot device order of disk, that is type=virtio_disk, type=ide_disk, type=scsi_disk, type=ide_floppy or type=nvram disk slot is required to be specified. If setting the boot device order of CD-ROM, that is type=ide_cdrom, at least one of iso_name or disk_slot is required. If type=nic, disk_slot is not relevant. At least one of disk_slot, nic_vlan and |
|
The name of ISO image that CD-ROM device is attached to. Only relevant if type=ide_cdrom. If type=cdrom, at least one of iso_name or disk_slot is required to identify CD-ROM device. Otherwise, iso_name is not relevant. At least one of disk_slot, nic_vlan and iso_name is required to identify the VM device to which we’re setting the boot order. |
|
NIC’s vlan. If type=nic, nic_vlan is required. Otherwise, nic_vlan is not relevant. At least one of disk_slot, nic_vlan or iso_name is required to identify the VM device to which we’re setting the boot order. |
|
The type of device we want to set the boot order to. If setting the boot order for NIC, type should be equal to If setting the boot order for disk, type should be equal to one of the specific disk types, listed below. Choices:
|
|
How long does ansible controller wait for VMs response to a shutdown request. In seconds. Default: |
|
The desired state of the boot devices specified by If state=present devices specified by If state=absent devices specified by If state=set VM boot devices will be set exactly to devices specified by Choices:
|
|
Virtual machine name. Used to identify selected virtual machine by name. |
Notes
Note
check_mode
is not supported.
Examples
- name: Set exact boot order
scale_computing.hypercore.vm_boot_devices:
vm_name: name-of-desired-vm
items:
- type: virtio_disk
disk_slot: 2
- type: nic
nic_vlan: 10
state: set
register: result
- name: Set device as bootable
scale_computing.hypercore.vm_boot_devices:
vm_name: name-of-desired-vm
items:
- type: nic
nic_vlan: 2
state: present
register: result
- name: Set device as not bootable
scale_computing.hypercore.vm_boot_devices:
vm_name: name-of-desired-vm
items:
- type: nic
nic_vlan: 10
state: absent
register: result
- name: Set device as first boot device
scale_computing.hypercore.vm_boot_devices:
vm_name: name-of-desired-vm
force_reboot: true
shutdown_timeout: "{{ '5minutes' | community.general.to_time_unit('seconds') }}"
items:
- type: virtio_disk
disk_slot: 2
- type: nic
nic_vlan: 5
state: present
first: true
register: result
- name: Set ISO as first boot device. Identifying CD-ROM by field iso_name
scale_computing.hypercore.vm_boot_devices:
vm_name: name-of-desired-vm
items:
- type: ide_cdrom
iso_name: TinyCore-current.iso # name of ISO image, but it can be used only if ISO is inside CD-ROM
state: present
first: true
register: result
- name: Set ISO as first boot device. Identifying CD-ROM by field disk_slot
scale_computing.hypercore.vm_boot_devices:
vm_name: name-of-desired-vm
items:
- type: ide_cdrom
disk_slot: 2
state: present
first: true
register: result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
VM’s device that we’re assigning the boot order to, which can be either disks from the API endpoint Returned: success |
|
The cache mode the block device will use Returned: success Sample: |
|
Disables the ability to snapshot the drive Returned: success Sample: |
|
Virtual slot the drive will occupy Returned: success Sample: |
|
Name of the virtual storage device Returned: success Sample: |
|
Mount points of the drive in the guest OS, populated by the guest-agent Returned: success Sample: |
|
When true, this device was created via VirDomainSnapshotBlockDeviceCreate with VirDomainSnapshotBlockDeviceCreateOptions Returned: success Sample: |
|
Logical size of the device in bytes, and can be increased on update or clone Returned: success Sample: |
|
SSD tiering priority factor for block placement Returned: success Sample: |
|
The bus type the block device will use Returned: success Sample: |
|
Unique Identifier Returned: success Sample: |
|
Identifier of the VirDomain this device is attached to Returned: success Sample: |
|
Info if reboot of the VM was performed. Returned: success Sample: |