EO VM Manager has to manage machines on both Proxmox VE and VMware vSphere. The user sees one list of VMs, a “Start” button and a “Migrate” button. Behind them, the two platforms have almost nothing in common. This is about the parts that took the most work.
One interface, two implementations
Business code only knows abstract providers: create a VM, start it, stop it, clone it, migrate it, read its state. A factory returns the Proxmox or the vSphere implementation depending on the cluster. Adding a provider means writing a new class, without touching the screens or the access rules.
On Proxmox we use an API token (user@realm!token) rather than a password. On vSphere we go through vCenter, with the REST API where it covers what we need and pyVmomi for the rest.
The important difference is that nearly everything is asynchronous. A Proxmox migration or clone returns a task id (UPID) straight away, and the work happens afterwards. vSphere works the same way with its Task objects. So the FastAPI endpoint creates a job, hands it to a Celery worker, and the worker follows the progress. The UI receives the state over WebSocket without reloading.
The guest agent changes everything
At first our VMs showed up without an IP address. Proxmox can’t guess a machine’s IP: the guest system has to report it. That’s what qemu-guest-agent is for.
We made it mandatory in every template: the package is installed in the image and the agent option is enabled on the VM. With the agent, the API answers on /nodes/{node}/qemu/{vmid}/agent/network-get-interfaces, a shutdown is clean instead of a power cut, and the file system can be frozen during a backup.
On vSphere the equivalent is VMware Tools. Our Windows and Linux templates include it, and vCenter then reports the IP and host name. A VM created without an agent is flagged in the UI, because it will cause trouble later.
Reading a cluster properly
The Infrastructure screen shows, per cluster, the nodes online, quorum, high availability and capacity. On Proxmox it all comes from /cluster/status and /cluster/resources, which we aggregate into cores, free memory and used storage. On vSphere the same numbers come from the hosts and datastores.
Two cluster settings saved us trouble:
- Shared storage (an iSCSI LUN) for VM disks. Disks don’t move during a migration; only memory is copied.
- One CPU model for every VM (
x86-64-v2-AES) instead ofhost. A VM can then move between nodes even when the physical processors differ.
Live migration and node draining
On Proxmox, a live migration is a call to POST /nodes/{node}/qemu/{vmid}/migrate with target and online=1. With shared storage it takes as long as copying the memory. With local disks you need with-local-disks, and it’s much slower. On vSphere it’s vMotion, by relocating the VM to another host.
Before starting anything we check three things: the target node is online, it has enough free memory, and the VM has no local device that would block the move. A migration refused up front beats one that fails at 80%.
Draining a node before maintenance uses the same building block: we list its VMs, migrate them one at a time while waiting for each task to finish, then mark the node unavailable. One at a time, because ten migrations at once saturate the network and the last ones fail.
What I took from it
- The guest agent isn’t optional. Put it in the templates on day one.
- Every long action goes through a job queue, and the user sees the progress.
- Shared storage and a common CPU model make live migration routine. Without them it becomes a project of its own.
- The provider layer pays for itself as soon as the second hypervisor arrives.