I want to move my LVM based VMs from my old KVM server to my new KVM server. What is "the way"?
I have:
KVM running on Ubuntu 12.04 - old system
with 5 VMs on LVM partition at /dev/sd3/vgroup/
all references to VMs in /dev/sd3/vgroup/ are actually symlinks to ../dm-1-5
KVM running on Ubuntu 16.04 - new system
with 1 vm, deb8, as a test
it also has the same structure /dev/sd4/vgroup/deb8
deb8 is a link to ../dm-0
a backup script that weekly stops each vm on old system and dd to a gzipped copy
If I unzip a copy of my backed-up vm on the new KVM box, and dd it to /dev/vgroup/testdata it copies the vm file and does not create the magic link to /dev/vgroup/testdata (which, I assume, should link to ../dm-1). The copied testdata VM in /dev/vgroup does not appear in my list of storage volumes in virt-manager.
I've read a lot of articles about using snapshots, dd, gzip, and dd back to the LVM directory. I also have the vm.xml config files backed up, but none of the articles I found seem to describe how this is to be used to bring up on a new server.
Can someone please explain all this magic (or definitive references) and maybe just a straight-ahead approach to moving LVM based VMs from one KVM server to another KVM server.
Thanks in advance,
Chris.
Old KVM
# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
testCinga vgroup -wi-ao 58.59g
UbuDesktop vgroup -wi-a- 39.06g
devbox vgroup -wi-ao 39.06g
testdata vgroup -wi-ao 39.06g
testlogs vgroup -wi-ao 19.53g
testlogs2 vgroup -wi-ao 54.69g
webserver1 vgroup -wi-ao 40.00g
win2008-1 vgroup -wi-a- 29.30g
lsblk /dev/sda3
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda3 8:3 0 422.9G 0 part
└─md2 9:2 0 422.8G 0 raid1
├─vgroup-webserver1 (dm-0) 252:0 0 40G 0 lvm
├─vgroup-UbuDesktop (dm-1) 252:1 0 39.1G 0 lvm
├─vgroup-testCinga (dm-2) 252:2 0 58.6G 0 lvm
├─vgroup-testdata (dm-3) 252:3 0 39.1G 0 lvm
├─vgroup-testlogs (dm-4) 252:4 0 19.5G 0 lvm
├─vgroup-testlogs2 (dm-5) 252:5 0 54.7G 0 lvm
├─vgroup-devbox (dm-6) 252:6 0 39.1G 0 lvm
└─vgroup-win2008--1 (dm-7) 252:7 0 29.3G 0 lvm
# ls -la /dev/vgroup
total 0
drwxr-xr-x 2 root root 200 Aug 20 13:08 .
drwxr-xr-x 17 root root 4700 Aug 20 13:08 ..
lrwxrwxrwx 1 root root 7 Aug 20 13:08 devbox -> ../dm-6
lrwxrwxrwx 1 root root 7 Aug 19 22:15 testCinga -> ../dm-2
lrwxrwxrwx 1 root root 7 Aug 19 21:51 testdata -> ../dm-3
lrwxrwxrwx 1 root root 7 Aug 19 08:37 testlogs -> ../dm-4
lrwxrwxrwx 1 root root 7 Aug 19 20:39 testlogs2 -> ../dm-5
lrwxrwxrwx 1 root root 7 Aug 14 20:21 UbuDesktop -> ../dm-1
lrwxrwxrwx 1 root root 7 Aug 19 01:45 webserver1 -> ../dm-0
lrwxrwxrwx 1 root root 7 Aug 19 22:41 win2008-1 -> ../dm-7
New KVM
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
deb8 vgroup -wi-ao---- 80.00g
# lsblk /dev/sda4
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda4 8:4 0 2.2T 0 part
└─vgroup-deb8 252:0 0 80G 0 lvm
# ls -la /dev/vgroup
total 16446376
drwxr-xr-x 2 root root 80 Aug 21 12:57 .
drwxr-xr-x 19 root root 4260 Aug 21 12:57 ..
lrwxrwxrwx 1 root root 7 Aug 18 02:24 deb8 -> ../dm-0
-rw-r--r-- 1 root root 16841089024 Aug 21 12:20 testdata
I have:
KVM running on Ubuntu 12.04 - old system
with 5 VMs on LVM partition at /dev/sd3/vgroup/
all references to VMs in /dev/sd3/vgroup/ are actually symlinks to ../dm-1-5
KVM running on Ubuntu 16.04 - new system
with 1 vm, deb8, as a test
it also has the same structure /dev/sd4/vgroup/deb8
deb8 is a link to ../dm-0
a backup script that weekly stops each vm on old system and dd to a gzipped copy
If I unzip a copy of my backed-up vm on the new KVM box, and dd it to /dev/vgroup/testdata it copies the vm file and does not create the magic link to /dev/vgroup/testdata (which, I assume, should link to ../dm-1). The copied testdata VM in /dev/vgroup does not appear in my list of storage volumes in virt-manager.
I've read a lot of articles about using snapshots, dd, gzip, and dd back to the LVM directory. I also have the vm.xml config files backed up, but none of the articles I found seem to describe how this is to be used to bring up on a new server.
Can someone please explain all this magic (or definitive references) and maybe just a straight-ahead approach to moving LVM based VMs from one KVM server to another KVM server.
Thanks in advance,
Chris.
Old KVM
# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
testCinga vgroup -wi-ao 58.59g
UbuDesktop vgroup -wi-a- 39.06g
devbox vgroup -wi-ao 39.06g
testdata vgroup -wi-ao 39.06g
testlogs vgroup -wi-ao 19.53g
testlogs2 vgroup -wi-ao 54.69g
webserver1 vgroup -wi-ao 40.00g
win2008-1 vgroup -wi-a- 29.30g
lsblk /dev/sda3
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda3 8:3 0 422.9G 0 part
└─md2 9:2 0 422.8G 0 raid1
├─vgroup-webserver1 (dm-0) 252:0 0 40G 0 lvm
├─vgroup-UbuDesktop (dm-1) 252:1 0 39.1G 0 lvm
├─vgroup-testCinga (dm-2) 252:2 0 58.6G 0 lvm
├─vgroup-testdata (dm-3) 252:3 0 39.1G 0 lvm
├─vgroup-testlogs (dm-4) 252:4 0 19.5G 0 lvm
├─vgroup-testlogs2 (dm-5) 252:5 0 54.7G 0 lvm
├─vgroup-devbox (dm-6) 252:6 0 39.1G 0 lvm
└─vgroup-win2008--1 (dm-7) 252:7 0 29.3G 0 lvm
# ls -la /dev/vgroup
total 0
drwxr-xr-x 2 root root 200 Aug 20 13:08 .
drwxr-xr-x 17 root root 4700 Aug 20 13:08 ..
lrwxrwxrwx 1 root root 7 Aug 20 13:08 devbox -> ../dm-6
lrwxrwxrwx 1 root root 7 Aug 19 22:15 testCinga -> ../dm-2
lrwxrwxrwx 1 root root 7 Aug 19 21:51 testdata -> ../dm-3
lrwxrwxrwx 1 root root 7 Aug 19 08:37 testlogs -> ../dm-4
lrwxrwxrwx 1 root root 7 Aug 19 20:39 testlogs2 -> ../dm-5
lrwxrwxrwx 1 root root 7 Aug 14 20:21 UbuDesktop -> ../dm-1
lrwxrwxrwx 1 root root 7 Aug 19 01:45 webserver1 -> ../dm-0
lrwxrwxrwx 1 root root 7 Aug 19 22:41 win2008-1 -> ../dm-7
New KVM
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
deb8 vgroup -wi-ao---- 80.00g
# lsblk /dev/sda4
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda4 8:4 0 2.2T 0 part
└─vgroup-deb8 252:0 0 80G 0 lvm
# ls -la /dev/vgroup
total 16446376
drwxr-xr-x 2 root root 80 Aug 21 12:57 .
drwxr-xr-x 19 root root 4260 Aug 21 12:57 ..
lrwxrwxrwx 1 root root 7 Aug 18 02:24 deb8 -> ../dm-0
-rw-r--r-- 1 root root 16841089024 Aug 21 12:20 testdata