Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion docs/management/ha.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,13 @@ If you shut the VM down with `Xen Orchestra` or `xe`, the VM will be stopped nor

However, if you halt the VM directly in the guest OS (via the console or in SSH), XCP-ng is NOT aware of what's going on. The system will think the VM is down and will consider that an anomaly. As a result, the VM will be **started automatically!**. This behavior prevents an operator from shutting down the system and leaving the VM unavailable for a long time.

#### Configure VM shutdown behavior

##### For an entire pool

:::tip

Starting with XAPI 25.16.0, VM restart behavior can be changed. To do this, run this command:
Starting with XAPI 25.16.0, VM restart behavior can be changed on a pool-wide basis. To do this, run this command:

```
xe pool-param-set uuid=... ha-reboot-vm-on-internal-shutdown=false
Expand All @@ -204,6 +208,22 @@ As a result, VMs that are shut down internally or through the API will restart t

:::

##### For specific VMs

If you don't want a VM to reboot automatically when it has been shut down from the guest OS, adjust the VM reboot behavior with the parameter called `Pool.ha_reboot_vm_on_internal_shutdown`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the pool-wide setting! There's no per VM setting, all you can do is to change the ha-restart-priority.


:::warning
Applying these changes means that your VMs will stay off after they have been shut down, until you restart them yourself.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This relates to the pool wide setting.

:::

- **Using the `xe` cli:** :
- To disable automatic reboots, run `xe vm-param-set uuid=<vm_uuid> ha-restart-priority=`.
- To (re-)enable automatic reboots, run `xe vm-param-set uuid=<vm_uuid> ha-restart-priority=restart` or `xe vm-param-set uuid=<vm_uuid> ha-restart-priority=best-effort`.
- **Using Xen Orchestra**:
To change the VM reboot behavior from Xen Orchestra, check out the instructions in the [Xen Orchestra documentation](https://docs.xen-orchestra.com/manage_infrastructure#vm-high-availability-ha).

Once you've changed the reboot parameter, shut the VM down. After you have started the VM again, feel free to re-enable automatic reboots.

### Host failure

We'll see 3 different scenarios for the host, with an example on 2 hosts, **lab1** and **lab2**:
Expand Down