KVM to LVM conversion

chrisalavoine

Renowned Member
Sep 30, 2009
152
0
81
Hi all,

First of all congrats on a wonderful app. I've been wrestling with KVM, LVM and clustering for a few weeks now and proxmox has tied everything together nicely.

About my setup: I have two Dell R410, each machine has four disks, two SATA (160GB) and two SAS (149GB). The SATA contain proxmox install and are RAID 1. The SAS disks are for VM storage and are RAID 0.

I have created a cluster with the two machines and the idea is to have a LVM group shared (on the SAS) between the two machines so I can do snapshots.

I have inherited a VMware Windows 2003 server guest which I have duly converted into a qcow2 disk image. I can run this image fine as detailed in your documentation, i.e creating an empty VM and then pointing it towards the qcow2 file.

My question is this: I would like to convert this qcow2 file into an LVM raw image mounted on the SAS drives (/dev/sdb). I've created an LVM group via the web interface and made it shared but that's about as far as I've got.

I am using 1.4 Beta (updated release with new Broadcom NIC fix - thanks for that btw).

Any help much appreciated.

Chris.
 
Hi all,

First of all congrats on a wonderful app. I've been wrestling with KVM, LVM and clustering for a few weeks now and proxmox has tied everything together nicely.

About my setup: I have two Dell R410, each machine has four disks, two SATA (160GB) and two SAS (149GB). The SATA contain proxmox install and are RAID 1. The SAS disks are for VM storage and are RAID 0.

I have created a cluster with the two machines and the idea is to have a LVM group shared (on the SAS) between the two machines so I can do snapshots.

I have inherited a VMware Windows 2003 server guest which I have duly converted into a qcow2 disk image. I can run this image fine as detailed in your documentation, i.e creating an empty VM and then pointing it towards the qcow2 file.

My question is this: I would like to convert this qcow2 file into an LVM raw image mounted on the SAS drives (/dev/sdb). I've created an LVM group via the web interface and made it shared but that's about as far as I've got.

I am using 1.4 Beta (updated release with new Broadcom NIC fix - thanks for that btw).

Any help much appreciated.

Chris.

make a backup with vzdump and do a restore with qmrestore (see man qmrestore for restoring to your LVM storage).
 
Many thanks for the quick reply.

I've done a vzdump using:

vzdump 101

which duly created my tar file in /var/lib/vz/dump/vzdump-qemu-101.tar

I then ran:

qmrestore --storage kvm-data /var/lib/vz/dump/vzdump-qemu-101.tar 102

(kvm-data is the name of my LVM storage)

This returned the following:

INFO: restore QemuServer backup '/var/lib/vz/dump/vzdump-qemu-101.tar' using ID 102
INFO: extracting 'qemu-server.conf' from archive
INFO: extracting 'vm-disk-ide0.qcow2' from archive
INFO: unable to restore 'vm-disk-ide0.qcow2' to storage 'kvm-data'
INFO: storage type 'lvm' does not support format 'qcow2
INFO: tar: vm-disk-ide0.qcow2: Cannot write: Broken pipe


Any ideas?

Chris.
 
Many thanks for the quick reply.

I've done a vzdump using:

vzdump 101

which duly created my tar file in /var/lib/vz/dump/vzdump-qemu-101.tar

I then ran:

qmrestore --storage kvm-data /var/lib/vz/dump/vzdump-qemu-101.tar 102

(kvm-data is the name of my LVM storage)

This returned the following:

INFO: restore QemuServer backup '/var/lib/vz/dump/vzdump-qemu-101.tar' using ID 102
INFO: extracting 'qemu-server.conf' from archive
INFO: extracting 'vm-disk-ide0.qcow2' from archive
INFO: unable to restore 'vm-disk-ide0.qcow2' to storage 'kvm-data'
INFO: storage type 'lvm' does not support format 'qcow2
INFO: tar: vm-disk-ide0.qcow2: Cannot write: Broken pipe


Any ideas?

Chris.

you need to convert the qcow2 to raw first (with qemu-img), then backup/restore as described.
 
It's as simple as ticking the 'Shared' box when you add the LVM Group via the web interface.

No, its is not! The intention of that flag is to mark shared devices. It does not automagically transform a non-shared device into a shared device. This is simply impossible.
 
No, its is not! The intention of that flag is to mark shared devices. It does not automagically transform a non-shared device into a shared device. This is simply impossible.
Apologies for the misunderstanding. I stand corrected.

In that case, how is sharing achieved?
 
Ok. Have been having mucho fun and games with DRBD.

I have a cluster setup via proxmox, all nicely synced.

I have a second NIC in each box (eth1) set to 10.0.0.1 and 10.0.0.2 respectively. I followed the DRBD proxmox howto to the letter but seem to have got myself stuck in a situation where whenever I start drbd I end up with a Primary:Unknown situation (split-brain?)
cs:WFConnection ro:Primary/Unknown ds:UpToDate/DUnknown C r----
ns:0 nr:0 dw:0 dr:536 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:285458236

Both machines have identical hardware and eth1 is connected via crossover.

I can't even kill this situation as every time I start drbd this happens. I guess I've screwed up somewhere along the line.

Any suggestions most welcome.

Chris.
 
Ok. Have been having mucho fun and games with DRBD.

I have a cluster setup via proxmox, all nicely synced.

I have a second NIC in each box (eth1) set to 10.0.0.1 and 10.0.0.2 respectively. I followed the DRBD proxmox howto to the letter but seem to have got myself stuck in a situation where whenever I start drbd I end up with a Primary:Unknown situation (split-brain?)
cs:WFConnection ro:Primary/Unknown ds:UpToDate/DUnknown C r----
ns:0 nr:0 dw:0 dr:536 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:285458236

Both machines have identical hardware and eth1 is connected via crossover.

I can't even kill this situation as every time I start drbd this happens. I guess I've screwed up somewhere along the line.

Any suggestions most welcome.

Chris.

just to make sure: did you get the DRBD documenation?
see http://www.drbd.org/docs/about/
 
I have seen and read the docs.

Am currently performing a dd if=/dev/zero of=/dev/sdb to make sure I haven't got any leftovers on my disk. I've been trying out a few different LVM setups over the past few weeks.

Will try again once this has finished.
 

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!