Migrate VM to different host

i have a idea,
you can add a new node to old cluster,and migrate vms to this new node.
after migrate work is done, delete this node in old cluster,and join new cluster.
 
You may, however, get away with copying/backing up /etc/pve/nodes somewhere safe, deleting /etc/pve/nodes/*, join cluster, then copy back the /etc/pve/nodes backup you took. YMMV, and I'd suggest trying this with a demo cluster first.

This WILL NOT work wif you have VMs of the same VM ID.
 
The easiest way to do this without a cluster is to just use proxmox backup server. Back it up from one node and restore it to the other node.
 
This is now possible via qm remote-migrate as of Proxmox VE 7.3:
https://pve.proxmox.com/pve-docs/qm.1.html
Hi,
thank you for pointing the documentation out. I've tried the
Bash:
qm migrate
command and created another disk image with a new ID.

What I can't follow here is, how to proceed. It would be nice to document a basic example, but there isn't. Is there anybody out there who already tried this? If yes, can you please light me up how the basic steps would be? Thank in advance!

Regards,
Oguz
 
Hi,
thank you for pointing the documentation out. I've tried the
Bash:
qm migrate
command and created another disk image with a new ID.

What I can't follow here is, how to proceed. It would be nice to document a basic example, but there isn't. Is there anybody out there who already tried this? If yes, can you please light me up how the basic steps would be? Thank in advance!

Regards,
Oguz
Ok, for everyone who can end up in this threat like me, I found this thread and it was very useful for me.
 
This is now possible via qm remote-migrate as of Proxmox VE 7.3:
https://pve.proxmox.com/pve-docs/qm.1.html
Thx for this.
Since info is a bit cryptic, here is an example for the migration:

1. On target cluster under Permissions > API Tokens > Add a new token (Uncheck "Privilege Separation"
2. Select your target storage > Permissions > Add > Add API token permission > Select your token and select Role: Administrator
3. Disable replication for the vm.
4. The command syntax is qm remote-migrate <vmid> [<target-vmid>] <target-endpoint> --target-bridge <string> --target-storage <string> [OPTIONS]
5. Example qm remote-migrate 106 106 'apitoken=PVEAPIToken=root@pam!abcd=****-****-****-****,host=10.11.12.13,fingerprint=AB:F8:...€F' --target-bridge vmbr0 --target-storage vm
6. Delete the token when done ;)
Have fun
 
Last edited:
  • Like
Reactions: Energy
I tried the above command with Proxmex VE 8.4.1 and recieved this error.

Code:
root@pvehost1:~# qm remote-migrate 106 20191001 'apitoken=PVEAPIToken=root@pam!pvehost2=175a9...eb023,host=10.1.1.11,fingerprint=3A:...0C' --target-bridge vmbr0 --target-storage stor1
Establishing API connection with remote at '10.1.1.11'
2025-05-04 16:34:51 ERROR: migration aborted (duration 00:00:00): Can't use an undefined value as an ARRAY reference at /usr/share/perl5/PVE/QemuMigrate.pm line 258.
migration aborted