OpenVZ Forum - RDF feed
type: channel
items: share tmpfs volume between VEs
items: Re: share tmpfs volume between VEs

share tmpfs volume between VEs
type: item
description: Hi, is it possible in openvz to share a tmpfs volume created on host between VEs ? TIA.
creator: consultorpc
date: 2010-05-27T21:53:51-00:00

Re: share tmpfs volume between VEs
type: item
description: You can use bind mounts i.e. # mount --bind PATH_TO_DIRECTORY_ON_THE_HN /vz/root/$VEID/PATH_INSIDE_VE
creator: maratrus
date: 2010-05-28T12:40:50-00:00

Re: share tmpfs volume between VEs
type: item
description: 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 ?
creator: consultorpc
date: 2010-05-28T21:35:15-00:00

Re: share tmpfs volume between VEs
type: item
description: Hi, could you provide all steps that were done (from mounting tmpfs on the HN) so that it is possible to reproduce your problem?
creator: maratrus
date: 2010-05-29T07:06:58-00:00

Re: share tmpfs volume between VEs
type: item
description: 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
creator: consultorpc
date: 2010-05-31T17:03:10-00:00

Re: share tmpfs volume between VEs
type: item
description: 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!
creator: maratrus
date: 2010-06-02T13:14:06-00:00

Re: share tmpfs volume between VEs
type: item
description: Sorry, I posted private but our first tests were done using root. We do use it only for test purposes, but the same result.
creator: consultorpc
date: 2010-06-03T18:42:50-00:00

Re: share tmpfs volume between VEs
type: item
description: Anyone has success with this ?
creator: consultorpc
date: 2010-06-08T19:08:05-00:00

Re: share tmpfs volume between VEs
type: item
description: 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.
creator: situationalawareness
date: 2010-06-08T22:42:08-00:00