This section describes the unstable scenarios that can occur while executing Ansible commands on the cluster and which operations should be performed to recover a stable situation.
Ansible command is interrupted
The execution of a cluster_vm command can be interrupted for different reasons: crash on the hypervisor, network failure, manual stop of the operation… For the commands that modify the system, the interruption might result in an undesirable scenario, where a fix action will be required:
Command | How to fix |
create | Re-call the command with the force parameter set to true. |
clone | |
remove | Re-call the command. |
start | |
stop | |
create_snapshot | |
rollback_snapshot | |
remove_snapshot | |
enable | |
disable | |
purge_image | Note: purging snapshots according to number or date is not transactional. In case of interruption only a part of them might be removed. In this case, it is necessary to re-call the transaction. |
VM cannot be enabled
Enabling a VM on the Pacemaker cluster might fail if its XML configuration is invalid. Pacemaker will detect it and the VM will remain in a Stopped or Failed state, triggering a Timeout error. The commands that can enable a VM are:
...
(*) Note: Calling the create or clone commands with the force parameter set to true will automatically remove the VM before its creation.
“VM is not on the cluster” error
If the VM is not enabled on the Pacemaker cluster there are three commands that will fail with the “VM is not on the cluster” error.
Command | Error message | How to fix |
start | VM is not on the cluster. | VM has to be created and enabled on the cluster. |
stop | ||
disable |
Unnecessary action / accessing nonexistent VM, snapshot or metadata
Creating a VM or snapshot that already exists or trying to access a nonexistent VM, snapshot or metadata will fail according to the following errors:
Command | Error message | How to fix |
create | VM already exists. | Choose a nonexistent VM name. |
clone | VM already exists. | Choose an nonexistent VM name. |
Error opening image. | Choose an existent VM name. | |
remove | VM does not exist. | Choose an existing VM name. |
list_snapshots | Error opening image. | Choose an existing VM name. |
create_snapshot | Error opening image. | Choose an existent VM name. |
Snapshot already exists. | Choose a nonexistent snapshot_name. | |
rollback_snapshot | Error opening image. | Choose an existent VM name. |
Snapshot does not exist on VM. | Choose an existent snapshot_name. | |
remove_snapshot | Error opening image. | Choose an existent VM name. |
Error checking if snapshot is protected. | Choose an existent snapshot_name. | |
purge_image | Error opening image. | Choose an existent VM name. |
get_metadata | Error opening image. | Choose an existent VM name. |
No metadata for image. | Choose an existent metadata_name. |
Invalid parameter name
Names for VMs, snapshots and metadata keys must only contain letters and numbers without spaces. Additionally, metadata has also reserved keys that cannot be used. In case of not following these rules, the commands create, clone and create_snapshot will fail with the error “Parameter must not contain spaces or special chars”.
...