OpenVZ Forum


Home » General » Support » LVM support inside a container
icon5.gif  LVM support inside a container [message #32641] Thu, 21 August 2008 15:02 Go to next message
ebastien is currently offline  ebastien
Messages: 1
Registered: August 2008
Junior Member
Hello,
In a container running MySQL, I would like to store the data files on a LVM volume for easy backup through LVM snapshots.
I tried giving all "capabilities" to the container and exporting devices /dev/lvm and /dev/mapper/control, but without success. I always get the error "No program "blablabla" found for your current version of LVM", which means that something is still missing...
It is of course possible to create the LVM volumes on the HN and then "mount bind" to the CT but it makes the setup complex to handle for automated MySQL backup tools. My preferred setup would be to delegate all the snapshot stuff to the container.
Has anybody already succeeded in running LVM in a container ? The only post I found on this subject was dealing with LVM for the root fs of the CT, which was not possible.

Emmanuel
Re: LVM support inside a container [message #32651 is a reply to message #32641] Fri, 22 August 2008 00:20 Go to previous message
piavlo is currently offline  piavlo
Messages: 159
Registered: January 2007
Senior Member
I don't think that giving VE access to lvm devices
will help. All you can do is import some specific lvm volume or several volumes to VE. And VE will be able to access data on these
volumes. Don't know what will happen if the volume is mounted
both on HN and VE, possibly data corruption if the fs on the volume is not cluster aware (depends on how openvz handle this).
If you strace a command like pvscan you'll see that it needs
to access really a lot of misc devices under /dev. But even if you give VE access to all those devices it still will not work, since VE does not have direct access to HN hardware. Maybe if you will give VE access to /sys on HN with bind mount too, it will be able to do something (in case /dev & /sys access is sufficient for device mapper for lvm manipulation), but i doubt it.

It would be nice to hear from oepnvz devs if it theoretically possible to manipulate lvm volimes from VE.

Anyway if you are using lvm snapshot to backup Mysql you can
1) Install mysql client tools in HN and then you don't need
to modify your backup scripts and just tweak the backup location.
2) If you don't want to have mysql client tools installed in HN, you will need to modify the mysql commands to be prefixed with
vzctl exec VEID mysql ...

Anyway the backup script will run in HN and not in VE
Previous Topic: HELP! can not find "which" command in VPS
Next Topic: VZMIGRATE not work ssh <> 22
Goto Forum:
  


Current Time: Sun Jul 14 21:14:09 GMT 2024

Total time taken to generate the page: 0.02367 seconds