You are not logged in.

#1 2018-04-22 05:04:01

kcallis
Member
Registered: 2017-02-03
Posts: 7

LVM and KVM

I almost fell into darkness by going back to Ubuntu, but I knew that if I searched hard there would be an answer here. I initially was going to use Proxmox 5 to act as a bare metal virtual host and serve up KVM images, as well as lxc and docker containers. The storage setup under Proxmox was using 3 logical drives (/, swap, and data), and in theory on a 1TB drive, the root partition was 200GB, swap was 8GB, and the remaining space was used for data. KVM images were suppose to be on a raw partition on data, but when I use vgs, I see that root is 900GB as opposed to data.

So what is the correct way to setup LVM so that my images load in the data... Also, if I am doing a raw partition, could my containers use the data partition or would I have to increase the root partition and running the container on the root?

Offline

#2 2018-04-22 05:28:13

frostschutz
Member
Registered: 2013-11-15
Posts: 1,418

Re: LVM and KVM

?¿?

There is no correct or incorrect way. Just do whatever suits you best.

For KVM, I prefer using raw block device. i.e. one fully allocated, unfragmented LV for each VM, which serves as the VM's raw disk.

Basically the setup suggested by https://www.linux-kvm.org/page/Tuning_KVM

Other people may prefer using a filesystem and qcow or similar format files as virtual hard drives.

There is pros and cons to everything, and each of these has custom options as well (regarding caching and such like). You have to study the man pages. Or just trust whatever frontend you decided to go with instead.

If the root server is to be an empty shell that does nothing but serve KVM machines, not using a separate rootfs (separate data partition) may be okay. Such a rootfs would be extremely tiny anyhow.

I would still separate them, even if it means wasting some free space on the rootfs that will never be used, but again that is just my preference...

Offline

#3 2018-04-22 06:37:55

kcallis
Member
Registered: 2017-02-03
Posts: 7

Re: LVM and KVM

Thanks for the response! Your suggestion is spot on.... I became so fixated on creating the same layout that I have been sitting here turning my wheels and not running with what I know should work. I guess that I wasn't quite sure to force my images on a data partition. Considering that I am running everything on a single HD, it really doesn't matter what the layout is like. I still haven't figured out if my container can live on a raw partition, but at least I know what to do with the KVM images.

Offline

Board footer

Powered by FluxBB