Best practice to update jails

Andrew Hotlab andrew.hotlab at hotmail.com
Fri Aug 21 17:59:11 UTC 2009


> Date: Thu, 20 Aug 2009 23:28:39 +0200
> From: reddvinylene at gmail.com
> To: jose.amengual at gmail.com; freebsd-jail at freebsd.org; freebsd-virtualization at freebsd.org
> CC:
> Subject: Re: Best practice to update jails
>
> On Thu, Aug 20, 2009 at 10:57 PM, Jose Amengual wrote:
>
>> any reason of why you do not use freebsd-update ?
>>
>> Thanks.
>
>
> I think most people prefer to build from source. I do, at least.
>

We manage some jail host system both for production and development (since 6.2-RELEASE), and we found the best support in the "build-from-source" upgrade method.

Here the main steps we follow for a release-step upgrade (since we have a few hosts to manage, we are using a dedicated build server, but the first three steps might be executed on the host machine itself):

1.  sync sources from a local cvsup-mirror to the build host;
2.  make binaries on the build host (once per architecture we are supporting);
3.  mount /usr/src and /usr/obj via NFS on all systems to be upgraded;
4.  run mergemaster in pre-buildworld mode (once for the host and once for each jail with the -D flag);
5.  install the new kernel on the host we are upgrading;
6.  reboot the host with the new kernel in single user mode;
7.  install the new userland for the host and for the basejail (we are using the ezjail framework);
8.  run mergemaster on the host to align its configuration files to the new release;
9.  boot into multi user mode;
10. run mergemaster with the -D flag to update each jail’s configuration files;
11. run "make delete-old" and "make delete-old-libs" on both host and jail systems (using the DESTDIR variable).


In our environment, this type of upgrade process has proved to be the most effective and reliable, both for tracking the errata branch and for upgrading between minor and major releases. Obviously it needs you quite knowledgeable about the build(7) process, but IMO time spent studying is always time spent well! :)


Andrew


_________________________________________________________________
With Windows Live, you can organize, edit, and share your photos.
http://www.microsoft.com/middleeast/windows/windowslive/products/photo-gallery-edit.aspx


More information about the freebsd-virtualization mailing list