Migrate kvm from nfs to local

Kerridge0

Member
Feb 22, 2009
31
3
6
I am trying to migrate a KVM vm to a new cluster node, when the storage for the raw disk is currently on an nfs mount.

Firstly I have copied the storage to the new node.

Then I stopped the vm and tried to migrate it to the node. But it started to rsync the disk. this is 230GB and would be quite slow (which is the reason I am moving it to local storage), plus I would need to migrate to an extra storage on the node, so doing it automatically would fail anyway, so I think I need to do it manually.

I am thinking of:-

  • naming the synced disk appropriately on local storage on the node
  • creating a new entry on the node with a new VMID eg /etc/vz/conf/132.conf which would just be an edited copy of the original 105.conf on the original node
  • starting from the PVE

Is that the right way to go about it?

thanks
 
I am trying to migrate a KVM vm to a new cluster node, when the storage for the raw disk is currently on an nfs mount.

Firstly I have copied the storage to the new node.

Then I stopped the vm and tried to migrate it to the node. But it started to rsync the disk. this is 230GB and would be quite slow (which is the reason I am moving it to local storage), plus I would need to migrate to an extra storage on the node, so doing it automatically would fail anyway, so I think I need to do it manually.

I am thinking of:-


  • naming the synced disk appropriately on local storage on the node
  • creating a new entry on the node with a new VMID eg /etc/vz/conf/132.conf which would just be an edited copy of the original 105.conf on the original node
  • starting from the PVE


Is that the right way to go about it?

thanks
Hi,
you wrote a KVM vm -> then is the config not /etc/vz/conf/...! /etc/qemu-server/ is the right place.

You can use vzdump, because you can select the storage and VMID with the restore-command.
But you can also doing it manually. Why you don't migrate the VM to the right clusternode, and then copy (with shutdowned VM) the disk-file to the local storage (/var/lib/vz/images/VMID/)?
After that you must only change the configfile (in /etc/qemu-server/VMID.conf to local ( like " virtio0: local:101/vm-101-disk-1.raw")

Udo
 
Hi,
you wrote a KVM vm -> then is the config not /etc/vz/conf/...! /etc/qemu-server/ is the right place.
oops yes indeed :)

You can use vzdump, because you can select the storage and VMID with the restore-command.
But you can also doing it manually. Why you don't migrate the VM to the right clusternode, and then copy (with shutdowned VM) the disk-file to the local storage (/var/lib/vz/images/VMID/)?
After that you must only change the configfile (in /etc/qemu-server/VMID.conf to local ( like " virtio0: local:101/vm-101-disk-1.raw")

Udo

If I use migrate from the PVE, it tries to migrate the disk, even though it is on nfs storage, and it's too big for default local storage.

I will manually copy and edit qemu-server conf file, and change disk entry. If there's nothing else to do. Thanks a lot.
 
Hi

There doesn't seem to be an option to tick "shared storage" for nfs, or iscsi, but only for lvm or directory, this is 1.7?