Subject: Re: [vserver] Unification Questions
From: "Roderick A. Anderson" <raanders@acm.org>
Date: Tue, 26 Aug 2008 11:09:09 -0700

John Alberts wrote:
> Thanks.  That clears things up quite a bit for the most part.
> One thing about setting up a new guest os though.
> The process would be to just create a new guest with a tarball or 
> whatever.  This would create a typical guest os that would consume the 
> typical amount of disk space that I would expect.  Then create the 
> /etc/vservers/$GUEST/apps/vunify directory.  Then I start the guest os 
> and some magic unification stuff will happen.  This will reduce the 
> overall disk footprint of the new running guest.
>  From that point, I can use and/or customize the scripts you supplied to 
> help manage the upgrade process.
> 
> Obviously, the part that I'm still not clear about is what happens 
> during the part that I said "some magic unification stuff will happen". ;)

Sorry I skipped that part.  After you have your guest 
created/configured/running you need to run the command:

	vserver $GUEST hashify

The only time you'll see a saving in disk space is if you have two or 
more guests unified/hashified.

Plus if I understand the process correctly you will get a better 
utilization of memory also.  I understand the principal but can't 
articulate it without sounding the fool.  I believe the closest would be 
the setting the sticky bit on an executable.

Here is a link (which you may already have found) that explains it 
better than I can.

	http://linux-vserver.org/Frequently_Asked_Questions#Unification


> Also, I have some RHEL5 guests on a RHEL5 hosts, but I also have quite a 
> few Gentoo guests on a Gentoo host.  I think I remember reading or 
> hearing somewhere that unification doesn't work at all for Gentoo.  Can 
> someone confirm this?

After re-reading it I think vhashify (verses vunify) should work with 
gentoo.


Rod
-- 

> Thanks again for your input.
> John
> 
> 
> 
> On Tue, Aug 26, 2008 at 12:05 PM, Roderick A. Anderson <raanders@acm.org 
> <mailto:raanders@acm.org>> wrote:
> 
>     John Alberts wrote:
> 
>         Unification was just brought up on another recent thread and I
>         have some questions about it that google doesn't seem to be
>         finding the answers for me.
> 
>         Is there any good documentation for using unification?  The
>         linux-vserver site mentions it briefly in the FAQ section, but
>         that's all I could really find.
> 
> 
>     John I think I can help with a couple of these.
> 
> 
>         Specifically, I'm looking for:
>         1.  What I would do to initially implement unification on a host
>         with multiple guests currently running?
> 
> 
>     mkdir /etc/vservers/$GUEST/apps/vunify
> 
> 
>         2.  Is there anything special when creating a new guest that I
>         would like to use unification?
> 
> 
>     mkdir /etc/vservers/$GUEST/apps/vunify
> 
> 
>         3.  What is the process for upgrading the guests?  Can they
>         somehow be upgraded on one guest os and have the other guests
>         link to those new files?
> 
> 
>     I don't think.
> 
>     I use these scripts:
> 
>     vhashify.sh
>     #!/bin/bash
> 
>     echo Beginning guest unification
> 
>     for g in \
>       $(find /etc/vservers/*/* -name vunify | sort | cut -d '/' -f 4 ) ; \
>          do \
>             echo -e "\tHashifying $g" ; \
>             vserver $g hashify ; \
>          done
> 
>     echo Begin cleanup
> 
>     find /vservers/.hash -type f -links 1 -print0 | xargs -0 /bin/rm
> 
>     echo guest unification Complete
> 
>     Before I run the above script I run the following one.  I do use
>     CentOS so it uses yum/vyum.  If you're using a different
>     distribution or multiple distributions with different package
>     management methods you'll have to pound this into a different shape.
> 
>     vupdate.sh
>     #!/bin/bash
> 
>     updateGuest() {
> 
>       if [ -e /etc/vservers/$g/apps/pkgmgmt/internal ]; then
>          echo using internal yum
>          vserver $g exec yum -y update
>       else
>          echo using external vyum
>          vyum $g -- -y update
>       fi
> 
>     }
> 
>     echo Beginning guests update
> 
>     for g in \
>       $(find /etc/vservers/*/* -name vunify | sort | cut -d '/' -f 4 ) ; \
>          do \
>             echo -en "\tUpdating $g" ; \
>             updateGuest ; \
>          done
> 
>     echo guest updates Complete
> 
>     There is a vupdateworld script but I've never taken the time to see
>     if it does what I want it to.  Mine looks to see if package
>     management is internalized.
> 
> 
>         4.  Are there any gotchas to look out for when using
>         unification?  Special things that need to be done when adding or
>         removing applications or files from a single guest os that is
>         using unification for instance?
> 
> 
>     My understanding is if you're not using a RPM based distribution you
>     may have to do a bit more preparation so the unification doesn't
>     unify files it shouldn't.
> 
> 
>     Good Computing,
>     Rod
>     -- 
> 
> 
>         Thanks
>         John Alberts
> 
> 
>         -- 
>         John Alberts
> 
> 
> 
> 
> 
> -- 
> John Alberts
>