Moving disks in formats other than RAW to LVM

VirtualMan

New Member
Jan 25, 2012
15
0
1
I've noticed the following in the wiki about creating disks on an LVM:
Image format: raw (that is the only option you can choose now)
http://pve.proxmox.com/wiki/Storage_Model

Firstly, why is is only possible to create raw format disks on an LVM?

Secondly, is it possible to move a virtual disk created in another format e.g. qcow2 or vmdk somewhere else to LVM storage and then attach it to a VM?
 
I've noticed the following in the wiki about creating disks on an LVM:
Image format: raw (that is the only option you can choose now)
http://pve.proxmox.com/wiki/Storage_Model

Firstly, why is is only possible to create raw format disks on an LVM?

if you use block devices, there is no format needed as you just use the device with nothing in between (maybe 'raw' is a bit misleading here).

Secondly, is it possible to move a virtual disk created in another format e.g. qcow2 or vmdk somewhere else to LVM storage and then attach it to a VM?

yes, there are several methods. depends on the situation. give more details about your needs.
 
Thanks for the quick reply.
if you use block devices, there is no format needed
I'm using a EXT3 formatted RAID 10 array in LVM if that answers your question?

give more details about your needs.
I have some old VMs that I'd like to move from VMWare Server 2 which are using VMDK file formats and it'd be nice if I didn't have to go through the additional step of converting them. Also, I've made a couple of qcow2 disks in testing (before I sorted out my LVM issues) that should really be on a LVM, it'd save a lot of time if I don't have to recreate or convert them.

Additional info:
Is the reason I can only create raw format disks is because there isn't a filesystem on the LVM? I created it with:
Code:
pvcreate -M2 /dev/sdb
vgcreate vg0 /dev/sdb --clustered n
As I mentioned above it would be more useful if I could store files on there, is it possible to do this?

Trying to move a non RAW format disk onto the LVM I get:
Code:
/var/lib/vz/images/101# mv ./vm-101-disk-1.qcow2 /dev/vg0
mv: writing `/dev/vg0/vm-101-disk-1.qcow2': No space left on device
 
Last edited:
...
Code:
/var/lib/vz/images/101# mv ./vm-101-disk-1.qcow2 /dev/vg0
mv: writing `/dev/vg0/vm-101-disk-1.qcow2': No space left on device
Hi,
this shows that you don't have fully understand lvm/filesystem and so on.

With mv you moves files from one filestem to another filesystem (or same filesystem but different path). Not to an block-device.

dd is the right tool (see "man dd"). But qcow2 must be converted first. "qemu-img convert" is the right solution. First convert to vm-101-disk-1.raw, then define a new Volume (same size or slightly greater) on the lvm-storage (inside the proxmox gui for the VM) and copy the file with "dd if=vm-101-disk-1.raw of=/dev/vg0/vm-101-disk-1 bs=1024k".

Udo
 
Hi Udo, I think I see wher you're coming from. I successfully converted a qcow file (though, oddly, it failed on another using the same command syntax-I'm putting this down to the convert tool being dodgy, there was also a bug with the -O option I had to workaround). Would it be possible to create a LV, format it as, say EXT3, and copy qcow, VMDK files to it directly without having to do a convert and dd?
 
hi!

i think you could
- use LVM on your network "disk images" host, and
- create all filesystems you want, then
- share them via NFS... and
- use that share as storage on pve to store your images

i think "lvm" as a storage method in pve, is intended to be used as a block device, so only "raw" disks are allowed there...

M
 

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!