Tools to migrate virtual machines from a VMware ESXi host to Elemento (AtomOS), built on pyVmomi.
For each VM found on the ESXi host, the tool will:
- Connect to the host and enumerate its VMs.
- Power off each VM (if running).
- Locate its
.vmdk/.vmx/.nvramfiles on the datastore (via SSH) and download them locally toesxi_files/. - Convert the VM's config, disks and NICs to Elemento's C4 spec format.
- Import each disk as a volume, create the required networks, and register the VM on Elemento.
main.py— CLI entry point; connects to ESXi and drives the migration.esxi.py— ESXi/vSphere helpers (VM/host inspection, power state, file discovery & download, C4 spec conversion).elemento.py— Elemento/AtomOS API client (auth, volume import, network creation, VM registration).ssh.py— Enables/disables the SSH (TSM-SSH) service on the ESXi host.pyvmomi/— Vendored copy of the pyVmomi SDK.
- Python 3
- A virtual environment
- Network access to both the ESXi host and the Elemento host
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtCopy the sample environment file and fill in your credentials:
cp .env.sample .env.env:
ESXI_USERNAME=root
ESXI_PASSWORD=
ESXI_HOST=
ELEMENTO_HOST_IP_ADDRESS=
ELEMENTO_HOST_USERNAME=
ELEMENTO_HOST_PASSWORD=Optional variables (with defaults) recognized by elemento.py:
ELEMENTO_VM_API_URL(default:7777/api/v1.0/)ELEMENTO_VOLUME_API_URL(default:7772/api/v1.0/)ELEMENTO_NETWORK_API_URL(default:7776/api/v1.0/)ELEMENTO_PORTAL_USERNAME/ELEMENTO_PORTAL_PASSWORD— used to authenticate against the Elemento portal; falls back toELEMENTO_API_TOKENif login failsATOMOS_ALLOW_INSECURE_TLS— set totrueto skip TLS verification on Elemento API calls
Activate the venv, then run main.py:
source venv/bin/activate
python main.py --host 192.168.1.10 --user root --insecure If --host/--user/--password are omitted, they fall back to the .env values (ESXI_HOST, ESXI_USER, ESXI_PASSWORD). If no password is provided at all, you'll be prompted for one securely.
| Flag | Description |
|---|---|
--host |
ESXi host or IP address |
--user |
Username (default: root) |
--password |
Password (prompted securely if omitted) |
--port |
HTTPS port (default: 443) |
--insecure |
Disable SSL certificate validation (self-signed certs) |
--enable-ssh |
Enable and start the SSH (TSM-SSH) service on the host before migrating |
python main.py \
--host esxi.lab.local \
--user root \
--insecure \
--enable-sshThis connects to esxi.lab.local, prints host info, enables SSH on the host, then lists and migrates every VM found — downloading its disk/config files and registering it on the Elemento host configured via ELEMENTO_HOST_IP_ADDRESS.