Migration & balancing
NexoVirt can move a VM or container to another node of the same cluster or to one of your other hosts, empty a node before
maintenance, pick the best node for new guests and suggest moves when a node runs hot. All of this
needs the hosts.manage permission.
Cross-host migration
Section titled “Cross-host migration”A migration moves a guest between two separate hosts in NexoVirt (two standalone nodes, or a
node and a cluster). It uses Proxmox’s remote_migrate, so the guest’s disks are copied over the
network to the target. Moves between nodes of the same Proxmox cluster use Proxmox’s own
migration instead, see Same-cluster migration.
| Guest state | How it moves |
|---|---|
| Running VM or container | Shut down, moved, started again: the panel shuts it down cleanly, moves it offline and starts it on the target (short downtime). |
| Stopped guest | Offline, and it stays stopped. |
NexoVirt never moves a running guest live: a live move carries the running memory over, and when the CPUs or Proxmox versions of the two nodes differ the guest can crash on the target. If a server does not shut down within the Shutdown timeout (Settings → Migration, default 300 seconds) it is force-stopped. If even that fails, the migration stops before anything is copied and the server keeps running on the source. A move that fails after the shutdown starts the server again on the source.
Requirements
Section titled “Requirements”- Both nodes run Proxmox VE 7.3 or newer.
- The source node can reach the target’s Proxmox API port (TCP 8006). The panel tests this through the source node’s agent before starting.
- A current node agent on the source node (for the reachability test) and, if port-forwards move along, on the target node.
- The target node is online and not in maintenance mode.
The guest itself must not:
- be a template,
- have snapshots (delete them first),
- have PCI or USB passthrough devices or a mounted ISO image,
- use settings only
root@pammay apply on the target (LXCdevNentries, rawlxc.*keys, bind mounts), - have more than one IP address managed by the panel,
- be managed by Proxmox VE high availability (remove it from HA first),
- be busy with another Proxmox task or panel action.
Starting a migration
Section titled “Starting a migration”- Open the guest’s page and click Migrate.
- Choose the Target node. The other nodes of the guest’s own cluster come first, labelled Same cluster; nodes of other connections follow. Nodes in maintenance mode are not listed. The dialog then loads the plan for that node.
- Review the plan:
- Summary: data to copy, Expected duration and the check count.
- Mapping: each disk storage and network bridge mapped to one on the target. Storages and bridges with the same name are pre-selected.
- Network: the IP plan and port-forward plan (see below).
- Needs attention lists blocking problems and warnings; Checks passed lists the rest.
- Click Migrate. You land on the live progress page.
Expected duration is the average of earlier successful migrations between the same two nodes. Without any earlier migration on that route it shows “Duration unknown”. The dialog also shows how long the guest will be stopped.
IP plan
Section titled “IP plan”If the guest has an IP address from an IP zone:
- The address is kept when a zone on the target covers it and it is free there.
- Otherwise choose an IP zone on the target, and the guest gets the next free address from it.
Guests with a DHCP or manually set address are left untouched. For such a guest the pre-flight warns (it never blocks) when its own static address does not fit the network of the target bridge (the guest has no working network there until you change the address inside the guest), and when NAT rules on the source node that NexoVirt did not create forward ports to it (they stay on the source and point nowhere after the move).
Port-forward plan
Section titled “Port-forward plan”Port-forwards pointing at the guest move to the target node’s NAT. If a public port is already taken there, the dialog shows the New public port it will use. Tick Drop these port-forwards instead of moving them if you do not need them on the target. Moving forwards needs NAT configured on the target node.
During and after the transfer
Section titled “During and after the transfer”The progress page shows each step and a live log. When the migration is done it takes you to the guest on its new host.
- The panel creates a short-lived API token on the target for the transfer and deletes it afterwards.
- After the transfer the panel applies the IP plan, moves the port-forwards and re-points the panel records (owner, plan and so on) to the new guest. Problems in these steps finish the migration as Done with warnings instead of failing it.
- If a migration fails after the data was already transferred, Retry continues from there instead of copying again.
- If the transfer fails while the target node does not answer, a partly copied guest may be left there. The log then says “The target node did not answer, so a possible incomplete copy (VMID id on node) was not removed. Check that node before you retry.”
Interrupted migrations
Section titled “Interrupted migrations”The panel keeps the Proxmox task of a running transfer. If the panel restarts or its worker stops during a migration (reboot, out of memory), the job is put back in the queue and continues from that task: once the transfer finished on Proxmox, the post-transfer steps run; a failed task fails the migration cleanly, and the next Retry starts a fresh transfer. The log shows “The worker stopped during the migration. Resuming: the transfer task on Proxmox is checked again.” The temporary API token of the interrupted run is revoked.
The same applies to every queued job (create, reinstall, power and so on): when the worker that ran a job is gone, the job fails right away instead of after hours, so Retry works at once.
Safety copy
Section titled “Safety copy”After a move to another connection, the original guest stays on the source node as a stopped safety copy (tagged
nexovirt-migrated, autostart off). Its page shows a Migration safety copy notice with the
date it will be deleted. Every action on it is refused except Delete safety copy now.
Safety copies are deleted automatically after the retention period (by the daily
metrics:prune run). Running migrations and safety copies are skipped by plan enforcement and
alerting.
Same-cluster migration
Section titled “Same-cluster migration”A target labelled Same cluster is another node of the guest’s own Proxmox cluster. The panel
then uses Proxmox’s own migrate:
- The guest keeps its VMID, IP address and network settings (“The IP address and network settings stay the same.”). No IP plan or port-forward plan is needed.
- Disks on shared storage stay where they are. Only disks on local storage are copied: choose a storage on the target node for each of them.
- No safety copy is kept: Proxmox moves the guest itself, so nothing stays behind on the source node.
- A VM’s cloud-init snippet is written on the target node too, so the VM still starts there.
- Port-forwards stay on the source node. The pre-flight warns that they keep working only while that node reaches the guest.
The pre-flight checks, among others:
| Check | Refused when |
|---|---|
| Quorum | ”The cluster has no quorum, so Proxmox VE cannot move guests. Bring the missing nodes back first.” |
| Target node | The node is offline or unknown, or in maintenance mode. |
| Storage | A shared storage is not available on the target node, or no target storage with room was chosen for the local disks. |
| Bridges | A bridge of the guest does not exist on the target node (“Create it there first.”). SDN VNets exist on every node. |
| Node-bound settings | The container has devN entries or bind mounts (unless marked shared=1). |
| High availability | ”This guest is managed by Proxmox VE high availability, which decides its node. Move it with HA migrate in Proxmox VE, or remove it from high availability first.” |
Snapshots are no problem when all disks are on shared storage. A running guest is shut down, moved and started again on the target node, as with a move to another connection. A node with less free RAM than the guest is configured with gives a warning, not an error.
Settings
Section titled “Settings”Settings → Migration:
- Safety copy retention (days): how long the stopped original is kept. Default 7.
- Bandwidth limit (MiB/s): caps the transfer. Empty uses the Proxmox default.
- Shutdown timeout (seconds): how long a running server may take to shut down before it is force-stopped. 30 to 1800, default 300.
The Migrations page
Section titled “The Migrations page”Migrations in the sidebar lists every migration, newest first, with source, target, mode, status, start time, duration, data copied, average speed and the safety copy state. While a safety copy exists the column shows Until with its delete date and an Open link to the copy’s page on the source node. Filter by status (Running, Done, Done with warnings, Failed) or by node / cluster. Select rows and use Delete safety copies now to remove several safety copies at once.
Maintenance mode
Section titled “Maintenance mode”Maintenance mode keeps new guests and incoming migrations off a host. Turn it on or off on the node page under Settings → Operations → Maintenance mode. On a node of a cluster the switch covers only that node; the other members keep taking guests.
While it is on, the host (or node) is left out of the create wizard and of automatic placement, guest creation on it is refused (panel, reseller portal and API), and it is not offered as a migration target. Existing guests keep running.
Host evacuation
Section titled “Host evacuation”Evacuate (node page, Settings → Operations) moves the guests of a host to one target node. On a node of a cluster it moves only that node’s guests, and the other members of the cluster are offered as targets (moved with same-cluster migration):
- Click Evacuate. The dialog lists the host’s guests with a pre-flight result, an estimate and the IP plan for each. A guest that needs a new address shows “the next free address in <zone>”: the address is picked when that guest moves.
- Choose the Target node / cluster and Target node, and an IP zone on the target when addresses cannot be kept. Tick Drop port-forwards that cannot move if needed.
- Select the guests and click Start evacuation.
Starting an evacuation turns maintenance mode on for the source host (on a cluster node: for that node). The guests then migrate one at a time; a guest whose pre-flight fails is skipped with its reason. Templates, safety copies and busy guests are never offered. Each original stays as a safety copy, as with a single migration.
The progress page (View progress on the node page) refreshes every 5 seconds and shows each guest’s status and reason. Stop skips the guests that have not started yet; maintenance mode stays on until you turn it off.
Automatic placement
Section titled “Automatic placement”When creating a guest, the host option Automatic (recommended) lets NexoVirt pick the node. It uses the panel’s inventory and metrics only (no live Proxmox calls) and leaves out nodes that are:
- offline or in maintenance mode,
- without a healthy, current agent,
- without a storage of the right content type that has room for the disk,
- without enough free RAM,
- not assigned to the reseller (for reseller creates),
- outside the requested node group, if you ask for one,
- at one of its node limits.
The remaining nodes are ranked by a weighted score of free RAM after placement, idle CPU (average of the last 30 minutes) and free storage after placement. Ties go to the node with fewer guests.
Placement strategy (Settings → Placement, and per node group) changes that order:
- Spread (most free resources first): the score above. The default.
- Fill first (pack the fullest node that fits): the lowest score first, so nodes fill up one after the other (until a node limit stops them).
- Random.
- Newest node first: the most recently added connection first, then node names from the end (
pve3beforepve2).
A node group’s strategy is used when the request or the product names that group; otherwise the global one counts. Shop orders use it too. Load balancing always spreads. The choice is shown with its explanation and checked again before the guest is created.
The same logic is available through the API: node=auto on POST /api/v1/hosts/{id}/guests, the
host-less POST /api/v1/guests, and GET /api/v1/placement/suggest. See the
REST API reference.
Settings → Placement → Automatic placement:
- Preselect “Automatic (recommended)” in the create wizard.
- RAM weight, CPU weight, Storage weight: only the ratio matters. Defaults: RAM 0.5, CPU 0.3, storage 0.2.
VMID allocation
Section titled “VMID allocation”Settings → Placement → VMID allocation decides how a new guest gets its VMID. Existing guests keep theirs.
- Unique across all nodes (recommended), the default for new installs: NexoVirt picks a random free VMID from the range (Range from / Range to, default 10000 to 999999). The VMID is used on no node the panel knows, by no queued create, by no migration or failover copy, has no backup on the PBS servers attached to the target node, and the target node confirms it is free. Separate nodes that back up to one PBS therefore never share a backup group. The range must stay between 100 and 999999999 and hold at least 1000 VMIDs.
- Sequential per node: each node’s next free VMID (100, 101, …), as before. Separate nodes can hand out the same VMID. Installs that already had nodes or guests before the update keep this mode.
While sequential mode is on, Settings > Placement and the dashboard show the recommendation
Recommended: unique VMIDs across all nodes with Switch to unique VMIDs (asks you to confirm
it is you, audited as vmid.switch_unique) and Dismiss (hides it on both pages).
The create wizard fills in the VMID from the panel’s own data (the node is not asked, so the wizard opens at once; the PBS backups are re-read in the background every 15 minutes). The real check runs when you click Create: if the suggested VMID turned out to be taken, the guest gets another free one automatically; a VMID you typed yourself is refused with a message instead.
Every create path uses it: the create wizard (the VMID field is filled in, you can still change it),
the portal (self-service and shop orders), the reseller portal and API, one-click apps and API v1
(vmid optional with node=auto, GET /hosts/{id}/next-vmid). A VMID you enter yourself is refused
when it is in use, in unique mode also when another node uses it. Migration and failover keep the
guest’s VMID when it is free on the target; only when they need a new one do they take it from the
same allocation. If no free VMID turns up after several tries, the create stops with
No free VMID found. Widen the VMID range under Settings > Placement or enter a VMID yourself.
Node limits and capacity
Section titled “Node limits and capacity”Nodes → Capacity shows, per node and per node group, the allocated vCPU, RAM and disk (the configured size of every guest, stopped ones too, templates not) against the node’s hardware, as a table and a bar chart (above 100 % means overcommitted), plus the guest count and the free addresses of every IP zone the node can use. The page reads the panel’s inventory only. Export CSV downloads the node table.
Limits on a node row sets its caps (empty = no limit):
- Max guests,
- Max vCPU and/or vCPU overcommit (a ratio of the node’s cores,
4= 4:1), - Max RAM (GB) and/or RAM overcommit (a ratio of the node’s RAM,
0.9keeps 10 % for the node), - Max disk (GB, all disks of all guests on the node: root and extra disks).
Migration safety copies and failed-over source copies do not count.
With both a value and a ratio the lower one counts. A node at a limit:
- is left out of automatic placement, shop orders, failover and load balancing with the reason (for example
This node has reached its vCPU limit (60 of 64 vCPU allocated, this server needs 8).), - refuses a create on that node by a reseller (portal and API) and customer self-service creates,
- refuses plan upgrades, add-ons, limit changes, disk resizes and added disks that grow a guest (a shrink is always allowed),
- refuses the handover of a manual shop order (Shop > Orders) to that node,
- is refused as a migration target (pre-flight check target_caps).
Admins can go over a limit on purpose: tick Ignore node limits on the last step of the create wizard, on the
guest’s Limits tab, in the disk Resize and Add disk dialogs and when handing over a manual order, or pass
override_caps=1 to POST /api/v1/hosts/{id}/guests and POST /api/v1/hosts/{id}/guests/{type}/{vmid}/resize (the API
answers 409 with the reason otherwise). Each override is written to the audit log as node.caps_override; saving limits as node.caps.
Node groups
Section titled “Node groups”Node groups label nodes by location, CPU type or anything else. Create them under Settings → Placement → Node groups with Add group: a Name (up to 60 characters, no comma), an optional Description, a Placement strategy (Default = the one from Settings) and the Nodes that belong to it. A node can be in several groups. Editing and deleting groups needs the host management permission.
- In the create wizard, an optional Node group field appears while Automatic is selected (Any node by default); only nodes of that group are considered.
- The API takes
group(a group id or name, or a comma-separated list; the node must be in every listed group) onnode=autocreates andGET /api/v1/placement/suggest. An unknown group is refused withUnknown node group: <input>.(the text you sent) and if no node of the group has room the message isNo node in group <name> has room for this guest.. Resellers only ever see their own assigned nodes; for them an unknown group and a group without any of their nodes give the same answer. - Load balancing stays inside groups.
Load balancing
Section titled “Load balancing”Balancing works per node: each node of a cluster is checked on its own. Balance in the sidebar shows every node with its guest count and marks nodes Above threshold (hot) or in Maintenance. Below it, Suggestions lists proposed moves:
- A node is hot when its RAM usage is above the RAM threshold or its average CPU over the last 30 minutes is above the CPU threshold.
- For each hot node, running guests are considered smallest first. Each suggestion goes to the best node that is not hot and stays under the thresholds after the move, and must pass the migration pre-flight. Another node of the same cluster is preferred (a cheap same-cluster migration that keeps the IP).
- Suggestions stop once the hot node would be back under the thresholds.
Each suggestion shows the guest, from, to, what it frees, the expected downtime and the IP plan, plus the same network warnings as the migrate dialog (a hand-made address that does not fit the target bridge, hand-made NAT pointing at the guest). Automatic balancing never moves a guest with such a warning. On the target, a storage that supports snapshots (LVM-thin, ZFS, Ceph RBD, Btrfs) is preferred over a bigger directory storage. Recalculate refreshes the list. Select suggestions and click Start selected to create a balance run: the moves run one at a time like an evacuation, with the same progress page, but no host is put into maintenance mode.
Without Automatic balancing nothing is moved on its own. Under Settings → Placement → Automatic balancing, Balance automatically every night starts one balance run inside the Window start to Window end window, with at most Max moves per night moves. Only running VMs and stopped guests are moved; a running VM is shut down, moved and started again (short downtime inside the window), running containers stay where they are. A guest with Never move automatically switched on (guest page) is skipped; the run checks the switch again right before each move, so turning it on during a run still counts.
Guests of a reseller, or of the reseller’s customers, are only moved between the nodes assigned to that reseller. This applies to balancing, host evacuation and failover.
With node groups, a guest on a grouped node is only suggested to nodes that share all of its source node’s groups. Guests on nodes without a group are not restricted.
Settings → Placement → Load balancing:
- RAM threshold (%): default 80.
- CPU threshold (%): default 85.
- Max suggestions: per Balance page load, default 10.
Background worker
Section titled “Background worker”Migrations, evacuations, balance runs and failovers are executed by php spark migrate:work, in
its own queue so a long transfer never blocks guest provisioning. The installer’s cron setup runs
it every minute. If a previous run is still busy, the next one waits for it and then takes over
instead of skipping the minute. If migrations stay queued, check that this cron job is in place. See
CLI & daemons.
Next steps
Section titled “Next steps”- Failover to restore guests of a failed host from backups.
- Networking & NAT for IP zones and port-forwards.
- The node agent for agent requirements.
NexoVirt is developed and designed by Nucez Software, your partner for custom software and web design.