Bought new nas, I need to migrate all nfs shares

mgiammarco

Renowned Member
Feb 18, 2010
165
10
83
Hello,
I have a nas with an nfs share for proxmox images.
Inside I have several proxmox vms that I have created with "linked clone" from a base image.

Now I bought a new, faster and bigger nas. I have created a nfs volume and added it to proxmox.
Now how can I migrate all my vms with their disks and configurations to new nfs?
Obviously I hope to maintain the space savings that linked clone permits.

Thanks,

Mario
 
I guess your best option is to
1) copy all base image files to new storage
2) stop vms
3) copy/move mv diff image files to new nas
4) update vm config
5) restart vms

you could also automate steps 2+3+4+5 to "move" one vm at the time if you wish to minimize downtime

Marco
 
First many thanks for your reply!
I need some details:

- point 3): what is a "diff image file"?
- point 4): where is vm config I need to modify?

Thanks,
Mario
 
- point 3): what is a "diff image file"?
- point 4): where is vm config I need to modify?

you talked about linked clones, right? well they have a "base" image file and a "diff" image file. That's the whole point in linked clones, afaik.
* the "base" one is the disk of the "template vm" they're linked to.
* the "diff" image is their specific OS filesystem differing from the base image with its specific settings and filesystem changes.

so you'll have a kvm "template" in pve, which has the base disk for all respective linked clones.
say, base-110-disk-1.qcow2 (VMID is clearly 110 here)

your linked clone will have (eg: VMID 112)
* a reference to the template disk (ie: base-110-disk-1.qcow2),
* plus its own diff disk, say vm-112-disk-1.qcow2

if you look at the two .conf files you will find
* for the template (VMID 110, so /etc/pve/nodes/nodename/qemu-server/110.conf) something like
"virtio0: storagename:110/base-110-disk-1.qcow2,format=qcow2,size=8G"

* from the linked clone (VMID 112 so /etc/pve/nodes/nodename/qemu-server/112.conf) something like
"virtio0: storagename:110/base-110-disk-1.qcow2/112/vm-112-disk-1.qcow2,size=8G"

where you note the template disk AND the diff disk are listed. (size=8G describes that the disk will be seen as an 8GB disk - in both cases, obviously)

base-110-disk-1.qcow2 is the same for all linked clones to this 110 template and never changes.
so you can copy it to the new nas, to another template.
you should probably
* first create a new template (say 111) with identical disk on the new nas, ie: base-111-disk-1.qcow2
* then copy the 110 disk over the 111, so 110 (old nas) and 111 (new nas) templates will have the same disk, providing the same "base" for linked clones.
in this way you will move one vm at time to the new nas template disk (111) while old linked clones are still running on the old - identical - nas template disk (110)

* then stop the 112 (old nas) linked clone.
* then move/copy the vm-112-disk-1.qcow2 to the new nas, under the 112 folder, as it is on the old nas.
* then edit /etc/pve/nodes/nodename/qemu-server/112.conf) changing
> from "virtio0: storagename:110/base-110-disk-1.qcow2/112/vm-112-disk-1.qcow2,size=8G"
> to "virtio0: newstorage:111/base-111-disk-1.qcow2/112/vm-112-disk-1.qcow2,size=8G"
* then you should be able to restart the linked clone (112) without issues.

try first with a "test" linked clone, if all works, repeat last steps for each clone linked to template 110.

warning: I never tried this, but it should work, more or less...

Marco
 

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!