scale_computing.hypercore.vm_node_affinity module – Update virtual machine’s node affinity
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_node_affinity
.
New in scale_computing.hypercore 1.0.0
Synopsis
Module updates selected virtual machine node affinity. preferred_node or backup_node can be configured for each VM. The term node later in this text means either preferred_node or backup_node.
The node can be selected by one or more parameters - node_uuid, backplane_ip, lan_ip and/or peer_id. If node is selected by multiple parameters, then all parameters must match, e.g. module internally performs logical
AND
when searching for matching node UUID.If strict_affinity is set to
true
, VM will only run on preferred_node or backup_node.If node is not set, the old value of the node.node_uuid will be kept.
If node.node_uuid is set to empty string, the existing value of the node.node_uuid will be deleted.
Parameters
Parameter |
Comments |
---|---|
Backup node in the event that preferred_node is unavailable Can be set by One of the options should be enough. In case that all are set, logical AND operation is used. Task will FAIL in case that node can not be uniquely identified. |
|
Backplane IP of the backup node |
|
Lan IP of the backup node |
|
Unique identifier of backup node |
|
Peer ID of the backup node |
|
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 |
|
Preferred node to run the VM Can be set by One of the options should be enough. In case that all are set, logical AND operation is used. Task will FAIL in case that node can not be uniquely identified. |
|
Backplane IP of the preferred node |
|
Lan IP of the preferred node |
|
Unique identifier of preferred node |
|
Peer ID of the preffered node |
|
Enable or disable strict enforcement of affinity strategy. If Choices:
|
|
Virtual machine name. Used to identify selected virtual machine by name. |
Notes
Note
check_mode
is not supported.
See Also
See also
- scale_computing.hypercore.node_info
Returns information about the nodes in a cluster.
Examples
- name: Set VM node affinity by node uuid
scale_computing.hypercore.vm_node_affinity:
vm_name: demo-vm
strict_affinity: true
preferred_node:
node_uuid: "412a3e85-8c21-4138-a36e-789eae3548a3"
backup_node:
node_uuid: "3dd52913-4e60-46fa-8ac6-07ba0b2155d2"
- name: Set VM node affinity by backplane IP, lan IP, and peer ID
scale_computing.hypercore.vm_node_affinity:
vm_name: demo-vm
strict_affinity: true
preferred_node:
backplane_ip: "10.0.0.1"
lan_ip: "10.0.0.1"
peer_id: 1
backup_node:
backplane_ip: "10.0.0.2"
lan_ip: "10.0.0.2"
peer_id: 2
- name: Set strict affinity to false and delete the nodes
scale_computing.hypercore.vm_node_affinity:
vm_name: demo-vm
strict_affinity: false
preferred_node:
node_uuid: ""
backup_node:
node_uuid: ""
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Info about node affinity update status. Returned: always Sample: |