OpenVZ on LVM2?

welbers

New Member
Dec 31, 2011
9
0
1
Hi,

is it possible to have OpenVZ containers on LVM2 volumes or to have each container in its own volume? - I couldn't find any possibility in the webfrontend to do it.

By hand it's possible.

Thx
Andreas
 
How? AFAIK openvz does not support LVM devices.

I don't mean lvm2 in an OpenVZ, I mean OpenVZ in an lvm2 volume!

That's easy doing:
* create an lvm for every OpenVZ container as usual with "lvcreate ..."
* format it i.e. "mkfs.ext4 <lvm-volume>"
* mount each formated volume in /var/lib/vz/private/<id>
That's all.
 
welbers;45812I said:
* mount each formated volume in /var/lib/vz/private/<id>
That's all.

Whils that looks easy, it breaks 'vzctl' - simple 'vzctl mount' command does not work in such configuration?
 
Hi there,

proxmox 1.x was able to create a LVM2 volume during provisioning an OpenVZ Container to use this volume as the disk drive for the CT, in proxmox 2.0 I didn't find this possibility. I think welders means the same.
So, is it not supported in proxmox 2.0 to create LVMs for CTs? I only found this way for KVMs.
 
Whils that looks easy, it breaks 'vzctl' - simple 'vzctl mount' command does not work in such configuration?

Hm, I'm very new to openvz but I can't see this problem.

I did some tests for you with my vm101 created as described above.
I have the directory /vz-containers where I mount each lvm2 volumen which contains an openvz container.
For the tests I mounted container 101 via soft-link with "ln -s /vz-containers/101 /var/lib/vz/private/101" and I did also a bind mount with
"mount --bind /vz-containers/101 /var/lib/vz/private/101".

All tests with vzctl were successful. I tried "start/stop/mount/umount/status.." and couldn't find a problem.
Example:
root@server:/vz# vzctl status 101
CTID 101 exist mounted running
 

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!