scale_computing.hypercore.vm_snapshot module – Handles VM snapshots.
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
.
New in scale_computing.hypercore 1.2.0
Synopsis
Use this module to perform snapshot creation or deletion.
No snapshot will be created if VM already has a snapshot with same label as passed to module. This allows rerunning the playbook in idempotent way. Ansible will create a given snapshot only first time. This is notable difference from web UI, where user can create multiple snapshots with same label.
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 |
|
Snapshot label, used as identificator in combination with vm_name. Must be unique for a specific VM. |
|
When false, will not replicate snapshot to a remote system if replication is configured. Choices:
|
|
How many days does hypercore retain snapshot. Local and remote retention is set by this. Number of days. VM must be powered on during automatic deletion process. |
|
State of the snapshot. Choices:
|
|
Snapshot uuid, used as identificator. Can be used instead of label. Must be unique. |
|
source VM name. |
See Also
See also
- scale_computing.hypercore.vm_snapshot_info
List VM snapshots on HyperCore API.
Examples
- name: Create snapshot with label "new" from VM "test-VM"
scale_computing.hypercore.vm_snapshot:
vm_name: test-VM
label: new
state: present
register: vm_snapshot
- name: Create snapshot with label "new" from VM "test-VM" that will automatically delete after 30 days
scale_computing.hypercore.vm_snapshot:
vm_name: test-VM
label: new
retain_for: 30
state: present
register: vm_snapshot
- name: Delete snapshot with label "new" made from VM with name "test-VM"
scale_computing.hypercore.vm_snapshot:
vm_name: test-VM
label: new
state: absent
register: vm_snapshot
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Snapshot record. Returned: success |
|
Unix timestamp used when determining which automated snapshots to retain. Returned: success Sample: |
|
Snapshot serial number of the previous snapshot. Returned: success Sample: |
|
Snapshot label. Returned: success Sample: |
|
Snapshot local retention timestamp. Returned: success Sample: |
|
Snapshot remote retention timestamp. Returned: success Sample: |
|
Replicaiton. Returned: success Sample: |
|
Snapshot unique identifier. Returned: success Sample: |
|
Timestamp of snapshot creation. Returned: success Sample: |
|
Snapshot type. Returned: success Sample: |
|
Virtual machine used in snapshot. Returned: success Sample: |