OpenVZ Forum


Home » General » Support » share tmpfs volume between VEs
share tmpfs volume between VEs [message #39748] Thu, 27 May 2010 21:53 Go to next message
consultorpc is currently offline  consultorpc
Messages: 10
Registered: May 2006
Junior Member
Hi, is it possible in openvz to share a tmpfs volume created on host between VEs ? TIA.
Re: share tmpfs volume between VEs [message #39751 is a reply to message #39748] Fri, 28 May 2010 12:40 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
You can use bind mounts i.e.

# mount --bind PATH_TO_DIRECTORY_ON_THE_HN /vz/root/$VEID/PATH_INSIDE_VE
Re: share tmpfs volume between VEs [message #39757 is a reply to message #39748] Fri, 28 May 2010 21:35 Go to previous messageGo to next message
consultorpc is currently offline  consultorpc
Messages: 10
Registered: May 2006
Junior Member
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 ?
Re: share tmpfs volume between VEs [message #39758 is a reply to message #39757] Sat, 29 May 2010 07:06 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

could you provide all steps that were done
(from mounting tmpfs on the HN) so that it
is possible to reproduce your problem?
Re: share tmpfs volume between VEs [message #39775 is a reply to message #39748] Mon, 31 May 2010 17:03 Go to previous messageGo to next message
consultorpc is currently offline  consultorpc
Messages: 10
Registered: May 2006
Junior Member
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
Re: share tmpfs volume between VEs [message #39793 is a reply to message #39775] Wed, 02 June 2010 13:14 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
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!
Re: share tmpfs volume between VEs [message #39799 is a reply to message #39748] Thu, 03 June 2010 18:42 Go to previous messageGo to next message
consultorpc is currently offline  consultorpc
Messages: 10
Registered: May 2006
Junior Member
Sorry, I posted private but our first tests were done using root. We do use it only for test purposes, but the same result.
Re: share tmpfs volume between VEs [message #39834 is a reply to message #39748] Tue, 08 June 2010 19:08 Go to previous messageGo to next message
consultorpc is currently offline  consultorpc
Messages: 10
Registered: May 2006
Junior Member
Anyone has success with this ?
Re: share tmpfs volume between VEs [message #39836 is a reply to message #39834] Tue, 08 June 2010 22:42 Go to previous message
situationalawareness is currently offline  situationalawareness
Messages: 2
Registered: June 2010
Junior Member
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.
Previous Topic: About Network Configuration
Next Topic: how to install yum on VPS
Goto Forum:
  


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

Total time taken to generate the page: 0.02271 seconds