Go to main content

Creating and Using Oracle® Solaris Kernel Zones

Exit Print View

Updated: August 2021

Kernel Zone Evacuation Example

This section annotates the evacuation of two kernel zones.

Example 53  Complete Process for Evacuating Kernel Zones
List the zones with verbose output to determine status

root@global:~# zoneadm list -v
ID NAME             STATUS      PATH                       BRAND       IP
 0 global           running     /                          solaris     shared
17 kzone2           running     -                          solaris-kz  excl
18 kzone1           running     -                          solaris-kz  excl
19 my-ngz           running     /system/zones/my-ngz       solaris     excl

Set the evacuation/target SMF property for zones restarter service 
to specify migrated zones' destination and refresh the zones restarter service

root@global:~# svccfg -s system/zones/zone
svc:/system/zones/zone> setprop evacuation/target=ssh://global2
svc:/system/zones/zone> exit 
root@global:~# svcprop -p "evacuation/target" svc:/system/zones/zone  
root@global:~# svcadm refresh svc:/system/zones

Put the system in maintenance mode with a message

root@global:~# sysadm maintain -s -m "Updating to new release"
root@global:~# sysadm maintain -l 
TYPE   USER     DATE               MESSAGE
admin  root     2016-03-16 17:57   Updating to new release

Evacuate the zones with verbose output

root@global :~# sysadm evacuate -v 
sysadm : preparing 3 zone(s) for evacuation ... 
sysadm : initializing migration of kzone1 to global2 ... 
sysadm : initializing migration of kzone2 to global2 ... 
sysadm : evacuating 2 zone(s) ... 
sysadm : migrating kzone1 to global2 ... 
sysadm : migrating kzone2 to global2 ... 
sysadm : evacuation failed . 
sysadm : kzone1: evacuated to ssh://global2 
sysadm : kzone2: evacuated to ssh://global2 
sysadm : my-ngz: evacuation skipped: cannot evacuate solaris-brand zones

List evacuated zones

root@global :~# sysadm evacuate -l 
kzone1   EVACUATED  ssh://global2   - 
kzone2   EVACUATED  ssh://global2   - 
my-ngz   SKIPPED    -              cannot evacuate solaris-brand zones 

root@global :~# zoneadm -z  my-ngz shutdown

 Perform maintenance such as updating the system 

root@global :~# pkg update ... 
root@global :~# reboot ...

End maintenance mode 

root@global :~# sysadm maintain -e

Return evacuated zones

root@global:~# sysadm evacuate -rv 
sysadm:   preparing 2 zone(s) for return...
sysadm:   initializing return of kzone1
sysadm:   initializing return of kzone2
sysadm:   returning 2 zone(s) ...
sysadm:   migrating kzone2
sysadm:   migrating kzone1
sysadm:   return completed successfully.
sysadm:   kzone1: returned
sysadm:   kzone2: returned

Check evacuation status

root@global:~# sysadm evacuate -l 
sysadm:   no active evacuation

Check zone status

root@global:~# zoneadm list -cv
  ID NAME             STATUS      PATH                 BRAND      IP    
   0 global           running     /                    solaris    shared
   3 kzone2           running     -                    solaris-kz excl  
   4 kzone1           running     -                    solaris-kz excl