scale_computing.hypercore.vm_snapshot_attach_disk module – Attach a disk from a snapshot to a VM on HyperCore API.
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_snapshot_attach_disk
.
New in scale_computing.hypercore 1.2.0
Synopsis
Use this module to attach a disk from a snapshot to a desired VM on HyperCore API.
Specified disk from source snapshot will be cloned. Cloned disk is then attached to the destination VM.
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 |
|
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:
|
|
How long does ansible controller wait for VMs response to a shutdown request. In seconds. Default: |
|
Specify a disk slot from source snapshot to identify source disk. |
|
Specify a disk type from source snapshot. |
|
UUID of the snapshot we want to use on a VM. |
|
Specify a disk slot from a vm to identify destination disk. Note that this MUST be a next free slot or an already used slot for the given disk_type. Otherwise VM might not boot. |
|
Type of disk on the VM that we want to attach a VM snapshot disk to. |
|
Name of the VM we want to attach a VM snapshot disk to. |
Notes
Note
check_mode
is not supportedThe VM will be rebooted if it is running.
See Also
See also
- scale_computing.hypercore.vm_snapshot_info
List VM snapshots on HyperCore API.
Examples
- name: Attach a disk from a VM Snapshot to a VM
scale_computing.hypercore.vm_snapshot_attach_disk:
vm_name: example-vm
vm_disk_type: ide_disk
vm_disk_slot: 42
source_snapshot_uuid: 116d51cc-ec25-4628-a092-86de42699aac
source_disk_type: virtio_disk
source_disk_slot: 1
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Newly attached disk from a VM snapshot to a VM. Returned: success |
|
Disk slot. Returned: success Sample: |
|
Total capacity, in bytes. Returned: success Sample: |
|
Disk type. Returned: success Sample: |
|
Disk unique identifier. Returned: success Sample: |
|
VM unique identifier. Returned: success Sample: |
|
Info if reboot of the VM was performed. Returned: success Sample: |