Skip to content

ha.md: explain how to prevent automatic reboots on HA-protected VMs#459

Open
thomas-dkmt wants to merge 6 commits into
xcp-ng:masterfrom
thomas-dkmt:doc-ha-reboot-behavior
Open

ha.md: explain how to prevent automatic reboots on HA-protected VMs#459
thomas-dkmt wants to merge 6 commits into
xcp-ng:masterfrom
thomas-dkmt:doc-ha-reboot-behavior

Conversation

@thomas-dkmt
Copy link
Copy Markdown
Collaborator

@thomas-dkmt thomas-dkmt commented Apr 14, 2026

By default, HA-protected VMs reboot automatically after being shut down.

This pull request updates the XCP-ng documentation to explain how to prevent HA-protected VMs from restarting automatically after getting shut down (from within the guest OS).

Capture d'écran 2026-04-22 104305

By default, HA-protected VMs reboot automatically
after being shut down. This commit updates
the XCP-ng documentation to explain
how to disable HA features on a VM
or an entire pool,
to prevent VMs from
restarting automatically after getting shut down.

Signed-off-by: Thomas Moraine <thomas.moraine@vates.tech>
@thomas-dkmt thomas-dkmt requested a review from stormi as a code owner April 14, 2026 12:27
@thomas-dkmt thomas-dkmt requested a review from psafont April 14, 2026 12:27
Comment thread docs/management/ha.md Outdated
Comment thread docs/management/ha.md Outdated
@stormi
Copy link
Copy Markdown
Member

stormi commented Apr 14, 2026

So, I let a lot of commits pass previously, but doc(stuff) is not a convention followed on this repository. 98% of all PRs (made up stats) are documentation.

The historical convention was rather : "context: description" (where context will usually be the filename if only one is modified).

@thomas-dkmt thomas-dkmt changed the title doc(ha.md): explain how to prevent automatic reboots on HA-protected VMs ha.md: explain how to prevent automatic reboots on HA-protected VMs Apr 14, 2026
Signed-off-by: Thomas Moraine <thomas.moraine@vates.tech>
@thomas-dkmt thomas-dkmt requested a review from psafont April 14, 2026 13:04
Comment thread docs/management/ha.md Outdated
Once HA features have been disabled on your VM, shut the VM down. Once you have started the VM again, feel free to enable HA again.
:::

##### Disabling HA on the whole pool
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.

The pool-wide setting isn't about disabling HA for the whole pool. Of course, disabling HA would work too, but here the question is how to govern HA's behaviour when it's on.

Comment thread docs/management/ha.md Outdated

#### Configure VM shutdown behavior

If you don't want a VM to reboot automatically when it has been shut down from the guest OS: disable its HA protection, then adjust the VM reboot behavior with the parameter called `Pool.ha_reboot_vm_on_internal_shutdown` (see below).
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.

It was my understanding that you didn't have to both disable its HA protection and change the pool behaviour.

Comment thread docs/management/ha.md Outdated

You can prevent automatic reboots on your entire pool. To do this, use the `xe` CLI to run this command:

`xe pool-param-set uuid=$UUID ha-reboot-vm-on-internal-shutdown=false`.
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.

So, actually, we already wrote about this on line 203. The online search didn't find "ha-reboot-vm" and my local grep of the files was on "ha_reboot_vm" so I missed it.

@thomas-dkmt thomas-dkmt requested a review from stormi April 15, 2026 12:00
Signed-off-by: Thomas Moraine <thomas.moraine@vates.tech>
@thomas-dkmt thomas-dkmt force-pushed the doc-ha-reboot-behavior branch from 4ac2414 to 1c6bbe1 Compare April 15, 2026 12:01
Comment thread docs/management/ha.md Outdated
@@ -204,6 +208,22 @@ As a result, VMs that are shut down internally or through the API will restart t
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.

Not changed in this PR, but I find the phrasing ambiguous: "will restart the exact same way" leaves me unsure about the actual behaviour after a reboot.

Comment thread docs/management/ha.md Outdated

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

Comment thread docs/management/ha.md Outdated
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`.

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

Copy link
Copy Markdown
Member

@stormi stormi left a comment

Choose a reason for hiding this comment

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

I'll be direct, this PR is in a state that indicates either a lack of understanding of the changes being done, abuse of LLM, or both.

The instructions written in the previous commits
regarding ha protection and automatic vm reboot behavior
were confusing and/or inaccurate.
This commit makes the instructions less ambiguous.
Thanks stormi for the feedback!

Signed-off-by: Thomas Moraine <thomas.moraine@vates.tech>
@thomas-dkmt thomas-dkmt requested review from psafont and stormi April 22, 2026 08:44
Comment thread docs/management/ha.md Outdated
```
As a result, VMs that are shut down internally or through the API will restart the exact same way.

The `ha-reboot-vm-on-internal-shutdown` parameter indicates whether an HA-protected VM that is shut down from inside (not through the API) should be automatically rebooted when HA is enabled.
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.

I have doubts about this "not through the API".

There are two ways to shut a VM down via the API:

  • soft shutdown (default) => transmits the shutdown order to the OS itself, which shuts down by itself
  • hard shutdown => virtual electrical poweroff

How does HA behaves with regards to both these cases?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't know. @psafont , do you know more about this?

Copy link
Copy Markdown
Contributor

@psafont psafont Apr 27, 2026

Choose a reason for hiding this comment

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

The parameter is about shutdowns that are triggered from the guest OS (VM), in oposition to a xapi-initiated shutdown, I would word it differently:

The ha-reboot-vm-on-internal-shutdown parameter indicates whether VM-initiated shudotwns will trigger a restart for HA-protected VMs, for example, when a user clicks the shutdown in Windows.

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.

@psafont Do you know what happens with regards to HA if an admin triggers the VM shutdown from XAPI, either "soft" or "hard"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From the wording in https://docs.xenserver.com/en-us/xenserver/8/high-availability, and from the inspection of code I've seen, the restarts are only done when the VM shuts down and xapi did not give the order.

This also explain this new field: it's a way to differentiate when a VM restarts from within, and when a VM has stopped because its host has become offline.

…font

Signed-off-by: Thomas Moraine <thomas.moraine@vates.tech>
@thomas-dkmt thomas-dkmt requested a review from stormi May 7, 2026 06:47
Comment thread docs/management/ha.md Outdated
Comment thread docs/management/ha.md Outdated
Comment thread docs/management/ha.md Outdated
Comment thread docs/management/ha.md Outdated
Signed-off-by: Thomas Moraine <thomas.moraine@vates.tech>
@thomas-dkmt thomas-dkmt requested a review from psafont May 11, 2026 14:03
@thomas-dkmt thomas-dkmt requested a review from stormi May 11, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants