Troubleshooting virtual machines

If a virtual machine fails to deploy

Review the error message on the VM right pane. One of the possible root causes is that compute nodes lack free RAM or CPU resources to host the VM.

If a virtual machine is in the error state

Admin panel

Examine the VM history in the History tab on the VM right pane. The event log will contain all of the VM management operations performed by users in the user or command-line interface. You can expand each log entry to view operation details by clicking the arrow icon next to it. The details include the operation name, date and time, status, initiator, and request ID.

Command-line interface

Use the following command:

vinfra service compute server event list [--long] --server <server>
--long
Enable access and listing of all fields of objects
--server <server>
Virtual machine ID or name

For example, to view the event log of the virtual machine myvm, run:

# vinfra service compute server event list --server myvm
+--------------+------------------+----------------------+----------------+---------------------+-------------+----------+---------+
| project_id   | server_id        | request_id           | action         | start_time          | user_id     | username | status  |
+--------------+------------------+----------------------+----------------+---------------------+-------------+----------+---------+
| 231f2740c<…> | 0ad154ad-aa52<…> | req-fbdacb0a-55f3<…> | live-migration | 2022-07-22T11:43<…> | effbd0f0<…> | admin    | Error   |
| 231f2740c<…> | 0ad154ad-aa52<…> | req-8145f911-02a6<…> | reboot         | 2022-07-22T09:11<…> | effbd0f0<…> | admin    | Success |
| 42166f19e<…> | 0ad154ad-aa52<…> | req-aff9b796-0378<…> | create         | 2022-07-21T17:48<…> | 646f5793<…> | admin1   | Success |
+--------------+------------------+----------------------+----------------+---------------------+-------------+----------+---------+

The details of a particular event are shown in the vinfra service compute server event show output:

# vinfra service compute server event show --server myvm req-fbdacb0a-55f3-4670-8af0-3465f2abd64f
+------------+------------------------------------------+
| Field      | Value                                    |
+------------+------------------------------------------+
| action     | live-migration                           |
| project_id | 231f2740c2704c6c8c06d0626d51346e         |
| request_id | req-fbdacb0a-55f3-4670-8af0-3465f2abd64f |
| server_id  | 0ad154ad-aa52-4b23-a780-7ecc96adcbb8     |
| start_time | 2022-07-22T11:43:51.172315Z              |
| status     | Error                                    |
| user_id    | effbd0f037714ff7886586d34e4d2a95         |
| username   | admin                                    |
+------------+------------------------------------------+

If a virtual machine is stuck in a failed or transitional state

Admin panel

Reset the VM to its last stable state: active, shut down or shelved:

  1. Click the stuck VM.
  2. On the VM right pane, click Reset state.

Command-line interface

Use the following command:

vinfra service compute server reset-state [--state-error] <server>
--state-error
Reset virtual machine to ‘ERROR’ state
<server>
Virtual machine ID or name

For example, to reset the transitional state of the virtual machine myvm to the previous one, run:

# vinfra service compute server reset-state myvm

If a virtual machine is stuck with the “Powering off” task state

In this case, a VM will have the “Active (Powering off)” status on its right pane.

You can cancel this task by using the following command:

vinfra service compute server cancel-stop <server>
<server>
Virtual machine ID or name

For example, to cancel shutdown for the virtual machine myvm if it has the “powering-off” task state, run:

# vinfra service compute server cancel-stop myvm

If a virtual machine fails to boot

Admin panel

Examine the VM console log by clicking Download console log on the VM right pane. The log will contain log messages only if logging is enabled inside the VM.

Command-line interface

Use the following command:

vinfra service compute server log <server>				
<server>
Virtual machine ID or name

For example, to print the log of the virtual machine myvm to the file myvm.log, run:

# vinfra service compute server log myvm > myvm.log			

The log will contain log messages only if logging is enabled inside the VM, otherwise the log will be empty.