|
Re: yum.repo per VE [message #21735 is a reply to message #21728] |
Mon, 15 October 2007 14:45 |
maratrus
Messages: 1495 Registered: August 2007 Location: Moscow
|
Senior Member |
|
|
Hi,
vzyum is a yum wrapper and it's main benefit that you can share yum cache between VPSes. If you want to install the same packet on 2 VPSes you don't have to download it 2 times, because vzyum uses the common cache. So it uses the same conf files for all VPSes.
You can install yum on VPS(1003), make into VPs your own repo file and use yum inside VPS.
[Updated on: Mon, 15 October 2007 14:48] Report message to a moderator
|
|
|
|
|
Re: yum.repo per VE [message #21918 is a reply to message #21736] |
Wed, 17 October 2007 22:02 |
|
dowdle
Messages: 261 Registered: December 2005 Location: Bozeman, Montana
|
Senior Member |
|
|
ntenev wrote on Mon, 15 October 2007 09:07 |
1) yum (inside VE) detect all packages, including that are installed on HN and upgrade them all (locally for VE). It's not big problem, VE still works fine, but I search a little more "clean" solution.
|
What? If your VPS needs updates, you should do them... rather than just using yum to install new packges only. You do have the overhead of having yum, it's deps, and the database it maintains... but if you do a "yum clean all" after you do package installs, it frees up a bit of disk space.
Quote: |
2) vzyum is perfect "central" solution. If I install yum inside VE then it will be "second tool for separate case" wich is something that I wish to not use at this time.
|
An ugly way to achieve this, I think... would be to make a separate yum config for each scenerio... put it where it needs to go and then tack on .scenerioname to the end of it... which scenerioname being some arbitrary word that helps you identify which file is for which usage case. When working in scenerio one, copy the whatever.repo.scenerio1 to whatever.repo and do your work. So basically you are have one config file that applies to all of them but you keep change it depending on which VPS you are working with at the time.
--
TYL, Scott Dowdle
Belgrade, Montana, USA
|
|
|
Re: yum.repo per VE [message #23704 is a reply to message #21728] |
Thu, 22 November 2007 23:25 |
Sambo
Messages: 2 Registered: November 2007
|
Junior Member |
|
|
Hi.. this is the way I achieved this.. for better or worse:
Firstly, I copied the yum.conf file from /vz/templates/centos/4/i386/conf/ into the /etc directory of the VE itself and call it vzyum.conf (e.g: /vz/private/211/etc/vzyum.conf )
Then I made a small change to the yum_conf() function in /usr/share/vzpkg/functions script, as follows:
# Returns -c parameters needed for yum.
function yum_conf()
{
local tdir=$1
local template=$TEMPLATE
if test -z "$template"; then
template=`get_vz_var TEMPLATE`
fi
local cfg=$tdir/config/yum.conf
local spcfg=$VE_ROOT/etc/vzyum.conf ## PER-VE conf file
# FIXME: check for osset-specific yum.conf
test -f $cfg || abort "yum repository config file " \
"($cfg) not found!"
## USE Per-VE conf file if exists
#echo "-c $cfg"
if [ -f $spcfg ]; then
echo "-c $spcfg"
else
echo "-c $cfg"
fi
}
It was just a quick hack.. could probably be cleaned up (eg the file existence test logic).
The downside is that it means a process on the hardware node itself is accessing a file inside the VE, which I'm not sure is a good idea.
The upside is that migrating the VE from one node to another doesn't affect it, as the vzyum.conf file travels with it.
This means that each VE can have it's own specific set of repositories (rpmforge, etc) and updates can be managed from the hardware node taking advantage of caching, etc. A script to mass-update all VE's becomes trivial.
The only thing to watch is that an update doesn't overwrite the functions file, which could inadvertantly down-grade packages on the VE. It would be better if a permenant solution was put in place.
cheers
sam
[Updated on: Thu, 22 November 2007 23:36] Report message to a moderator
|
|
|