scale_computing.hypercore.vm_info module – Retrieve information about the VMs.

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_info.

New in scale_computing.hypercore 1.0.0

Synopsis

  • Retrieve information about all or single VM present on the cluster.

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.

vm_name

string

VM’s name.

Serves as unique identifier across endpoint VirDomain.

If specified, the VM with that name will get returned. Otherwise, all VMs are going to get returned.

Examples

- name: Retrieve specific VM
  scale_computing.hypercore.vm_info:
    vm_name: demo-vm
  register: result

- name: Retrieve all VMs.
  scale_computing.hypercore.vm_info:
  register: result

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 VMs records.

Returned: success

boot_devices

list / elements=dictionary

Bootable disks or nics, in the order that they will boot

Returned: success

Sample: {"cache_mode": "none", "disable_snapshotting": false, "disk_slot": 2, "iso_name": "", "mount_points": [], "read_only": false, "size": 10737418240, "tiering_priority_factor": 8, "type": "virtio_disk", "uuid": "d48847d0-91b1-4edf-ab28-3be864494711", "vm_uuid": "183c5d7c-1e2e-4871-84e8-9ef35bfda5ca"}

description

string

Human-readable description

Returned: success

Sample: "demo-vm-description"

disks

list / elements=dictionary

Attached virtual block devices

Returned: success

Sample: {"cache_mode": "none", "disable_snapshotting": false, "disk_slot": 0, "iso_name": "", "mount_points": [], "read_only": false, "size": 8100100100, "tiering_priority_factor": 8, "type": "virtio_disk", "uuid": "e8c8aa6b-1043-48a0-8407-2c432d705378", "vm_uuid": "1596dab1-6f90-494c-9607-b14221830433"}

nics

list / elements=dictionary

Attached virtual network devices

Returned: success

Sample: {"connected": true, "ipv4_addresses": [], "mac": "12-34-56-78-AB", "type": "virtio", "uuid": "07a2a68a-0afa-4718-9c6f-00a39d08b67e", "vlan": 15}

node_affinity

dictionary

VM’s node affinity strategy

Returned: success

Sample: {"backup_node": {"backplane_ip": "10.0.0.3", "lan_ip": "10.0.0.4", "node_uuid": "f6v3c6b3-99c6-475b-8e8e-9ae2587db5fc", "peer_id": 2}, "preferred_node": {"backplane_ip": "10.0.0.1", "lan_ip": "10.0.0.2", "node_uuid": "638920f2-1069-42ed-b311-5368946f4aca", "peer_id": 1}, "strict_affinity": true}

power_state

string

VM’s power state

Returned: success

Sample: "stopped"

replication_source_vm_uuid

string

added in scale_computing.hypercore 1.3.0

UUID of source VM if this VM is a replicated VM. Empty string is returned if this VM is not replicated.

Returned: success

Sample: "64c9b3a1-3eab-4d16-994f-177bed274f84"

snapshot_schedule

string

Name identifier of a snapshot schedule for automated snapshots

Returned: success

Sample: "demo-snapshot-schedule"

tags

string

User-modifiable words for organizing a group of VMs

Returned: success

Sample: "group-name,tag1,tag2"

uuid

string

Unique identifier

Returned: success

Sample: "f0c91f97-cbfc-40f8-b918-ab77ae8ea7fb"

vcpu

integer

Number of allotted virtual CPUs

Returned: success

Sample: 2

vm_name

string

Human-readable virtual machine name

Returned: success

Sample: "demo-vm"

Authors

  • Domen Dobnikar (@domen_dobnikar)

  • Tjaž Eržen (@tjazsch)