[OmniOS-discuss] ZBEs when moving zones

Ben Summers ben at fluffy.co.uk
Sun Oct 13 08:45:16 UTC 2013


To answer my own question: When zoneadm attach is run for ipkg zones, /usr/lib/brand/ipkg/attach :

 * Determines which ZBE is the root by seeing which fs is mounted at the right point:

        # Since we're using a pre-existing dataset, the dataset currently
        # mounted on the {zonepath}/root becomes the active dataset.  We
        # can't depend on the usual dataset attributes to detect this since
        # the dataset could be a detached zone or one that the user set up by
        # hand and lacking the proper attributes.  However, since the zone is
        # not attached yet, the 'install_media == -' means the dataset must be
        # mounted at this point.

 * Finds the global zone's BE UUID using beadm

 * Sets the org.opensolaris.libbe:parentbe property on the mounted zone root fs to the BE UUID.

This then means that when the server boots, the right fs is mounted.

The other ZBEs will never be used, because the UUIDs won't match the BE's UUID, but then, the previous BEs didn't have that zone.

If I then create a new global BE with beadm, a new ZBE is also created with the expected properties, cloned from the active BE.

So I'm pretty sure this is all correct.

Ben




On 12 Oct 2013, at 20:39, Ben Summers <ben at fluffy.co.uk> wrote:

> 
> Hello,
> 
> I'm writing a script to move zones between OmniOS servers, using snapshots zfs send | recv, so I can transfer it while it's running, then do a final snapshot when it's finally down.
> 
> The problem comes when I come to import it. I get the problem described here:
> 
>  http://everycity.co.uk/alasdair/2010/09/moving-zones-between-servers-on-opensolaris/
> 
> However, I have multiple zbes, and so I have to mount the right one on the destination server. Something like:
> 
>  zonecfg -z app0 -f /zones/app0/zone-config
>  zfs set zoned=off rpool/zones/app0/ROOT 
>  mount -F zfs rpool/zones/app0/ROOT/zbe-2 /zones/app0/root
>  zoneadm -z app0 attach
>  zoneadm -z app0 boot
> 
> And this works. Rebooting gets the right BE. But I have no idea why. The org.opensolaris.libbe:active property is 'on' for every one of those zbe datasets.
> 
> If it's moving between different revisions of OmniOS, it will patch when it's attached. To get all the updates, I do
> 
>  pkg -R /zones/app0/root update
> 
> This doesn't create a new zbe. I'm mildly concerned something won't be quite right in the future, as I can't see why it appears to be doing the right thing.
> 
> Thanks for any advice on how to do this properly!
> 
> Ben
> 
> 
> 
> _______________________________________________
> OmniOS-discuss mailing list
> OmniOS-discuss at lists.omniti.com
> http://lists.omniti.com/mailman/listinfo/omnios-discuss

--
http://bens.me.uk



More information about the OmniOS-discuss mailing list