Two sites, one OpenNebula: bringing two running KVM hosts in different cities under one front-end, without moving a disk
As of 29 November 2026: how we put two production KVM hosts, in different cities and about 51 ms apart, under one OpenNebula 7.4.1 CE front-end with no host reinstall and no disk copied. The survey, the nested rehearsal, the deploy hook that keeps guest hardware identical, the second site over WireGuard, the batch moves, an 8-minute management-path cut, a remote host reboot, Sunstone behind a Cloudflare tunnel, every quirk with its exact message, the operating rules and rollback, and what was not proven.
As of 29 November 2026, two production KVM hosts in two different cities, about 51 ms apart, run their VMs under one OpenNebula 7.4.1 Community Edition front-end. Neither host was reinstalled. Not one disk was copied or moved. Every VM we moved while it was running came back with the same PCI slots, MACs, UUID, firmware variables and TPM contents it had under plain libvirt. When the management path to the remote site was cut for 8 minutes, its VMs kept running, and after a planned reboot the remote host started its production VMs by itself with no front-end involved.
This is the full method, the measured results, redacted terminal excerpts, and every quirk we hit along the way. It is the second post in the series that started with a single-host micro cloud on AlmaLinux and OpenNebula.
About the logs. Host names, VM names, addresses, the public hostname, account and tunnel identifiers, MAC addresses and UUIDs are replaced. The two sites are called Site A and Site B, their hosts hv-a and hv-b (registered in OpenNebula as site-a and site-b). Private ranges are remapped (Site A LAN 10.10.0.0/24, Site B LAN 10.20.0.0/24), public addresses use the documentation ranges (203.0.113.10 for Site A, 198.51.100.20 for Site B), and the Sunstone hostname is sunstone.example.com. Versions, timings, counts, error strings and commands are unchanged. Excerpts are trimmed; [...] marks removed lines.
What was not proven is listed in its own section near the end. Read it before you copy this to your own estate.
The result in numbers#
As of 29 November 2026:
| Item | Value |
|---|---|
| OpenNebula | 7.4.1 CE, one front-end, MariaDB 10.5 on the same machine |
| Hosts | Site A: AlmaLinux 9.8, front-end and KVM host on one machine. Site B: AlmaLinux 9.8, KVM host only |
| Link between sites | WireGuard between the two site routers, 51 ms round trip, path MTU 1420 |
| VMs brought under OpenNebula | 18 at Site A (27 Nov), 16 at Site B (29 Nov) |
| Disks copied or moved | 0 |
| Host reinstalls | 0 |
| libvirt daemon restarts | 1 per host (virtqemud, 0.098 s at Site A and 0.093 s at Site B, no running VM affected) |
| Downtime per VM (shutdown to service back, as the move wrapper measures it) | Site A: 14 to 73 s. Site B: 19 to 93 s. Container stacks on the bigger guests took longer to be fully back: up to about 4 minutes from shutdown at Site B, and about 6 minutes on one Site A container host (Q56) |
| Guest hardware after the move | identical (same PCI slots, MACs, UUID, firmware variables, TPM contents); TPM VMs differ by one deliberate flag, explained below |
| Management path cut for 8 minutes | all 16 Site B production VMs kept running, public sites answered at every check (management traffic only; not a WAN outage) |
| Site B host reboot | 17 guests stopped in order in 63 s; after boot the host started its 16 production VMs by itself in 16 s, with no front-end involved. That is guest start, not application recovery: public sites were down about 7 minutes in total, and one API container was restarted by hand |
| Ports opened between the sites | one: TCP and UDP 4124, Site B host to the front-end |
| Sunstone | behind a Cloudflare tunnel with an IP allow-list; no inbound port at either site |
Where we started#
- Two sites in different cities, each with one KVM host running production VMs under plain libvirt (modular daemons,
virtqemud), set up by hand over time. - No shared storage between the sites. Local RAID on each host; VM disks are qcow2 files, most of them overlays on a template (2 to 3 layers).
- A mix of guests: BIOS and UEFI, 7 with Secure Boot, 4 with a virtual TPM, some with fixed CPU pinning, one with a macvtap NIC on a physical port, one with a virtiofs share, several with a second NIC on the LAN bridge.
- Site B's VMs sit on a libvirt NAT network with DHCP reservations by MAC. Addresses must not change.
- Site A holds replicas of Site B's data services (a MongoDB member, a PostgreSQL streaming standby, a Redis replica), so the link already carries replication.
- Host scripts on both machines start, stop and inspect VMs by name through
virsh. - The requirement: one Sunstone for both sites, short downtime per VM, no change in function and no change in network behaviour.
The seven decisions that make this work#
- One front-end, at Site A. Site B is a KVM node only. No federation, no second zone. A second zone would give two Sunstones and two user databases, which is the opposite of the goal.
- Disks stay where they are. For each disk, a symbolic link inside the OpenNebula image datastore points at the existing file. The image is registered on that link as persistent, with the
sharedtransfer driver, so nothing is copied and overlay chains stay intact because no file changes path. - A moved VM boots from its own saved libvirt XML. OpenNebula 7.4.1 has no import for existing VMs (Q23), and its generated XML changes the guest's hardware (Q28). A small hook in the KVM
deploydriver (golden_merge) replaces the generated XML with the VM's original definition and takes from OpenNebula the domain nameone-<id>, the console settings, each NIC's bridge and tap name, and each disk's path. Everything else that makes up the guest's hardware (PCI addresses, firmware, NVRAM, TPM, pinning, shared folders, macvtap NICs, video, RNG, CPU model, memory, vCPUs) comes from the saved XML. - OpenNebula never creates or deletes a bridge. Every network uses
VN_MAD="dummy"on an existing bridge, with MAC-only leases. DHCP, NAT and firewall rules stay with whatever provided them before. - Every VM is placed by hand. VMs are created on hold and deployed to a named host. No scheduler placement, no fault-tolerance hook, no migration between the sites. With no shared storage, a front-end that "recovers" VMs from an unreachable site onto the other one would be a disaster.
- Each site should be able to start and stop its own VMs without the other. (This is the design goal. What was proven is a local stop and start at Site B during a management-path cut, and a planned Site B reboot with the link up; a boot with the link down was not tested.) At Site B the host itself runs
virsh createon the last deployment file OpenNebula wrote, andvirsh shutdownto stop. OpenNebula catches up through monitoring a few minutes later. A WAN outage must never keep a site from booting. - Rehearse everything on throwaway VMs first, and compare before and after on every real VM. A nested sandbox for the method, then one throwaway VM on each production host shaped like the real ones, then the real VMs in batches from least to most important.
Site A Site B
+------------------------------+ +------------------------------+
| hv-a (AlmaLinux 9.8) | | hv-b (AlmaLinux 9.8) |
| oned, FireEdge/Sunstone, | ssh 22 ---> | libvirt + qemu (untouched) |
| MariaDB, monitord :4124 | <--- 4124 tcp/udp opennebula-node-kvm |
| libvirt + qemu (untouched) | | ng-vm (local start/stop) |
| 18 VMs as one-<id> | | 16 VMs as one-<id> |
+---------------+--------------+ +---------------+--------------+
| site router ==== WireGuard, 51 ms, MTU 1420 ==== site router
|
cloudflared (outbound only) ---> Cloudflare ---> https://sunstone.example.com
allow-list: the two sites' public addresses
Step 1: the read-only survey, before touching anything#
Do this on each host and keep the output. Nothing here changes state.
- Versions:
rpm -q libvirt-libs qemu-kvm-core, kernel, OS minor release. A host one minor release behind its repos is a trap (Q38). - Which libvirt daemons run (monolithic
libvirtdor modularvirtqemud), and whether/etc/libvirt/qemu.confhas any non-default line. - For every VM: firmware (BIOS or UEFI, Secure Boot), TPM, pinning, NIC types, shared folders, console device, autostart flag, snapshots, whether the guest agent answers.
- For every disk: the whole backing chain, with owner and mode of every layer, the seed ISO in the CD-ROM, and the firmware-variables file.
- Networks: bridges, libvirt networks, DHCP reservations, the firewall (firewalld zones or raw iptables), hand-added rules and where they are restored from at boot.
- Everything on the host that names a VM through
virsh: start-order scripts, reboot scripts, cron jobs, monitoring. - What is bound to the libvirt daemon:
systemctl show virtqemud.service -p RequiredBy -p BoundBy -p ConsistsOf, and howlibvirt-guestsis configured. - The path between the sites, in both directions, per port.
One command paid for itself: can the future VM user read every file a VM needs?
# read-only: can oneadmin read every file a VM needs?
for d in $(virsh list --name); do
for f in $(virsh dumpxml $d | grep -oP "(?<=<source file=')[^']+") $(virsh dumpxml $d | grep -oP '(?<=>)[^<]+(?=</nvram>)'); do
r=NO; su -s /bin/bash oneadmin -c "test -r '$f'" 2>/dev/null && r=yes; w=NO; su -s /bin/bash oneadmin -c "test -w '$f'" 2>/dev/null && w=yes
echo "$d | $(stat -c '%U:%G %a' "$f") | oneadmin read=$r write=$w | $f"
done
done | column -t -s'|'
dev-vm qemu:qemu 600 oneadmin read=NO write=NO /mnt/raid/libvirt/images/overlays/dev-vm.ovl
dev-vm qemu:qemu 644 oneadmin read=yes write=NO /mnt/raid/libvirt/images/dev-vm.qcow2
dev-vm qemu:qemu 644 oneadmin read=yes write=NO /mnt/raid/libvirt/images/templates/AlmaLinux-9.7-GenericCloud-latest.x86_64.qcow2
dev-vm qemu:qemu 644 oneadmin read=yes write=NO /mnt/raid/libvirt/images/cloudinit/dev-vm-seed.iso
dev-vm qemu:qemu 600 oneadmin read=NO write=NO /var/lib/libvirt/qemu/nvram/dev-vm_VARS.fd
[...]
redis qemu:qemu 640 oneadmin read=NO write=NO /mnt/raid/libvirt/images/redis.qcow2
redis qemu:qemu 640 oneadmin read=NO write=NO /mnt/raid/libvirt/images/cloudinit/redis-seed.iso
[...]
The top layers say NO until the move hands them over, which is expected. The middle layer and the seed ISO with mode 640 are the real finding: they would have failed only at the next cold start (Q71).
Step 2: rehearse in a nested sandbox#
Two nested AlmaLinux VMs on Site A, on an isolated libvirt network, registered as OpenNebula hosts. Four stand-in VMs covered the shapes the survey found.
| Stand-in | What it stood for | Moves | Rollbacks | Downtime per switch | Guest vs baseline |
|---|---|---|---|---|---|
sv-plain | BIOS, 3-level overlay disk, libvirt NAT, fixed MAC | 4 | 3 | 18 to 19 s | identical |
sv-uefi | UEFI Secure Boot, saved firmware variables, TPM | 2 | 1 | 23 to 28 s | identical, TPM contents and Secure Boot kept |
sv-pin | CPU pinning, NUMA binding, NIC on a physical port | 2 | 1 | 19 to 45 s | identical |
sv-fs | host folder shared into the guest | 2 | 1 | 24 to 73 s | identical, files readable and writable both ways |
"Identical" here means the same hostname, machine-id, system UUID, machine type, CPU flags, NIC name and MAC, address, PCI device list and slots, disk path and root filesystem.
The sandbox is also where the dangerous findings happened safely: the leftover wild-VM import template hard-powered-off a stand-in twice (Q23), the scheduler placed a pending VM on the wrong node (Q24), and OpenNebula's own XML moved the NIC from enp1s0 to enp3s0 (Q28).
Step 3: how the move works#
The tooling is a handful of small scripts: one_move.py (prep, switch, rollback, forget), golden_merge (the deploy hook), keep_qemu.py, xcheck.py and gcheck.sh (before and after comparison), and ng-vm (address a VM by name, whichever system runs it).
The deploy hook#
A five-line block is added to the stock KVM deploy script on the front-end, ahead of its virsh create. onehost sync --force then pushes it to every host:
# diff deploy.orig deploy.patched (/var/lib/one/remotes/vmm/kvm/deploy)
67a68,73
> # >>> local change: boot moved VMs from their saved libvirt XML (see golden_merge)
> if [ -x "$(dirname $0)/golden_merge" ]; then
> "$(dirname $0)/golden_merge" "$DEP_FILE" || { error_message "golden_merge failed for $DEP_FILE"; exit -1; }
> fi
> # <<< local change
golden_merge looks for /var/lib/one/golden/<domain-uuid>.xml on the host. No file: the deployment is left alone, so ordinary OpenNebula VMs are unaffected. File present: the saved XML is used, with the name, console, each NIC's bridge and tap, and each disk's path taken from OpenNebula. Any error exits 1, so the VM fails to boot instead of booting with different hardware.
The guard. Each moved VM's template names an emulator that does not exist (/var/lib/one/golden/HOOK-MISSING-refusing-to-boot). If the hook is ever missing, for example after a package upgrade overwrote deploy, the VM refuses to start with Cannot check QEMU binary /var/lib/one/golden/HOOK-MISSING-refusing-to-boot instead of starting with OpenNebula's generic hardware.
prep (no downtime)#
one_move.py prep <host> <vm>:
- Saves
virsh dumpxml --inactive --security-infotwice on the host: an untouched copy for rollback and the copy the hook boots from. For a TPM VM it addspersistent_state='yes'to the TPM backend in the boot copy (Q30). - Refuses the VM if
oneadmincannot read any backing layer or CD-ROM image. - For each disk:
ln -sfn <real disk> /var/lib/one/datastores/<img_ds>/<vm>-<dev>.qcow2asoneadmin, thenoneimage createwithPERSISTENT="YES"andSOURCE=that link. - For each NIC on a bridge: finds the one OpenNebula network on that bridge inside the host's cluster (Q69) and adds a one-address MAC range for the VM's MAC.
- Creates the VM with
onevm create --hold: same UUID, machine type, vCPUs and memory,GRAPHICSonly if the VM had a console device (Q47), the guard emulator, and the image and NIC lines.
switch (the downtime)#
one_move.py switch <host> <vm>:
virsh shutdown, wait forshut off.- Back up the TPM state directory and the firmware-variables file.
virsh undefine --keep-nvram --keep-tpm.chown oneadmin:qemuandchmod 660on the top disk layers and the firmware-variables file.onevm deploy <id> <host> <sys_ds> </dev/null(Q25), wait forRUNNING, then wait for the guest to answer (its SSH port or another readiness check).
A VM that was shut off is registered the same way and left on hold; its first deploy is its first boot under OpenNebula (Q49).
rollback and forget#
one_move.py rollback <host> <vm> powers the VM off in OpenNebula, terminates the OpenNebula VM, restores the recorded owners and modes, runs virsh define on the untouched XML, restores autostart, starts the VM again if it was running before the switch, and leaves a fresh on-hold OpenNebula VM for the next attempt. forget removes the OpenNebula side completely and checks that every datastore entry is a link before removing it, so it can never reach a real disk.
What "identical" is checked against#
For every real VM it moves, the wrapper records before the move and compares after it (a guest with no SSH key on the host and no guest agent is checked from outside instead, Q55):
- Guest: hostname, machine-id, system UUID, CPU count and flags, memory to one decimal GiB (Q52), NIC names and MACs, addresses, PCI device list, disks and filesystems, failed units.
- Hardware: every element and attribute of the live libvirt XML, 125 to 165 elements per VM, apart from the fields the hook takes from OpenNebula on purpose (name, console, NIC bridge and tap, disk paths) and similar runtime details.
- Disk chain:
qemu-img info --backing-chainfor each disk. - Services: running containers and listening ports, retried for up to 400 s because container hosts need minutes (Q56).
- The rest of the host: every unmoved VM still on its old qemu process ID.
Step 4: prepare a host that already runs production VMs#
This is the same at both sites. It is done once per host and stops no VM.
Why not just dnf install opennebula-node-kvm#
Its install script rewrites qemu.conf (user, group, dynamic_ownership = 0, swtpm_user, swtpm_group), sets auth_unix_rw = none in virtqemud.conf, restarts virtqemud, and drops a sysctl file that turns on bridge-nf-call-iptables (Q3, Q29). On a host one minor release behind, the dnf transaction also upgrades libvirt and python under the running VMs (Q38).
Keep unmoved VMs running as qemu#
Once the host's default user becomes oneadmin, an unmoved VM would start as oneadmin at its next cold start and fail on its qemu-owned disks. A per-VM label prevents that for every VM without a TPM (running VMs are not touched):
virsh dumpxml --inactive --security-info <vm> | python3 keep_qemu.py > <vm>.keepqemu.xml
virsh define <vm>.keepqemu.xml
keep_qemu.py adds <seclabel type='static' model='dac' relabel='yes'><label>qemu:qemu</label></seclabel> and refuses a TPM VM: libvirt builds the TPM socket for the host default user only (Q29), so a TPM VM must run as that user. TPM VMs are handled separately, below.
Dry-run the install without writing a repo file#
# NO CHANGE: --assumeno answers "no"; the repo exists only for this command
dnf --assumeno --disablerepo='pgdg*' --repofrompath=one74,https://downloads.opennebula.io/repo/7.4/AlmaLinux/9/x86_64 \
--setopt=one74.gpgcheck=0 --setopt=one74.repo_gpgcheck=0 --enablerepo=crb --setopt=install_weak_deps=False \
--exclude='libvirt*,qemu*,python3,python3-libs,python3-devel,kernel*' install \
opennebula-common opennebula-common-onecfg opennebula-rubygems augeas python3-libnbd python3-numpy 2>&1 | awk '{print $1,$2,$3,$4,$5}' | tail -70
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
augeas x86_64 1.14.1-3.el9 appstream 63
opennebula-common noarch 7.4.1-1.el9 one74 23
opennebula-common-onecfg noarch 7.4.1-1.el9 one74 9.1
opennebula-rubygems x86_64 7.4.1-1.el9 one74 29
python3-libnbd x86_64 1.20.3-4.el9 appstream 87
python3-numpy x86_64 1:1.23.5-2.el9_7 appstream 5.8
Installing dependencies:
[...]
Transaction Summary
================================================================================
Install 20 Packages
Total download size: 49 M
Installed size: 220 M
Operation aborted.
The first attempt failed on an unrelated third-party repo, which blocks every dnf transaction on the host until it is left out for that one command (Q66):
Error: Failed to download metadata for repo 'pgdg-common': repomd.xml GPG signature verification error: Bad GPG signature
Read the transaction before running it: all Install, nothing from libvirt, qemu, python3 or the kernel.
Install the helpers with dnf, the node package with rpm and no scripts#
X="--disablerepo=pgdg* --enablerepo=crb --exclude=libvirt*,qemu*,python3,python3-libs,python3-devel,kernel* --setopt=install_weak_deps=False"
dnf -q -y $X install $R/opennebula-common-7*.rpm $R/opennebula-common-onecfg-*.rpm $R/opennebula-rubygems-*.rpm augeas python3-libnbd python3-numpy
dnf exit: 0
rpm -i --noscripts --nodeps --excludepath=/etc/sysctl.d/bridge-nf-call.conf $B/rpms/opennebula-node-kvm-7.4.1-1.el9.noarch.rpm; echo "rpm exit: $?"
rpm exit: 0
ls: cannot access '/etc/sysctl.d/bridge-nf-call.conf': No such file or directory
rpm -qa | grep -E '^(libvirt|qemu|python3-3|python3-libs|kernel)' | sort | diff - $B/rpm-virt.before && echo "libvirt / qemu / python3 / kernel packages: unchanged"
libvirt / qemu / python3 / kernel packages: unchanged
getent passwd oneadmin; id oneadmin
oneadmin:x:9869:9869::/var/lib/one:/bin/bash
uid=9869(oneadmin) gid=9869(oneadmin) groups=9869(oneadmin),6(disk)
ps -eo pid,user,group,lstart,args | grep '[q]emu-kvm' | awk '{print $1,$2,$3,$11}' | sort | diff - $B/qemu-pids.before && echo "qemu processes: unchanged"
qemu processes: unchanged
On the host that is also the front-end, the three opennebula-common*/rubygems packages and ruby are already there; only augeas, python3-libnbd and python3-numpy are added (Q39, Q73). python3-scipy is left out: it cannot be installed without upgrading python, and only the monitoring forecast code uses it.
Apply the install script's useful effects by hand#
grep -q '^oneadmin:' /etc/subuid || echo 'oneadmin:100000:65536' >> /etc/subuid
grep -q '^oneadmin:' /etc/subgid || echo 'oneadmin:100000:65536' >> /etc/subgid
mkdir -p /var/run/one/vhost-socks && chown oneadmin:oneadmin /var/run/one/vhost-socks
install -d -o oneadmin -g oneadmin -m 750 /var/lib/one/datastores
semanage fcontext -a -t svirt_image_t '/var/lib/one/datastores(/.*)?' && restorecon -iR /var/lib/one/datastores
/usr/bin/qemu-kvm-one-gen; ls -la /usr/bin/qemu-kvm-one
lrwxrwxrwx. 1 root root 21 Nov 29 02:13 /usr/bin/qemu-kvm-one -> /usr/libexec/qemu-kvm
chown -R oneadmin:oneadmin /var/lib/swtpm-localca/
cat /etc/polkit-1/rules.d/60-libvirt-opennebula.rules; su - oneadmin -c 'virsh -c qemu:///system list --name | grep -c .' </dev/null
polkit.addRule(function(action, subject) {
if (action.id == "org.libvirt.unix.manage" &&
subject.user == "oneadmin") {
return polkit.Result.YES;
}
});
16
virtqemud.conf is not edited. The polkit rule the package ships is enough for oneadmin; auth_unix_rw = none on a 0666 socket would give every local user full control of libvirt (Q41, Q31).
Also run systemctl enable virtnetworkd.service virtqemud.service: with only the sockets enabled, nothing starts the libvirt NAT networks after a reboot once no libvirt VM autostarts any more (Q32).
Five lines in qemu.conf and the one daemon restart#
First confirm nothing is bound to the daemon (Q42): RequiredBy, BoundBy and ConsistsOf must be empty, and libvirt-guests must only be ordered after the socket. Then, with a ping running to every guest (Site B shown):
for ip in $IPS; do (ping -i 0.2 -c 300 -W 1 $ip > $P/$ip.txt 2>&1 &); done
augtool -A <<'AUG'
set /augeas/load/Libvirtd_qemu/lens Libvirtd_qemu.lns
set /augeas/load/Libvirtd_qemu/incl /etc/libvirt/qemu.conf
load
set /files/etc/libvirt/qemu.conf/user oneadmin
set /files/etc/libvirt/qemu.conf/group oneadmin
set /files/etc/libvirt/qemu.conf/dynamic_ownership 0
set /files/etc/libvirt/qemu.conf/swtpm_user oneadmin
set /files/etc/libvirt/qemu.conf/swtpm_group oneadmin
save
AUG
Saved 1 file(s)
diff $B/qemu.conf.before /etc/libvirt/qemu.conf
1210a1211,1215
> user = "oneadmin"
> group = "oneadmin"
> dynamic_ownership = 0
> swtpm_user = "oneadmin"
> swtpm_group = "oneadmin"
date '+%H:%M:%S.%N'; time systemctl try-restart virtqemud.service; date '+%H:%M:%S.%N'
02:14:23.798259132
real 0m0.093s
02:14:23.894159915
virsh list --all | diff - $B/virsh-list.before && echo "virsh list: unchanged"
virsh list: unchanged
ps -eo pid,user,group,lstart,args | grep '[q]emu-kvm' | awk '{print $1,$2,$3,$11}' | sort | diff - $B/qemu-pids.before && echo "qemu processes: same PIDs, same owner"
qemu processes: same PIDs, same owner
ps -eo pid,user,args | grep '[s]wtpm socket' | awk '{print $1,$2}' | sort | diff - $B/swtpm-pids.before && echo "swtpm processes: same PIDs, same owner"
swtpm processes: same PIDs, same owner
journalctl -u virtqemud --since "-1min" --no-pager | tail -12
[...] systemd[1]: Stopping libvirt QEMU daemon...
[...] systemd[1]: virtqemud.service: Unit process 6186 (virtiofsd) remains running after unit stopped.
[...] systemd[1]: Stopped libvirt QEMU daemon.
[...] systemd[1]: Started libvirt QEMU daemon.
for ip in $IPS; do echo "$ip $(grep -E 'packets transmitted' $P/$ip.txt)"; done
10.20.40.231 300 packets transmitted, 300 received, 0% packet loss, time 62182ms
10.20.40.232 300 packets transmitted, 300 received, 0% packet loss, time 62189ms
[... 15 guests, every one 300 of 300 ...]
virsh net-list --all | diff - $B/net-list.before && echo "libvirt networks: unchanged"
libvirt networks: unchanged
iptables rules: unchanged
ausearch -m avc -ts recent </dev/null 2>/dev/null | grep -c denied
0
Site A gave the same picture two days earlier: 0.098 s, 16 of 16 qemu processes on the same PID, 300 of 300 pings on 15 guests.
One side effect to know: the restart re-owns /var/lib/libvirt/qemu and /var/lib/libvirt/qemu/nvram to oneadmin:oneadmin mode 751. Running VMs are not affected (Q70).
TPM VMs: change file owners while they run#
With dynamic_ownership = 0, libvirt no longer hands disk files to whoever runs the VM. A TPM VM cannot carry the keep-as-qemu label, so between host preparation and its move it would not survive a cold start unless its writable files already belong to oneadmin. So, while the VM runs: chown oneadmin:qemu and chmod 660 on its top disk layers and its firmware-variables file.
This was rehearsed first in the sandbox under a 150 MB direct write (150 of 150 pings, no I/O error, then a clean stop and start and a hard stop and start, TPM contents kept), then done on four production VMs: 200 of 200 pings each, no block errors (Q63).
At the same time, give oneadmin read access to any middle layer or seed ISO the survey flagged: change the owner to oneadmin:qemu and keep the mode.
Step 5: the second site, when the front-end is somewhere else#
The path between the sites#
Needed: front-end to host on TCP 22 (driver actions and file pushes as oneadmin), and host to front-end on TCP and UDP 4124 (push monitoring). Nothing else. The host never has to reach oned (2633) or Sunstone (2616), and it does not SSH back.
The first probe from Site B failed with a misleading error:
# on hv-b
bash: line 1: /dev/tcp/10.10.0.7/4124: No route to host
1: 10.20.0.1 0.204ms
2: 10.99.0.1 51.207ms
3: 10.10.0.7 51.537ms !H
Resume: pmtu 1420
# on hv-a at the same moment
01:37:37.009458 eno2np1 In IP 10.20.0.251.41646 > 10.10.0.7.tigv2: Flags [S], [...]
Ping worked, the SYN arrived at the front-end with the host's real source address, and the !H came from the destination itself. That is firewalld's default reject on the front-end, not a routing problem (Q62). The routers and the tunnel needed no change. One rule on the front-end, runtime and permanent, with no reload:
# on hv-a
for proto in tcp udp; do
R="rule family=\"ipv4\" source address=\"10.20.0.251/32\" port port=\"4124\" protocol=\"$proto\" accept"
firewall-cmd --zone=public --add-rich-rule="$R" && firewall-cmd --permanent --zone=public --add-rich-rule="$R"
done
success
success
success
success
# from hv-b afterwards
hv-a:4124 tcp OPEN from hv-b
bash: line 1: /dev/tcp/10.10.0.7/2616: No route to host
2616 probe rc=1 (must fail)
Register the host, its datastores and its networks#
# on the front-end; the two datastore templates are shown tidied, the raw log interleaves the heredocs
printf '# OpenNebula: Site B KVM host\n10.20.0.251 site-b\n' >> /etc/hosts
cat > $T/img.ds <<'X'
NAME="b-img"
TYPE="IMAGE_DS"
DS_MAD="fs"
TM_MAD="shared"
BRIDGE_LIST="site-b"
SAFE_DIRS="/mnt/raid/libvirt/images /home/libvirt/images /var/tmp"
DATASTORE_CAPACITY_CHECK="NO"
X
cat > $T/sys.ds <<'X'
NAME="b-sys"
TYPE="SYSTEM_DS"
TM_MAD="shared"
BRIDGE_LIST="site-b"
DATASTORE_CAPACITY_CHECK="NO"
X
# one network per existing bridge
NAME="b-prod"
VN_MAD="dummy"
BRIDGE="virbr-prod"
AR=[TYPE="ETHER", MAC="02:00:00:00:15:02", SIZE="1"]
su - oneadmin -c "ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new site-b 'hostname; id -un; virsh -c qemu:///system list --name | grep -c .' && echo ssh-ok
onecluster create site-b
onehost create site-b -i kvm -v kvm -c site-b
onedatastore create -c site-b $T/img.ds
onedatastore create -c site-b $T/sys.ds
for v in prod lan; do onevnet create -c site-b $T/\$v.vnet; done" </dev/null
hv-b
oneadmin
16
ssh-ok
ID: 102
ID: 4
ID: 104
ID: 105
ID: 11
ID: 12
[...]
Points that matter:
- A cluster per site. Both hosts have a bridge called
br-lan0. Networks and datastores belong to the site's cluster, and the move script picks a network by bridge name inside the host's cluster only (Q69). BRIDGE_LISTnames the remote host. The datastore drivers then run their file operations on that host over SSH instead of on the front-end. On the host that is also the front-end, noBRIDGE_LISTis needed (Q43).SAFE_DIRSlists the directories the real disks live in, or image registration is refused (Q13).DATASTORE_CAPACITY_CHECK="NO"on both datastores, or registering a large disk in place fails withNot enough space in datastorealthough a link uses no space (Q46).sharedhere does not mean shared between the sites. It means the image and system datastores see the same files on that one host, so the driver links instead of copying.- The registration changed nothing on the host: same qemu PIDs, same
virsh list, same iptables rules, links and routes,br_netfilternot loaded.
A throwaway VM on the real host, before any real VM#
A small VM on a new isolated libvirt network, built like the production ones (a 3-level overlay on the production template, used read-only). On Site B: move 20.0 s, rollback 27.0 s, move again 21.6 s; hardware identical (148 elements); the chain intact; it runs as oneadmin after a move and as qemu after the rollback.
Local start and stop at the remote site#
The remote host has no onevm command, and its VMs must not wait for a WAN link at boot. How the driver starts a VM tells you how to do it locally: deploy writes the merged definition to /var/lib/one/datastores/<sys_ds>/<vm_id>/deployment.<n> and runs virsh create on it. That file stays on the host.
# throwaway VM, OpenNebula VM 63; host clock
# 1. stop it on the host through libvirt, without telling OpenNebula
02:24:06
Domain 'one-63' is being shutdown
[front-end still shows ACTIVE RUNNING for the next two minutes]
# 2. start it on the host itself from the last deployment file, as oneadmin, front-end not involved
/var/lib/one/datastores/105/63/deployment.0
02:26:21
Domain 'one-63' created from /var/lib/one/datastores/105/63/deployment.0
02:26:32
GUEST IDENTICAL after a local start
# 3. leave it off until the front-end notices
02:26:55
Domain 'one-63' is being shutdown
02:30:13 IST front-end sees: POWEROFF LCM_INIT
# 4. local start while the front-end has it as powered off
02:30:16
Domain 'one-63' created from /var/lib/one/datastores/105/63/deployment.0
02:33:45 IST after 16 x 12 s front-end sees: ACTIVE RUNNING
Sun Nov 29 02:33:40 2026 [Z0][VMM][I]: VM found again by the drivers
Sun Nov 29 02:33:40 2026 [Z0][VM][I]: New state is ACTIVE
Sun Nov 29 02:33:40 2026 [Z0][VM][I]: New LCM state is RUNNING
So a local stop shows as POWEROFF after about 3 min 15 s, a local start of a POWEROFF VM shows as RUNNING after about 3 min 15 s, and a stop and start inside that window is never seen by the front-end at all (Q68).
ng-vm wraps this. It decides per VM whether libvirt or OpenNebula runs it, and on a host without the OpenNebula CLI it works in local mode. A systemd unit uses it at boot and at shutdown:
[Unit]
Description=Start OpenNebula-run VMs at host boot and power them off cleanly before the host goes down
# Stop order is the reverse of start order: started AFTER these, so stopped BEFORE them.
After=systemd-user-sessions.service
After=virtqemud.service virtnetworkd.service virtstoraged.service libvirt-guests.service network-online.target sshd.service
Wants=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
# "-": a VM that fails to start must not leave this unit failed, or its stop action would not run at shutdown
ExecStart=-/usr/local/sbin/ng-vm start-all-one
ExecStop=/usr/local/sbin/ng-vm stop-all-one
TimeoutStartSec=900
TimeoutStopSec=600
[Install]
WantedBy=multi-user.target
start-all-one starts every moved VM that had libvirt autostart before its move (the move records it). Do not also set OpenNebula's AUTOSTART on those VMs: the two would race.
Limits: a VM never deployed through OpenNebula has no deployment file, so its first start must come from the front-end. After editing a VM's saved XML, one power cycle from the front-end is needed before a local start uses the new definition.
Host scripts#
Anything that says virsh start <name> silently stops working for a moved VM, because libvirt only knows it as one-<id> and only while it runs (Q51). The start-order and ordered-reboot scripts were changed to call ng-vm; jobs that talk to guests by address needed no change. A dry run of the ordered-reboot script named all 17 running guests and passed its preflight before any real VM was moved.
Step 6: move the VMs in batches#
Order at Site B, each batch after an explicit go from the owner, with a closing check between batches:
| Batch | VMs (redacted names) | Downtime | Notes |
|---|---|---|---|
| 1 | ops-2, ops-1, dev-vm, vpn-gw | 22.8 s, 23.0 s, 88 s to SSH, 19.2 s | ops-1 has a virtiofs share: mounted again, 14 entries. dev-vm is UEFI with a macvtap NIC, checked from Site A because a host cannot reach its own macvtap guest; its 15 containers were back about 4 minutes after shutdown began |
| 2 | app-3, app-iot, app-partner, app-core | 29.0 s, 31.7 s, 36.3 s, 35.6 s | all containers and ports back |
| 3 | tpm-vm-1, tpm-vm-2 (UEFI, Secure Boot, TPM 2.0) | 47.5 s, 65.0 s | TPM kept on both; 55 containers and 39 ports on tpm-vm-2 identical about 4 minutes after shutdown began |
| 4 | elasticsearch, minio, redis | 36.2 s, 28.4 s, 44.3 s | Redis: same 1970 keys, its Site A replica resynced by itself in about a minute |
| 5 | mongo, postgres, edge | 45.8 s, 93.3 s, 21.4 s | see the incident below; PostgreSQL's own clean stop was about 58 s of its 93 s; the standby at Site A reconnected to its slot with no lag |
One move as it looks on the terminal:
# on the front-end; the wrapper runs detached so a dropped session cannot stop it half way
[04:12:06] BASELINE ops-2 (10.20.40.242), checks from: host
containers:
listening: 22,111,8096,8097
failed units:
[04:12:13] guest port 22 answers
[04:12:13] PREP (no downtime)
prep done: VM 66 on hold, images [36], uuid <uuid>
[04:12:30] SWITCH (downtime starts)
switch downtime (shutdown to service back): 22.8 s
[04:13:04] back after 27 s; ping: 38 packets transmitted, 10 received, +6 errors, 73.6842% packet loss, time 18645ms
[04:13:07] GUEST IDENTICAL TO BASELINE
HARDWARE IDENTICAL (150 elements compared)
[04:13:09] disk chain unchanged (3 layer(s)), disk still at /mnt/raid/libvirt/images/overlays/ops-2.ovl
[04:13:10] services identical to baseline after about 0 s
oneadmin oneadmin 1166147 /usr/libexec/qemu-kvm -name guest=one-66,debug-threads
ID USER GROUP NAME STAT CPU MEM HOST TIME
66 oneadmin oneadmin ops-2 runn 4 8G site-b 0d 00h00
[04:13:12] RESULT ops-2: MOVED, identical
1 production VM(s) no longer under their old process (expected = number moved so far)
After the last batch: 0 VMs under plain libvirt, 17 qemu processes as oneadmin (16 production and the throwaway), 4 swtpm processes as oneadmin, 0 SELinux denials, iptables unchanged, and OpenNebula showing 17 VMs on host site-b.
Proving a TPM survived#
Three checks, cheapest first (Q74):
- The new
one-<id>-swtpm.loghas noswtpm_setupor manufacturing lines. A fresh TPM would. - The TPM state file keeps its size and only changes owner (
tsstooneadmin, done by libvirt itself). - Inside the guest, before and after:
tpm2_getcap handles-persistent,tpm2_getcap handles-nv-index, and a hash of each NV index and of the EK public key. All equal. PCR 7 (Secure Boot state) stayed the same.
The hardware comparison of a TPM VM always shows one line: the persistent_state=yes flag the move adds on purpose. The first TPM move was reported as "check failed" for that reason; the wrapper now knows that line (Q75).
The incident: an application left half dead by a 45-second database restart#
Moving mongo restarted the only voting member of a replica set. For about 10 s after it came back it was up but still SECONDARY. One Node.js API container on another VM got NotWritablePrimary in that window, ran its own graceful-shutdown handler, closed its HTTP server and then never exited. The container stayed "Up", so Docker's restart policy did nothing, and the published port still looked open because docker-proxy holds it. The API was down for 3 minutes until docker restart. A sibling container that exited properly was restarted by Docker within a second.
What caught it: asking each published port for one byte of an HTTP answer, and searching each container's recent log for database errors. A check that only lists running containers and listening ports passes (Q77). A sweep script doing both was then run across all application guests and found nothing else.
Without a database login, the member list with priority and votes was read from the last "New replica set config in use" line of mongod.log: the remote member had priority 0 and 0 votes, so no failover was possible and the restarted member had to become primary again by itself (Q78).
Step 7: test how far the two sites are independent#
Cut the management path for 8 minutes#
Three temporary iptables rules on the Site B host, tagged with a comment: drop SSH arriving from the front-end's address, and drop outgoing TCP and UDP to port 4124. Only the host's own INPUT and OUTPUT are touched; forwarded VM traffic is not. The operator's session arrives from the same NAT address as the front-end, so the test ran as a detached script that removed its own rules after 480 s, with an independent systemd-run --on-active=15min timer doing the same as a safety net (Q82).
# the Site B host's own log
[05:33:55] START. production qemu processes: 16. cut for 480 s
[05:33:55] CUT IN PLACE: 3 rules
[05:33:58] +0s: 16 of 16 production VMs on the same process; public sites: 200 200 ; front-end 4124: unreachable; sv-b: running
[...]
[05:35:39] local stop of the test VM, no front-end: ng-vm shutdown sv-b -> rc 0
[05:36:12] +134s: 16 of 16 production VMs on the same process; public sites: 200 200 ; front-end 4124: unreachable; sv-b: shut off
sv-b started locally from /var/lib/one/datastores/105/65/deployment.0 (one-65)
[05:36:58] local start of the test VM, no front-end: rc 0, guest port 22 back after 12 s
[...]
[05:41:26] +447s: 16 of 16 production VMs on the same process; public sites: 200 200 ; front-end 4124: unreachable; sv-b: running
[05:41:56] PATH RESTORED after 481 s: 0 test rules left
# the front-end's view, every 30 s
[05:33:53] host site-b: MONITORED | VMs: 17 runn; | ssh to host: ok
[05:34:27] host site-b: MONITORED | VMs: 17 runn; | ssh to host: no
[... 10 more identical lines ...]
[05:40:39] host site-b: MONITORED | VMs: 17 runn; | ssh to host: no
[05:41:13] host site-b: ERROR | VMs: 17 unkn; | ssh to host: no
[05:41:47] host site-b: ERROR | VMs: 17 unkn; | ssh to host: no
[05:42:19] host site-b: ERROR | VMs: 17 unkn; | ssh to host: ok
[...]
[05:44:25] host site-b: ERROR | VMs: 17 unkn; | ssh to host: ok
[05:44:57] host site-b: MONITORED | VMs: 17 runn; | ssh to host: ok
What it showed (Q81): the front-end needed about 7 minutes to notice the lost host (Start monitor failed for host 4), and about 2.5 minutes to recover after the path returned (within its 30-second poll). It never saw the stop and start of the test VM. With no fault-tolerance hook installed, nothing acts on UNKNOWN VMs, which is exactly what two sites without shared storage need. Check onehook list before relying on that.
The limit of this test: it cut the host's management traffic, not the WAN link, so replication between the sites kept flowing. It is not a WAN-outage test.
Reboot the remote host#
Preflight: the running kernel is the default kernel, the local-start unit and libvirt sockets are enabled, the libvirt networks autostart, there are 17 saved definitions and 17 deployment files, and the hand-added firewall rules come back from their own unit.
# ordered shutdown through ng-vm, local mode; names redacted
2026-11-29T06:00:39+05:30 group: app-core app-partner app-iot app-3 edge
2026-11-29T06:00:52+05:30 stopped in 10s
2026-11-29T06:00:53+05:30 group: ops-1 ops-2 dev-vm tpm-vm-2 tpm-vm-1 vpn-gw sv-b
2026-11-29T06:01:13+05:30 stopped in 15s
2026-11-29T06:01:13+05:30 group: elasticsearch minio redis
2026-11-29T06:01:20+05:30 stopped in 5s
2026-11-29T06:01:20+05:30 group: mongo postgres
2026-11-29T06:01:42+05:30 stopped in 20s
2026-11-29T06:01:45+05:30 all guests stopped - rebooting hypervisor
# after boot
Result=success ExecMainStartTimestamp=Sun 2026-11-29 06:05:04 IST ExecMainExitTimestamp=Sun 2026-11-29 06:05:20 IST ActiveState=active SubState=exited
[...] ng-vm[2668]: app-partner started locally from /var/lib/one/datastores/105/72/deployment.0 (one-72)
[...] ng-vm[2668]: vpn-gw started locally from /var/lib/one/datastores/105/69/deployment.0 (one-69)
[...] ng-vm[2668]: edge started locally from /var/lib/one/datastores/105/81/deployment.0 (one-81)
[...]
# the front-end's view
[06:07:34] host ping: up | host: ERROR | VMs: 17 unkn; | sites: 200 200 200 | dev-vm ssh: up
[06:12:00] host ping: up | host: MONITORED | VMs: 1 poff; 16 runn; | sites: 200 200 200 | dev-vm ssh: up
Sun Nov 29 06:08:25 2026 [Z0][HMM][D]: Updated Host 4, state MONITORED
- 17 guests stopped in four dependency groups in 63 s.
- The host was back on the same kernel about 4.5 minutes after the ordered shutdown began.
- The unit started the 16 production VMs in 16 seconds, about one per second, with no front-end involved. The throwaway VM, which has no autostart flag, stayed off and showed
POWEROFF. - OpenNebula showed the host
ERRORand the VMsUNKNOWN, thenMONITOREDand running again about 3.5 minutes after boot. It never tried to start anything. - Public sites were down about 7 minutes in total.
- Every guest identical to its baseline, 4 TPMs not re-created, the host's iptables rule set identical (109 lines, 0 differences), 0 SELinux denials since boot.
- The same API container as in the incident above was silent after boot and was restarted by hand. A normal start of it takes about 77 s, so it may have been slow, not hung. Without a recorded normal start time the two cannot be told apart (Q85).
This was a planned, ordered reboot with the link to the front-end up. It is not a power-cut test, and it is not a boot with the link down.
Site A had been through the same reboot proof the day before, with one fault found: a unit that stops OpenNebula VMs at shutdown through onevm poweroff cannot log in once shutdown has begun (pam_nologin, Q57). It delayed that reboot by 6.5 minutes. The fix is the After=systemd-user-sessions.service line in the unit above, plus a libvirt fallback in ng-vm. That fix has been run by hand only, not yet on a real shutdown.
Step 8: one Sunstone for both sites, without opening a port#
FireEdge on the front-end listens on plain HTTP port 2616. Instead of nginx, a certificate and a forwarded port, Sunstone is published through a Cloudflare tunnel (outbound connections only) and guarded by an IP allow-list at Cloudflare.
Order matters: build the lock before the door (Q88).
# script run with the account credential held in-process only
1 tunnel created: <tunnel-id>
2 tunnel route set: sunstone.example.com -> http://127.0.0.1:2616 ; everything else 404
3 list created: sunstone_allowed items: ['198.51.100.20', '203.0.113.10'] op completed
4 existing custom firewall rules on the zone: []
block rule in place; rules now: [('block', True, '(http.host eq "sunstone.example.com" and not ip.src in $sunstone_allowed)')]
5 updater token issued: site-a-sunstone-ip-updater status active permissions: ['Account Rule Lists Write']
6 DNS created: CNAME sunstone.example.com -> <tunnel-id>.cfargotunnel.com proxied True
On the front-end, cloudflared runs as one static binary in /usr/local/bin, checked against the release checksum, with no rpm and no install scripts:
latest release: 2026.11.2 published 2026-11-23T13:10:20Z
sha256 of the download: 56f13335143ec0e22772963290683a84a04114a35ec64cbc794a4d39ff9bb8cf
checksum in the release notes: 56f13335143ec0e22772963290683a84a04114a35ec64cbc794a4d39ff9bb8cf | asset digest: sha256:56f13335143ec0e22772963290683a84a04114a35ec64cbc794a4d39ff9bb8cf
CHECKSUM MATCH
# /etc/systemd/system/cloudflared-sunstone.service
[Service]
EnvironmentFile=/etc/cloudflared/sunstone.env
ExecStart=/usr/local/bin/cloudflared --no-autoupdate tunnel --edge-ip-version 4 run
Restart=always
RestartSec=5
DynamicUser=yes
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
[...] INF Registered tunnel connection connIndex=0 [...] protocol=quic
[... four connections to two Cloudflare locations ...]
from the front-end (allowed address): https://sunstone.example.com/ -> 302
The tunnel token is in an EnvironmentFile readable by root only, and was piped in, never printed.
Then bind FireEdge to localhost and close the old way in:
sed -i "s/^host: '0\.0\.0\.0'/host: '127.0.0.1'/" /etc/one/fireedge-server.conf
12c12
< host: '0.0.0.0'
---
> host: '127.0.0.1'
date '+%T'; systemctl restart opennebula-fireedge; [...]; date '+%T'
07:32:45
07:32:46
127.0.0.1:2616
login https://sunstone.example.com -> HTTP 200
https://sunstone.example.com | id: 200 | message: OK | data: {'status': 'ok'}
wrong password through the hostname | id: 401 | message: core user not found
-- same request with Python's default client signature:
HTTP 403
error code: 1010
-- websocket upgrade through the tunnel (the console needs it):
HTTP 101
FireEdge 7.4 needed no proxy setting at all for this (Q87). Only opennebula-fireedge was restarted, for one second; no VM, no libvirt, no oned. The websocket upgrade returning 101 is as far as the console was tested; a full VNC session to a remote VM was not opened.
Testing a block rule when every machine you own is on the allow-list. A fetch tool that runs on the operator's PC is not "outside" (Q93). The reliable negative test is to take one of your own addresses off the list for a few seconds:
before: Site B host gets 302
removed by hand: 198.51.100.20
+5s: Site B host (not on the list now) gets 302; front-end (on the list) gets 302
+10s: Site B host (not on the list now) gets 403; front-end (on the list) gets 302
<title>Attention Required! | Cloudflare</title>
added by hand: 198.51.100.20 (Site B public address)
+5s after putting it back: Site B host gets 302
zones visible to the updater token: 0 []
A site whose public address can change. Site A has a backup line. A one-minute timer on the front-end learns the site's current address from two places (the router's dynamic-DNS name, and the address Cloudflare itself reports at /cdn-cgi/trace), and keeps the list items it owns, recognised by their comment, in line. It never touches other items and does nothing if both lookups fail. Its token can edit account IP lists and nothing else (Q90).
# self-heal test: remove the front-end site's own address
07:34:29 front-end gets 302
07:34:35 front-end gets 403
07:34:40 front-end gets 403
07:34:46 front-end gets 302
[...] sunstone-allowlist: site-a address changed: added ['203.0.113.10'], removed none (router name says 203.0.113.10, Cloudflare sees 203.0.113.10)
That proves the updater re-adds a removed address. A real switch to the backup line was not done.
Break-glass when Cloudflare or the internet is down: ssh -L 2616:127.0.0.1:2616 root@<front-end> and open http://127.0.0.1:2616.
Things to know: an allow-list at Cloudflare sees only public exit addresses, so a whole site collapses into one address (Q89). A client that reaches Cloudflare over IPv6 is blocked unless its IPv6 address is listed. A shared carrier-grade NAT address on a backup line lets other customers of that carrier past the address check; they still meet the Sunstone login.
What this run did not prove#
As of 29 November 2026, none of these were tested. Do not read any claim above as covering them.
- An unplanned power cut of either host (guests not shut down first).
- A boot of the Site B host while the link to the front-end is down. The local-start unit does not use the link, but that combination was not run.
- A real WAN outage. The test cut management traffic only; replication between the sites kept flowing.
- The fixed shutdown unit at Site A on a real shutdown. It was installed after the fault and proven only by hand.
- Sunstone's VNC console to a VM on the remote host, driven by a person. The websocket upgrade through the tunnel returns 101; a full console session was not opened.
- A real switch of Site A to its backup line. The allow-list updater was tested by removing the address by hand.
- Application behaviour beyond containers, ports, health endpoints and public pages. No login or transaction was driven through the applications.
- Elasticsearch and MongoDB contents. No database login was used; only role, connections and service state were checked.
- Windows guests. None exist here.
- OpenNebula disk snapshots, live migration, and backups of moved VMs. None were used. Snapshots would be written next to the link, not next to the disk.
- A package upgrade of OpenNebula with moved VMs present. The guard is proven; the upgrade path is not.
Rules to operate by afterwards#
- A moved VM's saved XML is the authority. Changing CPU, memory, disks or NICs in Sunstone does not change the next cold boot. Edit
/var/lib/one/golden/<uuid>.xmlon the host, then power-cycle from the front-end once. - After every OpenNebula package upgrade: re-apply the five lines to
deploy, runonehost sync --force, and cold-boot one test VM. Until then, moved VMs refuse to boot. The node package's upgrade script also repeats theqemu.confedit and the daemon restart, so upgrade it the way it was installed. - Never delete an image whose
SOURCEis the disk itself. Only link-registered images are safe to delete. - Never use the leftover wild-VM import template.
- Create on hold, deploy by hand, pass
</dev/null. - No fault-tolerance hook and no
AUTOSTARTon a site that starts its own VMs. - Planned host reboots go through the ordered-reboot script, which stops guests in dependency groups through
ng-vm. - Do not open 2633, 2616 or 4822 between the sites. Only 4124 from the host to the front-end is needed.
Rollback at every level#
| Level | How |
|---|---|
| One VM | one_move.py rollback <host> <vm>: back under plain libvirt with its original definition, owners and autostart. Measured at 19 to 27 s in testing |
| The OpenNebula side of one VM | one_move.py forget <host> <vm> after a rollback: removes links and image records, never a disk |
| A host | restore qemu.conf, virsh define the saved definitions, remove the packages, one more virtqemud restart |
| The site link | remove the 4124 rule on the front-end; onehost disable or delete the host |
| Sunstone access | set host back in fireedge-server.conf, restart opennebula-fireedge, put the port rules back, delete the tunnel, list, rule and DNS record |
Every quirk we found, with the exact messages#
Q = quirk, G = correction to our own earlier guide. The numbers are stable so they can be cited. Q1 to Q22 and G1 to G8 come from the single-host install in the first post of this series and are kept because several of them explain the decisions above.
Packaging and install#
- Q1. The front-end will not install without CRB.
dnf install opennebulafails withnothing provides libxmlrpc++.so.8()(64bit) needed by opennebula-7.4.1-1.el9(alsoxmlrpc-c-c++,xmlrpc-c-client++). We used--enablerepo=crbfor that one transaction instead ofcrb enable. Futurednf updateruns of opennebula will need it too. - Q2. The front-end pulls
zeromq-devel→krb5-devel→libselinux-devel. On a 9.8 host fed from the 9.9 repos, that upgradeslibselinux3.6-3 → 3.6-4. Harmless, but it is not "install only". - Q3.
opennebula-node-kvmcannot simply go on a host that already runs libvirt VMs. Its install scriptlet setsqemu.confuser and group tooneadminanddynamic_ownership = 0(existing VMs withqemu-owned disks then fail on their next cold start), setsvirtqemud.confauth_unix_rw = nonewith grouponeadmin, runssystemctl try-restart virtqemud, and drops/etc/sysctl.d/bridge-nf-call.confwithbridge-nf-call-iptables/ip6tables/arptables = 1. - Q4. The front-end grants
oneadminbroad passwordless sudo and raw disk access./etc/sudoers.d/opennebula-servercovers LVM, mount/umount, mkfs, blockdev, iscsiadm, andarpingplusip address *via ONE_HA.oneadminis also added to thediskgroup. - G1.
systemctl restart libvirtdon EL9.9 gives no error. It returns rc=0, starts the disabled monolithic libvirtd, and leavesvirtqemud.socketandvirtnetworkd.socketinactive. After that,virshfails withFailed to connect socket to '/var/run/libvirt/virtqemud-sock'until the sockets are started again by hand. Nothing tells you it happened.
Sunstone and FireEdge#
- Q5. Deep links to a VM don't open it.
/fireedge/sunstone/virtual-machine/<id>silently redirects to the dashboard. The working path is Instances › VMs → the VM's card → ⋮ More → Console → VNC, which opens/fireedge/sunstone/guacamole/<id>/vnc?zone=0. The console URL itself can be deep-linked. - Q6. The dashboard overstates image disk use. "Images … 20.5 GB on datastores" is the sum of virtual sizes; real use was about 1 GB. The
oneimage listSIZE column is virtual too. - Q7. A console tab left open on a terminated VM shows a misleading error:
Client errorand the toastAborted. See logs., with the VM's end time under "Registered:". Nothing says the VM no longer exists. - Q8. A VM whose guest kernel panicked still shows
ACTIVE / RUNNING. OpenNebula has no guest-health signal; only the console shows the panic. - Q9. NGINX in front of FireEdge on AlmaLinux 9: nginx 1.20.1 only warns on
ssl on;, nginx 1.26 fails with[emerg] unknown directive "ssl", SELinux returns 502 untilsetsebool -P httpd_can_network_connect on, and without theUpgrade/Connection "upgrade"headers the console shows "Tunnel error". (This post avoids nginx altogether.) - Q10. guacd listens on
0.0.0.0:4822and oned on0.0.0.0:2633/2634. On the front-end they are unreachable from outside only because firewalld's public zone blocks them. Don't open them. (On 27 Nov, 2616 was opened on purpose for10.10.0.0/24and10.10.216.0/24only; FireEdge was later bound to localhost behind the tunnel. 4822 and 2633 stay closed.) - G2. Where to add an SSH key in 7.4.1: avatar (bottom-left) → Settings → ACCOUNT › Security → SSH public key.
Datastores and marketplace#
- Q11. The marketplace shows 0 apps on a host with broken IPv6 egress. The monitor is Ruby Net::HTTP, which tries the AAAA record first and hits
Net::OpenTimeout. A scoped workaround is anhttp(s)_proxydrop-in foropennebula.serviceonly; the proper fix is to repair or disable IPv6 egress. - Q12. Each VM costs a full copy of its image with the
localTM. qcow2 images are copied whole, with no backing file; raw stays sparse. Each VM's disk then grows to its virtual size. - Q13.
oneimage create --pathfrom/var/lib/one/...is refused. Paths under/var/tmpwork (the default datastoreSAFE_DIRS). - G3. The marketplace
AlmaLinux 9andAlmaLinux 10templates already setCPU_MODEL host-passthrough, andexportreturned template ID 0, not -1. "AlmaLinux 10 fails on the default CPU" only applies to hand-made templates, where it ends inKernel panic … Attempted to kill init! exitcode=0x00007f00.
Networking#
- Q14. Security groups are not enforced with
VN_MAD="bridge". UseVN_MAD="fw"(or VLAN/VXLAN/OVS). Side effect: deploying withfwloadsbr_netfilterand setsbridge-nf-call-iptables=1, so on a host with production bridges every bridged frame would go through the host firewall. - Q15. Security-group gotchas:
--nic <vnet>:secgroups=Nis silently ignored, and a new vnet always gets SG0added ("0,100"); remove it withonevnet update --append SECURITY_GROUPS="100". - Q16. OpenNebula-created bridges come up with STP off; nmcli bridges come up with STP on (nmcli default
stp yes, forward-delay 15). - G4. PHYDEV warning confirmed (simulated with a dummy NIC). With PHYDEV on a bridge that carries an IP, terminating the last VM deleted the bridge, the IP and the route. Without PHYDEV, or with
:keep_empty_bridge: true, the bridge survived. - G5.
onehost sync -fis accepted on 7.4.1, even though--helplists only--force. - Q17. Push monitoring needs node → front-end TCP/UDP 4124. libvirt's firewalld zone
libvirtshowstarget="ACCEPT", but that applies only to forwarded traffic; a lowest-priority<reject/>refuses connections to the host itself except the zone's default services (dhcp, dhcpv6, dns, ssh, tftp, icmp) plus, on this host, a locally added 8110/tcp. A node on a libvirt NAT bridge can reach SSH but not oned, FireEdge or monitord. Fix: a default-priority rich rule for port 4124 from the node subnet, runtime and permanent separately, and no--reloadon a host with running VMs. Only 4124 is needed.
NUMA and pinning#
- Q18. oned keeps a stale NUMA core map when a host's NUMA layout changes.
onehost forceupdatedoes not fix it; a 2-socket pinned VM got a vCPU on node 1 with its memory strict on node 0. Fix: undeploy the VMs,onehost delete,onehost create. After any BIOS NUMA change, compareonehost show -xcore CPUS againstlscpu. - G6. The scheduler message for an unpinned VM on a PINNED host is
Cannot dispatch VM: No host meets SCHED_REQUIREMENTS, withAUTOMATIC_REQUIREMENTS="(CLUSTER_ID = 0) & !(PIN_POLICY = PINNED)". - G7. A full core for ISOLCPUS is the CPU and its hyperthread sibling, which is not always
0,1. Read the sibling list before isolating. - Q19. NUMA nodes can be lopsided in free memory. Runtime hugepage reservation on the fuller node would compete with production VMs.
- Q20. A
host-passthroughnested guest giventhreads='2'can still reportThread(s) per core: 1, so THREAD and CORE pin policies can't be told apart in nested tests.
Database switch#
- G8. SQLite → MariaDB works on 7.4.1, but the order matters.
onedb sqlite2mysqlon an empty DB fails withDatabase is not correctly bootstraped.What works: switch the oned.conf DB block to mysql; start oned once (it bootstraps the schema and exits withPassword file …/sunstone_auth already exists but OpenNebula is boostraping the database, which is expected); stop oned; runonedb sqlite2mysql; runsystemctl reset-failed opennebula; start oned. - Q21.
onedbprints the MySQL password in its error output when its-bbackup dump can't be written. Give-ba path oneadmin can write, and treat onedb output as sensitive. We rotated the password after it leaked. - Q22. MariaDB 10.5 on EL9: set
bind-address = 127.0.0.1explicitly for a one-box cloud. The OpenNebula docs wanttransaction-isolation = READ-COMMITTED.
Rehearsal: moving existing libvirt VMs (27 Nov, nested node)#
- Q23. Wild-VM import is gone in 7.4.1, and its leftovers are dangerous.
onehost importvmdoes not exist. The host still reports each unmanaged VM with anIMPORT_TEMPLATEwhoseDEPLOY_IDis the VM's UUID. Creating a VM from it gives a new, empty VM (IMPORTED="YES"is ignored). Deleting that VM runs thecanceldriver, which callsvirsh destroy <UUID>in a 60-second retry loop: it hard-powered-off the real VM, and killed it again when it was restarted inside that minute. - Q24. A pending VM is deployed by the scheduler wherever it fits. The first attempt landed on the other test node. Use
onevm create --hold, thenonevm deploy <id> <host>. - Q25.
onevm deployreads a template from standard input. Insidessh host 'bash -s' < scriptit swallows the rest of the script and fails withParse error: syntax error, unexpected VARIABLE. Add</dev/null. - Q26. The
sharedstorage driver only accepts disks inside the datastore folder. For a qcow2 image it rewrites the path to<datastores>/<last folder>/<file>.snap/0, so an image registered withSOURCE=/data/vm/x.qcow2fails withCannot access storage file '/var/lib/one//datastores/101/27/disk.0', and leaves a stray folder under/var/lib/one/datastores/. What works: a link/var/lib/one/datastores/<id>/x.qcow2 -> /data/vm/x.qcow2, registered as the image SOURCE. - Q27. Deleting an image whose SOURCE lies outside the datastore fails safely. The image goes to
errwithError removing image from datastore; the file is not removed;oneimage delete --forcedrops the record. Deleting a link-registered image removes only the link. - Q28. OpenNebula's own XML changes the guest's hardware. With the same machine type, MAC and UUID, the NIC moved from
enp1s0toenp3s0, the disk moved slot, video became Cirrus, the RNG and watchdog disappeared, and a SCSI controller and a PCI bridge appeared (25 PCI devices became 28). 7.4.1 has no per-device PCI address setting for virtio disks and NICs. Fix used: thegolden_mergedeploy hook. - Q29. The node package also sets
swtpm_user/swtpm_grouptooneadmin. After that, a VM with a per-VMqemu:qemulabel and a TPM fails to start:Failed to connect to '/run/libvirt/qemu/swtpm/<n>-<vm>-swtpm.sock': Permission denied. libvirt builds the TPM socket for the host default user only, so a TPM VM must run as that user. - Q30. libvirt deletes TPM contents when a transient VM stops, and OpenNebula runs every VM as a transient domain.
persistent_state='yes'on the TPM<backend>prevents it. - Q31.
unix_sock_groupand the socket permission lines the node package writes tovirtqemud.confdo nothing with socket activation. The socket staysroot:root 0666fromvirtqemud.socket. Onlyauth_unix_rw = nonetakes effect. - Q32. After a host reboot OpenNebula can start VMs before libvirt's NAT network exists. With
VN_MAD="bridge"it then creates an empty bridge of the same name, and libvirt's network fails witherror creating bridge interface virbr-prod: File exists: no DHCP, no gateway, no NAT for every VM on it. Both fixes applied:systemctl enable virtnetworkd.service, andVN_MAD="dummy"so OpenNebula never creates or deletes the bridge. A VM keeps the driver it was created with. - Q33. OpenNebula autostart after a host reboot takes about 3 minutes. The hooks in
/var/lib/one/remotes/hooks/autostart/work withAUTOSTART="yes", but the VMs started exactly 180 s after boot, all at once. libvirt autostart is immediate. - Q34. Resuming a powered-off VM whose boot fails puts it back in
POWEROFF, notBOOT_FAILURE, soonevm recover --retryis refused. Fix the cause andonevm resumeagain. - Q35.
dnf install ./*.rpmfrom a--downloadonly --destdirfolder deletes those files afterwards. Download the one package you still need again. - Q36. Root cannot overwrite another user's file in
/var/tmp(fs.protected_regular):PermissionError: [Errno 13]as root on a file owned by oneadmin. Keep script templates in a private folder. - Q37. OVMF drops boot entries added with
efibootmgrat the next cold boot when the VM has a<boot>order. It is not a sign of lost firmware variables; a custom variable written throughefivarfssurvived every move. - G9. Restarting
virtqemudwith VMs running was clean in the sandbox: same qemu and swtpm process IDs, samevirsh list, 0 of 100 pings lost per VM. The node package's upgrade script repeats theqemu.confedit and the restart, so its upgrades need the same care as the first install.
Site A, the production host that is also the front-end (27 Nov)#
- Q38. On a host one minor release behind,
dnf install opennebula-node-kvmupgrades libvirt under the running VMs. Site A was AlmaLinux 9.8 with libvirt11.10.0-12.7.el9_8while the repos served 9.9. The package requires thelibvirtmeta-package, which was not installed, so dnf would pulllibvirt-11.10.0-19.el9_9and upgrade 25 libvirt packages pluspython3andpython3-libs(27 upgrades, 23 installs).--downloadonlyand a look at the file list show it before anything is touched. Fix:rpm -i --noscripts --nodepsfor the node package and only the helper packages it really uses. - Q39. What the node package really needs on a host that already has libvirt and qemu: of 31 requirements, 26 were already there. Missing:
augeas, thelibvirtmeta-package (not needed),python3-libnbd,python3-numpy,python3-scipy.python3-scipycannot be installed without upgrading python, and numpy and scipy are used only by the monitoring forecast code, so scipy was left out. The excluded install gave 10 new packages and 0 upgrades. - Q40.
rpm -i --excludepath=/etc/sysctl.d/bridge-nf-call.confkeeps the package's sysctl file off the disk entirely. Better never to have the file than to empty it afterwards. A later upgrade of the package will try to put it back. - Q41.
auth_unix_ro/rw = "none"invirtqemud.confis not needed. The package's polkit rule/etc/polkit-1/rules.d/60-libvirt-opennebula.rulesletsoneadminuseqemu:///system; deploy, power-off, resume and monitoring all work. Withauth noneand the socket at0666(Q31), every local user gets full control of libvirt. - Q42. Check what a
virtqemudrestart drags along before doing it.libvirt-guests.servicewas active withON_SHUTDOWN=shutdown; if it were bound tovirtqemud.service, a restart would shut down every guest. It was not:systemctl show virtqemud.service -p RequiredBy -p BoundBy -p ConsistsOfwas empty andlibvirt-guestsonly orders itself after the socket. - G10. The one
virtqemudrestart on the Site A host was clean: fiveqemu.conflines,systemctl try-restart virtqemudtook 0.098 s, 16 of 16 qemu processes kept their PID and owner, 300 of 300 pings answered on each of 15 guests. - Q43. Front-end and KVM host on the same machine works with the
shareddrivers, with noBRIDGE_LIST. The host is registered under a name that resolves to its LAN address (10.10.0.7 site-ain/etc/hosts), andoneadminreaches it with its own SSH key. - Q44. Deleting a link-registered image fails on such a host, and that is useful. The
fsdatastorermdriver comparesdirname "$SRC"with the datastore base path as text. The base path is/var/lib/one//datastores/102(two slashes) and the registeredSOURCEhas one, so the driver logsrm: Bad formed or unavailable Image sourceand the image goes toerr. Nothing is deleted. A lateroneimage createwith the same name fails withNAME is already taken, and a VM create fails withCannot acquire image N, it is in state: ERROR. A mistaken "delete image" in Sunstone cannot reach the disk. Real cleanup:unlinkthe link, thenoneimage delete --force. - Q45.
onevm terminateandoneimage deletereturn before they are done. Pollonevm showforDONEandoneimage showfor "not found". - Q46.
Not enough space in datastorewhen registering an existing 300 GB disk in place. OpenNebula compares the disk's virtual size with the datastore folder's free space, although a link uses none.DATASTORE_CAPACITY_CHECK="NO"on the image and system datastores turns the check off. - Q47. A VM with no
<graphics>must get none from OpenNebula. 17 of the 20 definitions on Site A had no console device. If the template carriesGRAPHICS, the merged definition gains a VNC listener and libvirt adds a video card the guest never had. - Q48. A seed ISO left in the virtual CD-ROM needs no OpenNebula image. It stays in the saved definition and only has to be readable by
oneadmin, like every backing file under an overlay. - Q49. A VM that is shut off can be moved without booting it: register it and leave it in
HOLD. Its firstonevm deployis its first boot under OpenNebula. A VM inPENDINGwould be placed by the scheduler. - Q50. After a hard stop behind OpenNebula's back (here a
virsh destroy), the VM staysRUNNINGin OpenNebula for about 2 minutes until monitoring marks itPOWEROFF; only then doesonevm resumework. Measured on avirsh destroy: 2 min 22 s from the kill to the VM resuming. After a cleanonevm poweroffthe resume takes 6 s. A clean host shutdown must power the VMs off through OpenNebula first. - Q51. Host scripts that say
virsh start <name>stop working silently for a moved VM.ng-vmmaps the estate name to whichever system runs the VM; a script that walksvirsh listneeded no change. - Q52. A guest's
MemTotalmoves by a few kB between identical boots (2010264 vs 2010260 kB). Compare memory in GiB to one decimal. - Q53. A libvirt network filter (
<filterref>) on a NIC survives the move. libvirt builds the same nftables chains under the new tap name (libvirt-I-one-58-0instead oflibvirt-I-vnet0). Rules written by hand against a tap name such asvnet0would not survive. - Q54. OpenNebula counts configured memory, so an overcommitted host shows over 100 % allocated.
onevm deployandonevm resumedo not enforce it; the scheduler would. Every VM here is placed by hand. - Q55. Guests with no SSH key on the host and no guest agent can still be verified from outside: the live libvirt definition, the DHCP lease, a TCP port scan before and after, and the taps' bridge membership. With the agent, add hostname, OS, vCPU count, MACs and the PCI address behind each filesystem (
guest-get-fsinfo). - Q56. Container hosts need minutes, not seconds, to be "back". SSH answered 27 s after shutdown on a VM with five database containers, but the last container and port were up about 6 minutes later. Compare containers and ports in a retry loop.
Site A reboot proof (28 Nov)#
- Q57. During a host shutdown OpenNebula cannot stop its own VMs:
pam_nologinrefuses its SSH login. The VM log showsCommand execution fail (exit code: -1): ... /var/tmp/one/vmm/kvm/shutdown, thenSystem is going down. Unprivileged users are not permitted to log in anymore. For technical details, see pam_nologin(8).,ExitSSHCode: 255,Error connecting to site-a,Fail to shutdown VM. Assuming that the VM is still RUNNING.systemd-user-sessions.servicecreates/run/nologinin the first second of shutdown, and OpenNebula reaches its host asoneadminover SSH even when front-end and host are the same machine. The unit waited its full 300 s and the reboot was delayed by 6.5 minutes. Fix:After=systemd-user-sessions.service, and if/run/nologinalready exists, ask libvirt directly (virsh shutdown one-<id>as root). Found on a throwaway VM left running on purpose. - Q58.
libvirt-gueststhen stops the OpenNebula VM and fails at the next boot. WithON_SHUTDOWN=shutdownit shut the leftover VM down cleanly in 2 s, but wrote its UUID to/var/lib/libvirt/libvirt-guests. At boot:error: failed to get domain '<uuid>',libvirt-guests.service: Failed with result 'exit-code'. A failed unit's stop action would not run at the following shutdown.systemctl start libvirt-guestsclears it. - Q59. A clean power-off before the reboot makes the restart immediate. VMs stopped with
onevm poweroffresumed 21 to 25 s after boot with front-end and database on the same host; staged replicas followed after the usual 3-minute wait. - Q60. Cosmetic changes after a reboot that are not drift:
md126andmd127swapped names and SATA disks changed letters (everything mounts by UUID), theoverlaymodule was not loaded again, and firewalld listed the same rich rules in a different order. - Q61. Check what starts a container before calling it missing. Five database containers on one replica had restart policy
noand are started by an hourly cron job when it loads fresh data.
Site B, the second host over a WAN (29 Nov)#
- Q62.
No route to hoston the monitoring port is the far host's firewall, not routing.tracepathshows the answer comes from the destination itself (!H), andtcpdumpon the front-end shows the SYN arriving. A timeout with no error means a drop somewhere before the host. - Q63. A running VM with a TPM survives its files changing owner, proven on the sandbox and then on four production VMs (details above).
- Q64. With stock
dynamic_ownershiplibvirt gives the disk back toroot:rootwhen the VM stops and toqemu:qemuwhen it starts. Record owners while the VM runs. - Q65.
virsh shutdownsent while the guest is still booting is ignored (no ACPI handler yet). Ask again every 20 s until the domain is off. - Q66. One third-party repo with a bad metadata signature blocks every dnf transaction. Pass
--disablerepo='pgdg*'on the one command; do not touch the repo files of a production host for this. - Q67. Dry-run a transaction without adding a repo file:
dnf --assumeno --repofrompath=one74,<baseurl> ... install .... On the Site B host: 20 packages, allInstall, none from libvirt, qemu or the kernel. - Q68. A KVM host whose front-end is on another machine must start and stop its own VMs locally. Start:
virsh -c qemu:///system create /var/lib/one/datastores/<sys_ds>/<vm_id>/deployment.<n>asoneadmin. Stop:virsh shutdown one-<id>. Measured on a throwaway VM: local start 6 to 11 s to SSH, guest identical. OpenNebula catches up through monitoring after about 3 min 15 s each way, withVM found again by the driversin the VM log. - Q69. With two hosts, "the network on bridge X" is no longer unique. Both hosts have a
br-lan0. The move script takes the host's cluster first and accepts exactly one network on that bridge inside it. - Q70. Restarting
virtqemudafter settinguser/groupre-owns libvirt's own state directories tooneadmin:oneadminmode751. A VM still running asqemucan reach its firmware-variables file through the execute bit. - Q71. Check the whole backing chain for the new user, not only the top layer. Two VMs had a middle layer and one a seed ISO with mode
640 qemu:qemu. Fixed by changing the owner tooneadmin:qemuand keeping the mode. - Q72.
ausearchreads standard input when it is not a terminal. Inside a script piped tossh host 'bash -s'it swallowed the rest of the script. Alwaysausearch ... </dev/null. - Q73. A pure node needs more packages than a front-end that doubles as a node:
opennebula-common,opennebula-common-onecfg,opennebula-rubygems, ruby. Their install scripts only create theoneadminuser (uid 9869, groupdisk), its SSH config and/etc/onecfg.conf, so they can run normally; onlyopennebula-node-kvmgoes in with--noscripts. - G11. The second production host behaved like the first:
virtqemudrestart 0.093 s, 16 of 16 qemu and 4 of 4 swtpm processes kept their PID, 300 of 300 pings on 15 guests (the sixteenth, a macvtap guest, cannot be pinged from its own host; from the other site, 419 of 420 over the WAN). - Q74. Prove a moved TPM VM kept its TPM, do not assume it. The three checks above. PCR 0 can differ between two otherwise equal VMs; PCR 7 stayed the same.
- Q75. A hardware diff of a moved TPM VM always shows one line,
persistent_state=yes. A checker must know it or it reports every TPM VM as changed. - Q76. After the guest boots, units that need a database can fail once. Compare failed units again after the containers are up, and record container health in the baseline.
- Q77. Restarting a database primary can leave an app half dead, not down. See the incident above.
- Q78. Know who can become primary before you restart a replica-set member. Here the restarted member took 10 s after start to become PRIMARY again.
- Q79. A clean PostgreSQL stop can be most of the downtime: about 58 s of a 93 s move, with the guest still answering ping.
- Q80. A reboot clears a guest's failed-unit list. Record unit names, not a count, and treat "fewer than before" as a note.
- Q81. OpenNebula 7.4 takes about 7 minutes to notice a host it cannot reach, then shows ERROR/UNKNOWN (
Start monitor failed for host 4: Could not update remotes), and about 2.5 minutes to recover. - Q82. Test a lost management path without touching the routers: commented iptables rules on the host's own INPUT and OUTPUT, a detached script that removes them by comment, and a second independent
systemd-run --on-activetimer. - Q83. A host without a front-end can bring its OpenNebula VMs back by itself on a planned reboot: 16 VMs in 16 seconds.
- Q84. Ordered shutdown before a host reboot is fast if you group by dependency: 17 guests in four groups in 63 seconds; first shutdown to public sites answering took about 7 minutes.
- Q85. Slow starter or hung? Record a normal start time first. One API container gave no log line and no answer 100 s after boot; after a restart it needed 78 s to listen.
- Q86. Docker's restart policy does not cover a container that is up but not serving, and a HEALTHCHECK alone restarts nothing. The smallest fix with no image change is a systemd timer in the guest that asks the app's health URL and runs
docker restartafter N failures. Two guards: a start-up grace longer than a normal start (here about 80 s, grace 180 s), and never start a container that is not running.
Sunstone behind a Cloudflare tunnel (29 Nov)#
- Q87. FireEdge/Sunstone 7.4 works behind a Cloudflare tunnel with no proxy settings at all. Login, the app page and the console websocket upgrade (
/fireedge/guacamole, HTTP 101) pass. - Q88. Build the lock before the door. Tunnel, route, IP list, block rule, and the DNS record last, so the hostname never resolves while it is unprotected.
- Q89. An IP allow-list at Cloudflare only sees public exit addresses. A whole site collapses into one address. A list change took effect in 5 to 10 seconds.
- Q90. Follow a changing site address without a broad credential: a custom IP list plus a token limited to "Account Rule Lists Write" (the permission is not called "Filter Lists").
- Q91. Cloudflare answers 403 "error code: 1010" to Python's default user agent on a proxied hostname, while curl and browsers pass. A scripted login test that fails with 403 may be the client signature, not the allow-list.
- Q92. A machine with an IPv6 address but no IPv6 route makes every API call wait for a timeout first. Forcing
AF_INETinsocket.getaddrinfofixed it. - Q93. A "fetch from outside" tool may not be outside. A fetch tool on the operator's PC returned 200 where a real outsider gets 403.
Tooling gotcha: ausearch inside ssh host 'bash -s' <<EOF swallows the rest of the script. Use ausearch --input-logs, or </dev/null.
Evidence#
As of 29 November 2026. Everything below was run by us on the two production hosts and the nested sandbox described above, between 27 and 29 November 2026. Logs are redacted as described at the top.
| Claim | Status | Basis |
|---|---|---|
| 16 Site B VMs moved in 5 batches, wrapper-measured downtime 19.2 to 93.3 s per VM (full container stacks up to about 4 minutes), 0 disks copied | Measured | Move wrapper logs per batch, 29 Nov 2026 |
Guest, hardware (125 to 165 libvirt elements) and disk chain identical after each move; TPM VMs differ only by the deliberate persistent_state flag | Measured | Before/after comparison per VM, 29 Nov 2026 |
| TPM kept on both batch-3 TPM VMs (checks used at Site B: no manufacturing lines, same state-file size, same handles, NV hashes, EK hash, PCR 7); 4 TPMs not re-created after the Site B reboot | Measured | swtpm logs and in-guest tpm2_getcap; reboot check, 29 Nov 2026 |
One virtqemud restart per host, 0.098 s (Site A) and 0.093 s (Site B), same qemu PIDs on both hosts and same swtpm PIDs at Site B, 300 of 300 pings on 15 guests per host | Measured | Host preparation logs, 27 and 29 Nov 2026 |
| 8-minute management-path cut: 16 of 16 production VMs on the same process, public sites 200 at every check; front-end ERROR after about 7 min, MONITORED again about 2.5 min after the path returned (30 s poll) | Measured | Site B host log and front-end poll, 29 Nov 2026 |
| Planned Site B reboot: 17 guests stopped in 63 s, 16 production VMs started locally in 16 s, public sites down about 7 min | Measured | Ordered-reboot log and unit status, 29 Nov 2026 |
| Sunstone through the tunnel: login 200, websocket upgrade 101, blocked address 403 within 10 s | Measured | Tunnel and allow-list test logs, 29 Nov 2026 |
Half-dead API container after a MongoDB primary restart, down 3 minutes until docker restart | Observed incident | Move of mongo, 29 Nov 2026 |
| Site A moves (18 VMs, 14 to 73 s for those that were running) and Site A reboot proof | Measured, summarised only | 27 and 28 Nov 2026 runs; detail not reproduced here |
| Unplanned power cut, boot with link down, real WAN outage, fixed Site A shutdown unit on a real shutdown, full VNC console session, backup-line switch, app logins and transactions, Elasticsearch and MongoDB contents, Windows guests, snapshots, live migration, backups, OpenNebula upgrade with moved VMs | Not tested | See "What this run did not prove" |
FAQ#
Can one OpenNebula front-end manage KVM hosts in two different cities?#
Yes, in this run. As of 29 November 2026, one OpenNebula 7.4.1 CE front-end at Site A manages its own KVM host and a second KVM host at Site B, about 51 ms away over WireGuard between the two site routers. Each site is its own cluster. The only paths needed are the front-end to the remote host on TCP 22, and the remote host to the front-end on TCP and UDP 4124 for push monitoring. No federation and no second zone were used.
Can I bring existing libvirt VMs under OpenNebula 7.4.1 without copying their disks?#
Yes, with a workaround. OpenNebula 7.4.1 has no import for running VMs. We linked each existing disk into the image datastore, registered the link as a persistent image with the shared transfer driver, created the VM on hold and deployed it by hand. A small hook in the KVM deploy driver boots the VM from its own saved libvirt XML, so the guest hardware stays the same. 0 disks were copied or moved.
Why not just run dnf install opennebula-node-kvm on a production KVM host?#
Its install script rewrites qemu.conf (user, group, dynamic_ownership = 0, swtpm_user, swtpm_group), sets auth_unix_rw = none in virtqemud.conf, restarts virtqemud and drops a sysctl file that turns on bridge-nf-call-iptables. On a host one minor release behind its repos, the dnf transaction would also upgrade libvirt and python under the running VMs; we saw that in the resolved transaction before anything was touched. We installed the helper packages with dnf and the node package with rpm --noscripts, then applied the useful parts by hand.
What happens to the remote site's VMs if it loses contact with the front-end?#
In an 8-minute cut of the management path (SSH from the front-end and port 4124 to it), all 16 production VMs at Site B kept running on the same processes and the public sites answered 200 at every check. The front-end took about 7 minutes to mark the host ERROR and the VMs UNKNOWN, and about 2.5 minutes to recover after the path returned. With no fault-tolerance hook installed, it did nothing to the VMs. A real WAN outage was not tested: the cut left replication between the sites flowing.
Can the remote host start its own VMs without the front-end?#
Yes, on a planned reboot. A systemd unit on the Site B host runs virsh create on each VM's last deployment file as oneadmin. After a real reboot it started the 16 production VMs in 16 seconds with no front-end involved. That is guest start, not application recovery: public sites were down about 7 minutes in total, and one API container was restarted by hand. A boot of that host while the link to the front-end is down was not tested.
Do UEFI Secure Boot and virtual TPM contents survive the move to OpenNebula?#
Yes, in this run. OpenNebula runs VMs as transient libvirt domains, and libvirt deletes TPM state when a transient domain stops, so the move adds persistent_state='yes' to the TPM backend. The TPM checks used at Site B were: no manufacturing lines in the new swtpm log, the state file kept its size, and persistent handles, NV indexes and the EK public key hashed the same inside the guest; PCR 7 stayed the same. After the planned Site B reboot, all 4 TPMs on that host were confirmed not re-created.
How do you publish Sunstone without opening a port at either site?#
FireEdge is bound to 127.0.0.1:2616 and published through a Cloudflare tunnel, which only makes outbound connections. A Cloudflare custom rule blocks the hostname for any address not on an IP list holding the two sites' public addresses. Login works through the tunnel and the websocket upgrade the console needs returns HTTP 101. A full VNC console session driven by a person was not tested.
What did this run not prove?#
An unplanned power cut of either host; a boot of the Site B host while the link is down; a real WAN outage; the fixed Site A shutdown unit on a real shutdown; a full Sunstone VNC console session to a remote VM; a real switch of Site A to its backup line; application behaviour beyond containers, ports, health endpoints and public pages; Elasticsearch and MongoDB contents; Windows guests; disk snapshots, live migration and backups of moved VMs; and an OpenNebula package upgrade with moved VMs present.
Sources#
- NG-NeXT: Start your own micro cloud on a refurbished server with AlmaLinux and OpenNebula (first post in this series; quirks Q1 to Q22 and G1 to G8)
- OpenNebula: 7.4 documentation
- OpenNebula: package repository used for the dry run,
https://downloads.opennebula.io/repo/7.4/AlmaLinux/9/x86_64 - Cloudflare: Cloudflare Tunnel documentation
If you run KVM hosts at more than one site and want them under one front-end without a reinstall, the know-how here stays free. NG-NeXT also does consulting for private infrastructure. Tell us what you run through the contact page.
— Nishant Gauraw, Founder and CEO, NG-NeXT Tech