Stage 7 of NetOrk/netork#1820 on Proxmox VE: HA state, backups and votes in get_clusters(), live migration with PVE's own pre-flight, HA maintenance mode.
Changes
get_clusters(): /cluster/ha/resources, /cluster/ha/status/current, /cluster/ha/rules (PVE 9; PVE 8 gives rules: []); /cluster/backup with pool members (/pools?poolid=, falling back to /pools/{id}); the newest backup per guest on each backup storage, PBS included; /cluster/config/nodes votes. Each read is best-effort; a partial list is None, never half a list.
get_vm_migration_preflight(): qemu from GET …/qemu/{vmid}/migrate (refusal reasons in plain words, a local ISO in a CD drive as a local resource); lxc from cluster membership and mount points.
migrate_vm(): refuses a non-member or the current node before the API; online/with-local-disks/restart as fitting; follows the task, an HA-managed guest through the HA manager; on failure raises with the task log's ERROR: lines (log read with limit=50000).
set_node_maintenance(): ha-manager crm-command node-maintenance enable|disable over SSH, node validated and quoted.
New modules cluster_ha.py, cluster_backups.py, migration.py, vm_migrate_mixin.py, pve_values.py.
Testing
443 passed (coverage 74.84 %); ruff, mypy strict, napalm-standard check and ratchet green. Fixtures follow pve-ha-manager, pve-manager and qemu-server sources.
Needs NAPALM/napalm-device-types feat/vm-lifecycle merged first (the CI pre-installs device-types from main).
## Summary
Stage 7 of NetOrk/netork#1820 on Proxmox VE: HA state, backups and votes in `get_clusters()`, live migration with PVE's own pre-flight, HA maintenance mode.
## Changes
- `get_clusters()`: `/cluster/ha/resources`, `/cluster/ha/status/current`, `/cluster/ha/rules` (PVE 9; PVE 8 gives `rules: []`); `/cluster/backup` with pool members (`/pools?poolid=`, falling back to `/pools/{id}`); the newest backup per guest on each backup storage, PBS included; `/cluster/config/nodes` votes. Each read is best-effort; a partial list is None, never half a list.
- `get_vm_migration_preflight()`: qemu from `GET …/qemu/{vmid}/migrate` (refusal reasons in plain words, a local ISO in a CD drive as a local resource); lxc from cluster membership and mount points.
- `migrate_vm()`: refuses a non-member or the current node before the API; online/with-local-disks/restart as fitting; follows the task, an HA-managed guest through the HA manager; on failure raises with the task log's `ERROR:` lines (log read with `limit=50000`).
- `set_node_maintenance()`: `ha-manager crm-command node-maintenance enable|disable` over SSH, node validated and quoted.
- New modules `cluster_ha.py`, `cluster_backups.py`, `migration.py`, `vm_migrate_mixin.py`, `pve_values.py`.
## Testing
- 443 passed (coverage 74.84 %); ruff, mypy strict, `napalm-standard check` and `ratchet` green. Fixtures follow pve-ha-manager, pve-manager and qemu-server sources.
Needs NAPALM/napalm-device-types `feat/vm-lifecycle` merged first (the CI pre-installs device-types from main).
get_clusters() reads /cluster/ha/* (PVE 8 and 9), /cluster/backup with pool
members, the newest backup per guest on each backup storage (PBS included) and
/cluster/config/nodes votes; each read is best-effort. migrate_vm() moves a
guest of the connected node and follows the task (HA-managed guests through
the HA manager), raising with the task log's ERROR lines;
get_vm_migration_preflight() maps PVE's own pre-flight; set_node_maintenance()
runs ha-manager over SSH.
Part of NetOrk/netork#1820 (stage 7: #759, #760, #761).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Stage 7 of NetOrk/netork#1820 on Proxmox VE: HA state, backups and votes in
get_clusters(), live migration with PVE's own pre-flight, HA maintenance mode.Changes
get_clusters():/cluster/ha/resources,/cluster/ha/status/current,/cluster/ha/rules(PVE 9; PVE 8 givesrules: []);/cluster/backupwith pool members (/pools?poolid=, falling back to/pools/{id}); the newest backup per guest on each backup storage, PBS included;/cluster/config/nodesvotes. Each read is best-effort; a partial list is None, never half a list.get_vm_migration_preflight(): qemu fromGET …/qemu/{vmid}/migrate(refusal reasons in plain words, a local ISO in a CD drive as a local resource); lxc from cluster membership and mount points.migrate_vm(): refuses a non-member or the current node before the API; online/with-local-disks/restart as fitting; follows the task, an HA-managed guest through the HA manager; on failure raises with the task log'sERROR:lines (log read withlimit=50000).set_node_maintenance():ha-manager crm-command node-maintenance enable|disableover SSH, node validated and quoted.cluster_ha.py,cluster_backups.py,migration.py,vm_migrate_mixin.py,pve_values.py.Testing
napalm-standard checkandratchetgreen. Fixtures follow pve-ha-manager, pve-manager and qemu-server sources.Needs NAPALM/napalm-device-types
feat/vm-lifecyclemerged first (the CI pre-installs device-types from main).