• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xapi-project / xen-api / 28998131686
79%

Build:
DEFAULT BRANCH: master
Ran 09 Jul 2026 06:14AM UTC
Jobs 1
Files 36
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Jul 2026 02:37PM UTC coverage: 78.996%. Remained the same
28998131686

push

github

web-flow
xapi: report a clear error when host evacuation is blocked by unprotected VMs (#7145)

## Why

When HA is enabled on a pool, `host.evacuate` refuses to plan the
evacuation of
any VM that is not HA-protected, that is, whose `ha_restart_priority` is
not
`restart`. This is by design: the HA planner only accounts for protected
VMs, so
unprotected ones are left out of the plan.

The problem is the error reported in that situation.
`compute_evacuation_plan_no_wlb`
marked every unprotected VM with `HOST_NOT_ENOUGH_FREE_MEMORY`, and
`host.evacuate`
then raised it. That error is misleading in two ways:

* It blames free memory, so operators investigate RAM on the destination
hosts
  (which is usually plentiful) instead of the real cause.
* It is raised with a single parameter (the VM reference), while
`HOST_NOT_ENOUGH_FREE_MEMORY` is documented as taking `[needed;
available]`.
  Clients such as Xen Orchestra therefore render the available memory as
  `<unknown>`.

This has confused users for years. See #4323 and the forum reports
linked from
it: evacuation fails with `HOST_NOT_ENOUGH_FREE_MEMORY` even when the
destination
has tens of GB free, purely because a resident VM is not HA-protected.

## How

Introduce a dedicated error, `HOST_EVACUATE_VM_NOT_HA_PROTECTED`,
carrying the VM
reference, and raise it instead for unprotected VMs. The message states
the real
cause and the ways to resolve it (set the VM's `ha_restart_priority` to
`restart`, shut down or suspend the VM, or disable HA before evacuating
the
host).

Behaviour is otherwise unchanged: the evacuation still fails for these
VMs, it is
just reported correctly.

Files touched:

* `ocaml/xapi-consts/api_errors.ml`: declare the error.
* `ocaml/idl/datamodel_errors.ml`: register it with a description.
* `ocaml/xapi/xapi_host.ml`: raise it for unprotected VMs in the
evacuation plan.

## Testing

Built and tested on CI (build and test, unit tests, format, CodeChecker
and
ShellCheck all green on a fork branch... (continued)

3667 of 4642 relevant lines covered (79.0%)

0.79 hits per line

Jobs
ID Job ID Ran Files Coverage
1 python3.11 - 28998131686.1 09 Jul 2026 06:14AM UTC 36
79.0
GitHub Action Run
Source Files on build 28998131686
  • Tree
  • List 36
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28998131686
  • f9b42e6b on github
  • Prev Build on gh-readonly-queue/master/pr-7155-7c3b3ebd429f115271431501f983f5302992a29f (#28845181530)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc