Migration from local storage to NFS share

hotwired007

Member
Sep 19, 2011
533
7
16
UK
is it possible to migrate from the local storage to an NFS share easily?

I have two clustered servers, both have local storage and I have now added an NFS share, i want to move a KVM VM from server1 local to server1 nfs share, is the best way to do this to delete the local disk on server2 and then migrate everything to server2, then delete server1 local disk and then migrate everything back again?

Cheers
 
just copy the virtual disk image to the nfs share and adapt the config (pointing the new path).

take a deeper look on /etc/qemu-server/VMID.conf

e.g. here is an example with one local disk and one disk on my nfs (named: NFS-Disks):

...
virtio0: local:140/vm-140-disk-1.raw
virtio1: NFS-Disks:140/vm-140-disk-1.raw
...

to be organized, make sure you got the same dir structure, just analyse the local storage.
 
Hi Tom,


Walkthrough - Correct me where i'm wrong:


Putty


mv -r /var/lib/vz/images/102 /mnt/pve/PClusterStor/images/102


vi /etc/qemu-server/102.conf
edit:
ide0: local:102/vm-102-disk-1.raw
to:
ide0: PClusterStor:102/vm-102-disk-1.raw


then what?
 
(Replace 'VMID' - with VMID (eg 102), Replace 'NFSShare' with NFS Share (eg PClusterStor)

Shutdown VM in Proxmox VE


Putty to Proxmox Host


mkdir /mnt/pve/'NFSShare'/images/'VMID'

mv -r /var/lib/vz/images/'VMID'/*.* /mnt/pve/'NFSShare'/images/'VMID'/

vi /etc/qemu-server/'VMID'.conf

(Update with correct VMID/Location where 102/PClusterStor used)

edit:
ide0: local:102/vm-102-disk-1.raw
to:
ide0: PClusterStor:102/vm-102-disk-1.raw
Log into Proxmox Host via URL - config is loaded and ready to go. Start VM.
 
Last edited: