Hi, is it possible in openvz to share a tmpfs volume created on host between VEs ? TIA.
You can use bind mounts i.e. # mount --bind PATH_TO_DIRECTORY_ON_THE_HN /vz/root/$VEID/PATH_INSIDE_VE
I did that but it doesn't work at all, althought is seems to be well mounted if I write on that dir inside the VE it can't be read on HN. If I umount it then the file is there, so in reality the VE was writing to harddisk, no to tempfs. Did you tried this ?
Hi, could you provide all steps that were done (from mounting tmpfs on the HN) so that it is possible to reproduce your problem?
I'm running these commands on HN: mount -t tmpfs -o nodev,noexec,nosuid -osize=1024M tmpfs /test/ mount --bind /test/ /var/lib/vz/private/100/test/ Them, if i access VE and create a file at /test/, i won't be able to see it on HN. Example: # vzctl enter 100 entered into CT 100 [root@mta /]# cd /test/ [root@mta test]# touch test [root@mta test]# ls -lh total 0 -rw-r--r-- 1 root root 0 May 31 19:00 test [root@mta test]# exit logout [root@vz test]# cd /test/ [root@vz test]# ls -lh total 0
Dear Consultorpc, please feel a difference between the command I have suggested you issuing and the command you have issued. I suggested you that you should do bind mount to /vz/root directory not /vz/private!
Sorry, I posted private but our first tests were done using root. We do use it only for test purposes, but the same result.
I figure since I read this I'd say simply that it works. A simple tmpfs creation of /test and a bind mounting to the vz/root/VEID/test (made by hand before) will do it.