scale_computing.hypercore.vm_snapshot_info module – List VM snapshots 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_info.

New in scale_computing.hypercore 1.2.0

Synopsis

  • Use this module to list information about the VM Snapshots on HyperCore API.

Parameters

Parameter

Comments

cluster_instance

dictionary

Scale Computing HyperCore instance information.

auth_method

string

Select login method. If not set, the value of the SC_AUTH_METHOD environment variable will be used.

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:

  • "local" ← (default)

  • "oidc"

host

string / required

The HyperCore instance URL.

If not set, the value of the SC_HOST environment variable will be used.

For example “https://10.1.2.3:443”.

password

string / required

Password used for authentication.

If not set, the value of the SC_PASSWORD environment variable will be used.

timeout

float

Timeout in seconds for the connection with the Scale Computing HyperCore API instance.

If not set, the value of the SC_TIMEOUT environment variable will be used.

username

string / required

Username used for authentication.

If not set, the value of the SC_USERNAME environment variable will be used.

label

string

List snapshots by this desired snapshot label

serial

integer

List snapshots by this desired serial

vm_name

string

List snapshots by this desired VM name

Examples

- name: List all VM snapshots on HyperCore API
  scale_computing.hypercore.vm_snapshot_info:
  register: vm_snapshot

- name: List all VM snapshots on HyperCore API with label="example-label"
  scale_computing.hypercore.vm_snapshot_info:
    label: example-label
  register: vm_snapshot

- name: List all VM snapshots on HyperCore API with vm_name="example-vm"
  scale_computing.hypercore.vm_snapshot_info:
    vm_name: example-vm
  register: vm_snapshot

- name: List all VM snapshots on HyperCore API with serial=0
  scale_computing.hypercore.vm_snapshot_info:
    serial: 0
  register: vm_snapshot

- name: >-
    List all VM snapshots on HyperCore API with
    label="example-label", vm_name="example-vm", serial=0
  scale_computing.hypercore.vm_snapshot_info:
    label: example-label
    vm_name: example-vm
    serial: 0
  register: vm_snapshot

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

records

list / elements=dictionary

A list of VM Snapshot records.

Returned: success

automated_trigger_timestamp

integer

Unix timestamp used when determining which automated snapshots to retain

Returned: success

Sample: 0

block_count_diff_from_serial_number

integer

Snapshot serial number of the previous snapshot

Returned: success

Sample: 2

device_snapshots

list / elements=string

Snapshots of each VM block device

Returned: success

Sample: [{"uuid": "adcfc72f-4578-48b1-a7f8-da4d9ee915ed"}]

label

string

User-readable label describing the snapshot

Returned: success

Sample: "snap-2"

local_retain_until_timestamp

integer

Unix timestamp indicating when automated snapshots will be automatically removed

Returned: success

Sample: 0

remote_retain_until_timestamp

integer

Unix timestamp indicating when remote automated snapshots will be removed

Returned: success

Sample: 0

replication

boolean

Will replicate snapshot to a remote system or not in case if replication is configured

Returned: success

Sample: true

snapshot_uuid

string

Snapshot’s unique identifier

Returned: success

Sample: "28d6ff95-2c31-4a1a-b3d9-47535164d6de"

timestamp

integer

Unix timestamp of when snapshot was created

Returned: success

Sample: 1679397326

type

string

Snapshot type

Returned: success

Sample: "USER"

vm

dictionary

source VM

Returned: success

Sample: {"disks": [{"cache_mode": "writethrough", "disable_snapshotting": false, "disk_slot": 0, "iso_name": "example.iso", "read_only": false, "size": 107374182, "tiering_priority_factor": 8, "type": "virtio_disk", "uuid": "adcfc72f-4578-48b1-a7f8-da4d9ee915ed"}], "name": "snapshot-test-vm-1", "snapshot_serial_number": 3, "uuid": "5e50977c-14ce-450c-8a1a-bf5c0afbcf43"}

vm_name

string

name of the source VM

Returned: success

Sample: "snapshot-test-vm-1"

Authors

  • Ana Zobec (@anazobec)