Move VM's from NFS to iSCSI/LVM

hotwired007

Member
Sep 19, 2011
533
7
16
UK
I'm planning on moving my VMs from an NFS share to an iSCSI/LVM share. Can anyone offer any advice on how to do this?

I'm assuming its simlar to this for moving Local to NFS...

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/NFSShare used)

edit:
ide0: local:102/vm-102-disk-1.raw
to:
ide0: NFSShare:102/vm-102-disk-1.raw

Log into Proxmox Host via URL - config is loaded and ready to go. Start VM.
 
is there no way to manually move it?

all i need to do is navigate to the iSCSI mount point on the proxmox server and move the .raw file over like i have done in the past when moving them from the local to the NFS share.
 
is there no way to manually move it?

all i need to do is navigate to the iSCSI mount point on the proxmox server and move the .raw file over like i have done in the past when moving them from the local to the NFS share.
Hi,
of course is there an maual way - it's linux, you can all do by hand.
But dietmars suggestion is right for not so experience linux-user. Because your lvm-storage don't have an filesystem (if you use lvm-storage like the normal proxmox way) and without filesystem also no mount point.

If you wan't to do handwork, create an lv (with the right tag) on the lvm-storage, shut the vm down, copy the content with dd, edit the vm-config and fire the vm up.
If all works remove old disk-file.

Udo
 
Hi,
of course is there an maual way - it's linux, you can all do by hand.
But dietmars suggestion is right for not so experience linux-user. Because your lvm-storage don't have an filesystem (if you use lvm-storage like the normal proxmox way) and without filesystem also no mount point.

If you wan't to do handwork, create an lv (with the right tag) on the lvm-storage, shut the vm down, copy the content with dd, edit the vm-config and fire the vm up.
If all works remove old disk-file.

Udo

Hi Udo,

I'm trying to get a bit more hands on with Nix rathere than just following a process, i'm interested in seeing whats going on in the background - just want to understand the backup/restore process.

Currently i have all my VM iamges stored on a NFS mount called PClusterStor.

I have an iSCSI mount called - PClusterISCSI with a Proxmox LVM (PClusterISCSI-LVM) on my servers i can navigate to /dev/pclusteriscsi/ and find my HDD raw files.

How do i create an LV with the right tag (should the tag be PClusterISCSI-LVM?)

I assume that the command to move the HDD image would be: mv /mnt/pve/PClusterStor/images/102/*.* /dev/pclusteriscsi/

and then i would need to modify my /etc/qemu-server/102.conf -

ide0: PClusterStor:102/vm-102-disk-1.raw
to
ide0: PClusterISCSI-LVM:vm-102-disk-1

or have i completely misunderstood the process?

Cheers
 
Hi Udo,

I'm trying to get a bit more hands on with Nix rathere than just following a process, i'm interested in seeing whats going on in the background - just want to understand the backup/restore process.
ok,
learning is allways usefull.
Currently i have all my VM iamges stored on a NFS mount called PClusterStor.

I have an iSCSI mount called - PClusterISCSI with a Proxmox LVM (PClusterISCSI-LVM) on my servers i can navigate to /dev/pclusteriscsi/ and find my HDD raw files.

How do i create an LV with the right tag (should the tag be PClusterISCSI-LVM?)
look with
Code:
lvs --options 'vg_name,lv_name,lv_size,tags'
to add an tag use something like this
Code:
lvchange --addtag pve-vm-999 /dev/volumegroupname/lvname
I assume that the command to move the HDD image would be: mv /mnt/pve/PClusterStor/images/102/*.* /dev/pclusteriscsi/
NO!
mv is to move an file on a filesystem - logical volumes are images of harddisks!
If you have created the logical-volume on your iscsi-share you can do something like
Code:
dd if=/mnt/pve/PClusterStor/images/102/vm-102-disk-1.raw of=/dev/pclusteriscsi/vm-102-disk-1 bs=1024k
and then i would need to modify my /etc/qemu-server/102.conf -

ide0: PClusterStor:102/vm-102-disk-1.raw
to
ide0: PClusterISCSI-LVM:vm-102-disk-1
right.

Udo