Is there any way to share a directory of files between virtual machines running in OpenVZ? My particular use case is that I want to have a shared YUM cache directory, for when they all need to run updates, so that each virtual machine doesn't have to separately download the files from the server. This will make it quicker & use less bandwidth. I could set something up with NFS or Samba or any standard network file sharing app, but I was hoping there was something quick and easy I could do since they are all running off the same drive anyway.
Asked
Active
Viewed 998 times
4
-
+1 For my particular use case, always nice when some says what they are actually trying to do :-) – Kyle Brandt Feb 08 '10 at 19:49
3 Answers
3
Figured out that what I want is called 'bind mounts'. There is a page on the OpenVZ wiki that describes them.
![](../../users/profiles/8198.webp)
davr
- 1,729
- 3
- 14
- 24
1
I think OpenVZ is already setup to do what you are describing with vzyum. From man vzyum
:
The main point of using vzyum instead of yum is in this case yum cache is shared between VPSes, so you don't have to download a package update 100 times if you have 100 VPSes based on the same OS template.
![](../../users/profiles/2561.webp)
Kyle Brandt
- 82,107
- 71
- 302
- 444
-
Hmm...unfortunately the stock vzyum does not work on 64-bit hosts (which is what I run). There is a workaround to get it working, but the cost of this is that it will no longer share the cache directory: http://wiki.openvz.org/Install_OpenVZ_on_a_x86_64_system_Centos-Fedora#STEP_3 – davr Feb 08 '10 at 19:59
-
However that page does mention using 'bind mounts', that looks like it might do what I want – davr Feb 08 '10 at 20:00
0
Yum an use a proxy server, man yum.conf
for more, in each of your /etc/yum.repos.d/
configs add proxy=$YOURPROXYSERVER:PORT
to proxy the data through something like squid.
![](../../users/profiles/301.webp)
Dave Cheney
- 18,307
- 7
- 48
- 56