scale_computing.hypercore.virtual_disk_attach module – Clones an uploaded virtual disk and attaches it to a virtual machine.
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.virtual_disk_attach
.
New in scale_computing.hypercore 1.2.0
Synopsis
Clones an uploaded virtual disk and attaches it to a virtual machine.
If selected slot is not empty, selected virtual disk will not be attached.
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 |
|
The disk that will be created when selected virtual disk is attached to selected virtual machine. |
|
The cache mode the virtual machine will use. Choices:
|
|
Disables the ability to snapshot the drive. Choices:
|
|
Virtual slot the drive will occupy. |
|
Mount the new block device as read-only. Choices:
|
|
Regenerate the disk ID, e.g. GPT UUID or MBR signature. Choices:
|
|
Logical size of the block device in bytes. Should be greater or equal than the size of virtual disk. If smaller then capacity of the new block device/disk will automatically be set to the size of source virtual disk. If not set, defaults to size of source virtual disk. |
|
SSD tiering priority factor for block placement. Check the tiering documentation for best practices when modifying this. Not relevant for cluster that only has a single tier - ie. only spinning disk or all flash. Choices:
|
|
The bus type the block device will use. If type=ide_cdrom, iso_name is also required. Se documentation of iso_name for more details. Choices:
|
|
Name of the virtual disk that we want to attach. Used as a unique identifier of an uploaded virtual disk. |
|
Virtual machine name. Used to identify selected virtual machine by name. |
See Also
See also
- scale_computing.hypercore.virtual_disk
Handles virtual disks on Hypercore cluster.
- scale_computing.hypercore.virtual_disk_info
List virtual disks on HyperCore API.
- scale_computing.hypercore.vm_disk
Manage VM’s disks.
Examples
- name: Clone an uploaded virtual disk and attach it to a virtual machine.
scale_computing.hypercore.virtual_disk_attach:
name: foobar.qcow2
vm_name: my_virtual_machine
disk:
type: virtio_disk
disk_slot: 0
size: "{{ '11.1 GB' | human_to_bytes }}"
cache_mode: writethrough
disable_snapshotting: true
tiering_priority_factor: 8
read_only: true
regenerate_disk_id: false
register: disk
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Created and attached disk or existing disk in Returned: success |
|
The cache mode the VirDomainBlockDevice 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: |
|
True if the device is read-only 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 VirDomainBlockDevice will use Returned: success Sample: |
|
Unique Identifier Returned: success Sample: |
|
Identifier of the VirDomain this device is attached to Returned: success Sample: |