You’ve been monkeying around with Solaris zones, and now you want to blow away your screwed up test zone, here’s how you do it.
To completely delete/remove a Solaris zone you essentially have 4 step process.
- Shutdown the zone
- Halt the zone
- Uninstall the zone
- Delete the zone configuration files
Here’s how, we are removing sol2
Find what is what
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
69 sol1 running /zones/sol1/root native shared
72 sol2 running /zones/sol2/root native shared
Log into the zone and shut it down
Now halt it
bash-3.00# zoneadm -z sol2 halt
Check its status
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
69 sol1 running /zones/sol1/root native shared
- sol2 installed /zones/sol2/root native shared
Now uninstall it
bash-3.00# zoneadm -z sol2 uninstall
Are you sure you want to uninstall zone sol2 (y/[n])? y
And finally delete the zone configuration
bash-3.00# zonecfg -z sol2 delete
Are you sure you want to delete zone sol2 (y/[n])? y
