[OmniOS-discuss] Zones Backup

Michael Mounteney gate03 at landcroft.co.uk
Sun Feb 14 05:37:48 UTC 2016


On Sat, 13 Feb 2016 19:51:32 -0600 (CST)
Bob Friesenhahn <bfriesen at simple.dallas.tx.us> wrote:

> Does anyone have an effective zone backup method they can share which 
> strips out all the cruft and retains only key files such as 
> configuration files?

I'll put this on the table in case it fits:  I have a master
installation script which starts with a fresh installation and performs
all my customisation including installing and configuring zones.  I
don't back up the zones themselves;  just the reconfiguration
information.

It's almost automatic;  the only part that requires manual intervention
is running 'passwd' within a zone, since that requires console access
and won't accept redirected input from a file.  In due course I'll go
to LDAP and that problem with disappear.

In practice I don't have the nerve to run the entire script from start
to finish but tend to chop it up and run bits;  nevertheless it is
complete.

I use type=zfs for mounting zone data like /var/postgres and Dovecot's
IMAP store.  Each of those data-sets have set mountpoint=legacy and
cannot be viewed in the global zone.  They are 'important' of course,
and backed-up.

The long-running part of my script is a loop which starts:

# for ZONE in person diener KVM DHCP ; do ...

which creates and installs the zones.

To run a configuration script in a zone:

# cp -pr /support/omnios/zone/somezone/setupaservice /zone/somezone/root/tmp/
# zlogin somezone /tmp/setupaservice
# rm /zone/somezone/root/tmp/

and pkg -R to install packages into zones.

This does require the discipline to record your changes in your setup
script, but the benefit is that your zones are entirely recreatable and
don't have to be backed-up.

It seems long-winded but I reckon it's a lot quicker and tidier to apply
a customisation script to a fresh installation than it is to splice-in
stuff from /etc etc. from a back-up.

If you go for this, you will probably have to set up a parallel set of
zones as you develop your customisation script, to compare new with old
until your script is complete.

The above serves to preserve state for a planned upgrade as well.  The
only 'extras' FOR ME in that case are:

# pg_dumpall to prepare for a Postgres upgrade.
# slapcat to prepare for an OpenLDAP upgrade.

Hopefully the above gives you enough information to do it for yourself.

______________
Michael Mounteney


More information about the OmniOS-discuss mailing list