Cloning a non global zone (NGZ)

Moderator: cah

Post Reply
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Cloning a non global zone (NGZ)

Post by cah »

1. Become superuser (root)

2. Create a new zone configuration file

Code: Select all

zonecfg -z appint05 export -f appint06_zone
or copy over existing config and modify it with new hostname and IP address.

3. Halt source zone

Code: Select all

zoneadm -z appint05 halt
4. Create a new zone

Code: Select all

zonecfg -z appint06 -f /zonepool/zone_configs/appint06_zone
5. Installing new zone by cloning from source zone

Code: Select all

zoneadm -z <destination> clone <source>
zoneadm -z appint06 clone appint05
6. Start up source zone

Code: Select all

zoneadm -z appint05 boot
7. Create a sysidcfg file

Code: Select all

system_locale=en_US
terminal=vt100
network_interface=PRIMARY {
        hostname=appint06
}
name_service=DNS {
        domain_name=ols.minimed.com
        name_server=10.0.16.123,10.0.16.130,10.48.32.54
        search=ols.minimed.com,corp.minimed.com,corp.medtronic.com
}
security_policy=NONE
nfs4_domain=dynamic
root_password=2JklIXb7E4dQI
timezone=US/Pacific
8. Copy over to the newly created non global zone

Code: Select all

cp /zonepool/zone_configs/appint06_sysidcfg /zonepool/zones/appint06/root/etc/sysidcfg
9. Start up the new zone

Code: Select all

zoneadm -z appint06 boot
10. Log into new zone's console

Code: Select all

zlogin -C appint06
This should save all the interactive system settings and the new system should come all the way up to login prompt.
CAH, The Great
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Cloning a non global zone (NGZ) - II

Post by cah »

This would be step 6.5 to prevent all manual setup for DNS, timezone, root password and so on.

Create a new sysidcfg file with similar config in it:

Code: Select all

system_locale=en_US
terminal=vt100
network_interface=PRIMARY {
        hostname=appint06
}
name_service=DNS {
        domain_name=ols.minimed.com
        name_server=10.0.16.123,10.0.16.130,10.48.32.54
        search=ols.minimed.com,corp.minimed.com,corp.medtronic.com
}
security_policy=NONE
nfs4_domain=dynamic
root_password=2JklIXb7E4dQI
timezone=US/Pacific
Then, copy this newly created sysidcfg file to /zonepool/zones/appint06/root/etc from global zone.

Code: Select all

cp /zonepool/zone_configs/appint06_sysidcfg /zonepool/zones/apptest03/root/etc/sysidcfg
This should save all the interactive system settings.
CAH, The Great
Post Reply