Move VM to another node with different storage name

Florius

Well-Known Member
Jul 2, 2017
35
9
48
57
Hi,

I have a new server, bigger, better, more disk space.
I have a cluster with the old and new server.
Now I have to migrate the data of 1 VM on disk called "storage" to the new server where the disk is called "DATA".

How would I do this? If I try the normal right click option, it says "storage" does not exist on the new host.
So how can I tell the VM to move the data from "storage" to "DATA"?

Thanks!

EDIT: I wanted to add, making a backup and moving it then is no option, it's 4TB, which I have no space for.
EDIT2: It's from a ZFS store to a LVM thin pool... If it makes a difference.
 
You can do a migration with local disks on the CLI, see 'qm help migrate'.
 
Hopefully this helps future googlers like me, since the qm help migrate man page is a bit lacking

I had to migrate VMs in a cluster between 2 nodes with differently named storage. This is impossible to reconcile via the GUI (at time of writing - PVE 6.2) because it will only allow adding cluster storage if the same storage name exists on both nodes.

I used this command to migrate a VM from MYNODE1 (STEVE) to MYNODE2 (VOULA) with different source and destination storage names.
I use a dedicated network but if you only have one network that can be omitted. I had the VM turned off but it can be done while running with --online I think (haven't tested).

Bash:
qm migrate 101 VOULA -migration_network 172.16.10.0/24 -targetstorage rpool:pool1 -with-local-disks

1603947674109.png
 
Last edited:
I know this thread is super old, but Google brought me here, so I thought I would confirm that this DOES work for online / live migrations as well. Seems strange that the UI still doesn't allow this in PVE 8.2.2, but glad this is at least possible at the CLI.

qm migrate <vmId> <destHost> -migration_network <networkCidr> -targetstorage <targetStorage> -with-local-disks --online
 
If you do a migration with local storage, the migration dialog should show a drop down field for the target storage.
1717672655776.png
 
  • Like
Reactions: sublimnl
Correct you are. I must have missed that second dropdown yesterday. I just tested it again and it works as you described.
 
  • Like
Reactions: aaron
If you do a migration with local storage, the migration dialog should show a drop down field for the target storage.
View attachment 69353

This only works for online migration from what i've seen. Is the command above the only option for offline migrations? I've always found it odd why this would be the case.

Also, is there a way to migrate a VM while also moving different volumes to different storage targets? For example we host our OS volumes on different storage targets (with different block sizes/settings) to our DB volumes. So far the online option (at least in the UI) seems to be to migrate every volume at once, then 'move storage' once migration to that single storage target is done.

I'm OK with doing this via CLI, i just didn't see this was an option until finding this thread just now.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!