Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: August 2019
 
 

Uninstalling and Deleting a Non-Global Zone

Both uninstalling a zone and deleting a non-global zone destroy the zone. If uninstalling is interrupted, you might be able to reconstruct the zone.

How to Uninstall and Remove a Zone

This procedure combines three separate but dependent operations: shutting down a zone, uninstalling the zone, and deleting the zone.


Caution

Caution  - 

  • Removing all files in the zone's root file system is irreversible.
  • When you uninstall a zone that has its own ZFS file system for the zonepath, the ZFS file system is destroyed.


Before You Begin

Ensure that all users are logged out of the zone.

  1. Become a zone administrator.

    For more information, see Using Rights Profiles to Install and Manage Zones.

  2. Verify that the zone is not in the running state.
    global$ zoneadm list -cv
  3. If the zone is running, shut down the zone.
    • To shut down the zone immediately:
      global$ zoneadm -z zonename shutdown
    • To specify shutdown options:
      global$ zlogin zonename shutdown [shutdown-options]

      For example, to specify a 10 second wait period before shutting down:

      global$ zlogin zonename shutdown -g 10
  4. Verify that the zone is completely shut down.
    global$ zoneadm list -cv

    The zone to be deleted should have an installed status in the output.

  5. Uninstall the zone.
    global$ zoneadm -z zonename uninstall
  6. Verify that the zone has been uninstalled.
    global$ zoneadm list -cv

    The zone to be deleted should have a configured status in the output.

  7. To completely remove the zone from the host, delete the zone.
    global$ zonecfg -z zonename delete [-F]

    Use the –F option if you need to force the action. If you use this option, the command proceeds without issuing a confirmation request.

  8. Verify that the deleted zone is no longer listed.
    global$ zoneadm list -cv

    Only the global zone should be listed in the output.