[OpenIndiana-discuss] Copying zone from one machine to another.

Andrej Javoršek drejc at ntf.uni-lj.si
Wed Mar 13 07:50:50 UTC 2013


Hello!
My normal procedure includes recursive snapshot/send/receive of whole zone
dataset. Problems may arise if the zone is not installed from scratch but
cloned instead or if there are some time-slider snapshots behind it.
To get back to your question:  zone (zfs) dataset needs zoned flag and flag
that marks corresponding boot environment of global zone eg.

#zfs get zoned,org.opensolaris.libbe:parentbe nag_log/zones/na_lg/ROOT/zbe-7
NAME                            PROPERTY                        VALUE
                          SOURCE
nag_log/zones/na_lg/ROOT/zbe-7  zoned                           on
                           inherited from nag_log/zones/na_lg/ROOT
nag_log/zones/na_lg/ROOT/zbe-7  org.opensolaris.libbe:parentbe
 f2a01237-bbe0-486e-ea0a-976d794761e0  local

while the global zone has:
#zfs get org.opensolaris.libbe:uuid rpool/ROOT/opensolaris-15
NAME                       PROPERTY                    VALUE
                  SOURCE
rpool/ROOT/opensolaris-15  org.opensolaris.libbe:uuid
 f2a01237-bbe0-486e-ea0a-976d794761e0  local

So in your case you must set them manually (for every local zone).
Hope that helps
Andrej


On Tue, Mar 12, 2013 at 11:25 PM, DormitionSkete at hotmail.com <
dormitionskete at hotmail.com> wrote:

> What is the proper procedure for copying a zone from one machine to
> another?
>
> I have several zones that I've set up on one machine.  I'd like to copy
> them to another machine, change the networking, and use them.
>
> So, I took one of these zones.  I halted it, detached it, tar'ed it up,
> and copied it to the other machine.
>
> I realize I could probably have used "zfs send" to do that, but I figured
> that I probably would have to have somehow mounted the dataset on the
> target machine, or exported it somehow, and I didn't know how to do any of
> that.  I'd like to know, though, but that's not the main question.
>
> So, I have this tar'd up zone on the target machine.  I've untared it.  I
> thought that, theoretically, I should be able to attach the zone, and then
> clone it so cloning process will set it in a state that I can zonecfg to
> change the network card (set physical=newcard.vnic), and when I boot it,
> that it will make me reconfigure the networking.
>
> I'm running into a problem attaching the zone, though.
>
> I try (fake names because I'm writing this from a different machine):
>
> zonecfg - myzone
> create -a /zones/myzone
> info                                   -- shows everything fine.
> exit
>
>
> zoneadm -z myzone attach     -- fails, saying it has to be a mounted
> dataset.  No matter what I try, I can't get it to attach.
>
>
> I was halfway thinking of just creating a zone with the same name,
> installing it, booting it, configuring it, halting it, and then copying the
> original zone on top of it, and seeing if that would allow me to clone it
> -- but I'd really like to know the *right* way to do this.
>
> If somebody would give me another hand with this, I'd really appreciate
> it.  I'm so close to being able to bring this whole project to a close...
>  But this would really be quite helpful.
>
>
>
>
>
> _______________________________________________
> OpenIndiana-discuss mailing list
> OpenIndiana-discuss at openindiana.org
> http://openindiana.org/mailman/listinfo/openindiana-discuss
>


More information about the OpenIndiana-discuss mailing list