How to Rename a Solaris Zone?

STEP 1: Shutdown the zone “orazone”

Issue the following commands from the globalzone to shutdown orazone.

globalzone# zoneadm list -iv
ID NAME STATUS PATH
0 global running /
2 orazone running /zones/orazone
globalzone# zoneadm -z orazone halt
globalzone# zoneadm list -iv
ID NAME STATUS PATH
0 global running /
– orazone installed /zones/orazone
globalzone#

STEP 2: Rename the Zone from “orazone” to “oraprodzone”

Enter zone configuration from the global zone using the below mentioned commands.

globalzone# zonecfg -z orazone
zonecfg:orazone> set zonename=oraprodzone
zonecfg:orazone> commit
zonecfg:orazone> exit

globalzone# zoneadm list -vc
ID NAME STATUS PATH BRAND
0 global running / native
– oraprodzone installed /zones/orazone native

STEP 3: Boot the zone

After you have made the above changes, boot the zone from the global zone using the below commands.

globalzone# zoneadm -z oraprodzone boot
globalzone# zoneadm list -iv
ID NAME STATUS PATH
0 global running /
2 orazone running /zones/orazone

Done!

There is another way to rename a zone (not supported, but it worked for me), but then that’s not the right one though. However, i would mention that as well.

Renaming zone orazone to oraprodzone

Perform all of the below as root of global zone.
First shutdown your orazone zone

globalzone# zoneadm -z orazone halt
globalzone# vi /etc/zones/index

change orazone to oraprodzone

globalzone# cd /etc/zones
globalzone# mv orazone.xml oraprodzone.xml
globalzone# vi oraprodzone.xml

change orazone to oraprodzone

globalzone# cd /zones
-/zones is where I have stored all the zones

globalzone# mv orazone oraprodzone

-cd to your new zone (/zones/oraprodzone)and modify /etc/hosts, /etc/nodename, /etc/hostname.xxx

globalzone# cd /zones/oraprodzone/root/etc

-boot new renaming zone
globalzone# zoneadm -z oraprodzone boot

 

source: http:// solarisguru.getquickstart.com

Tags: , , , , , , ,