Migrate vm on a node with local-zfs storage to another node with local-lvm storage

hartasse

New Member
Nov 23, 2021
4
0
1
30
Hi everyone,

We want to migrate virtual machine from a node to another node, the issue we are facing is that the storage type of your source node is "local-zfs" and the node that we want to have the virtual machine have "local-lvm" type.

How can we migrate our virtual machines with this different type of storage ? We want to find à solution without reinstall our virtual machines if possible.

We need to migrate these virtual machines and retrieves all of our data at the end of the migration.

Thanks for your help.
 
If you you can shutdown your VMs and the data is critical enough - backup/restore is always a good way to try before you buy.

Otherwise "qm migrate" is what you are looking for:


root@pve7test1:~# qm help migrate USAGE: qm migrate <vmid> <target> [OPTIONS] Migrate virtual machine. Creates a new migration task. <vmid> <integer> (1 - N) The (unique) ID of the VM. <target> <string> Target node. -bwlimit <integer> (0 - N) (default=migrate limit from datacenter or storage config) Override I/O bandwidth limit (in KiB/s). -force <boolean> Allow to migrate VMs which use local devices. Only root may use this option. -migration_network <string> CIDR of the (sub) network that is used for migration. -migration_type <insecure | secure> Migration traffic is encrypted using an SSH tunnel by default. On secure, completely private networks this can be disabled to increase performance. -online <boolean> Use online/live migration if VM is running. Ignored if VM is stopped. -targetstorage <string> Mapping from source to target storages. Providing only a single storage ID maps all source storages to that storage. Providing the special value '1' will map each source storage to itself. -with-local-disks <boolean> Enable live storage migration for local disk


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Hi,

Here is the output of the command qm migrate.

root@blade04:~# qm migrate 134 blade05 --targetstorage local-lvm --online --with-local-disks
VM isn't running. Doing offline migration instead.
2021-11-24 10:55:28 starting migration of VM 134 to node 'blade05' (192.168.100.15)
2021-11-24 10:55:28 found local disk 'local-zfs:vm-134-disk-0' (in current VM config)
2021-11-24 10:55:28 copying local disk images
2021-11-24 10:55:28 ERROR: storage migration for 'local-zfs:vm-134-disk-0' to storage 'local-lvm' failed - cannot migrate from storage type 'zfspool' to 'lvmthin'
2021-11-24 10:55:28 aborting phase 1 - cleanup resources
2021-11-24 10:55:28 ERROR: migration aborted (duration 00:00:00): storage migration for 'local-zfs:vm-134-disk-0' to storage 'local-lvm' failed - cannot migrate from storage type 'zfspool' to 'lvmthin'
migration aborted

It's not possible to migrate these vm because our storage type is different between the source node and the destination node.

We check for the backup/restore.

Thanks for your help
 
Hi,
Hi,

Here is the output of the command qm migrate.

root@blade04:~# qm migrate 134 blade05 --targetstorage local-lvm --online --with-local-disks
VM isn't running. Doing offline migration instead.
for certain combinations of storage types --targetstorage only works with online migration. Please make sure the VM is actually running when using --online.
2021-11-24 10:55:28 starting migration of VM 134 to node 'blade05' (192.168.100.15)
2021-11-24 10:55:28 found local disk 'local-zfs:vm-134-disk-0' (in current VM config)
2021-11-24 10:55:28 copying local disk images
2021-11-24 10:55:28 ERROR: storage migration for 'local-zfs:vm-134-disk-0' to storage 'local-lvm' failed - cannot migrate from storage type 'zfspool' to 'lvmthin'
2021-11-24 10:55:28 aborting phase 1 - cleanup resources
2021-11-24 10:55:28 ERROR: migration aborted (duration 00:00:00): storage migration for 'local-zfs:vm-134-disk-0' to storage 'local-lvm' failed - cannot migrate from storage type 'zfspool' to 'lvmthin'
migration aborted

It's not possible to migrate these vm because our storage type is different between the source node and the destination node.

We check for the backup/restore.

Thanks for your help
 
Thanks for your answers.

It works when we make a backup of our vm and copy the file save in /var/lib/vz/dump to another node with the rsync command.

We can create a new vm and use the save file copied to restore the vm to his original state on a new storage