How to remove a zone

In five steps you can remove a zone
# zoneadm list -iv
# zoneadm -z zone1 halt
# zoneadm -z zone1 uninstall
# zonecfg -z zone1 delete
# zonecfg -z zone1 info

In detail:
Steps to remove a zone
Check out how many zones are installed and select the zone which you want to remove

#zoneadm list -iv
ID NAME STATUS PATH
0 global running /
5 zone1 running /export/zone1
6 zone2 running /export/zone2

If the zone is running, you must halt the zone before continuing.
# zoneadm -z zone halt

The above command halt the zone but it is still exists into global zone. It is in install state
Now the zone will note be running, but in the installed state.
#zoneadm list -iv
ID NAME STATUS PATH
0 global running /
- zone1 installed /export/zone1 <- no zone no here means zone is not in running state
6 zone2 running /export/zone2

Now zone can be uninstalled

# zoneadm -zone zone1 uninstall
Are you sure want to uninstall zone zone1 (y/[n])? y
Please check whether zone is uninstalled or not.

# zonecfg list -iv
D NAME STATUS PATH
0 global running /
6 zone2 running /export/zone2

The zone (zone1) is no longer installed, the zone configuration data still exists and needs to be delted to fully complete the zone removal.

# zonecfg -z zone1 delete
Are you sure you want to delete zone zone1 : y

# zonecfg -z zone1 info
zone1: No such zone configured.

Comments

Popular Posts