util-vserver:Vhashify

From Linux-VServer

Revision as of 01:59, 6 February 2007 by Pflanze (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

All about vunify / vhashify

Some collected wisdom about the vunify/vhashify functionality:

  • "unification" is the process of replacing files with hardlinks to identical files in other vservers (or, in the case of vhashify, more precisely to a common base); for security, the files are then supplied with immutable-but-unlinkable flags (a vserver speciality), and recently COW link capability has been added to vserver (2.2+), which means that when such a file is being modified, the hardlink is automatically dissolved and the contents copied (CONFIG_VSERVER_COWBL).
  • vhashify is the successor to vunify; vunify only looks at files at identical relative paths and links them if they are identical; vhashify builds hash values over the contents of all (non-excluded) files and links them into a common base directory, or unifies them with pre-existing links there. So running hashification on multiple vservers will effectively hard link their identical files.
  • You don't call the vhashify tool directly (which lives in lib/util-vserver/), but let the "vserver" multipurpose script do the work:
vserver <vserver-name> hashify
  • The guest needs to be running for the above because vhashify may try to figure out what files not to hashify by calling the package manager of the guest via vserver enter; the reason for this is that it tries not to unify config files because they couldn't be written to afterwards unless COW links are supported (which is a recent addition), which may be a hassle unlike with program/library files which are replaced on upgrades. The details of how the list of config files is retrieved can be found in scripts/vpkg, which is called by the vhashify program (through MatchList_initManually). Currently this means redhat|mandrake and debian are supported. It is looking at a XXX/style file (what's XXX?) for finding out which distribution a guest is running (can this be a problem?) -> open questions to be looked at.
  • If one configures exclude lists, vhashify is supposed not to use package management for getting the config file list (daniel_hozac says: "that's the idea, i haven't verified it though").


See also:

Personal tools