Help with zone in "mounted" state

Greetings Forumers!

I have a zone in a "mounted state and cannot do anything with it:

# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   4 zone1            running    /ZONES/zone1                   native   shared
   7 zone2            running    /ZONES/zone2                 native   shared
   8 zone3            running    /ZONES/zone3                 native   shared
  86 zone4            mounted    /ZONES/zone4                native   shared

When I try to uninstall the zone I get this error message:

# zoneadm -z zone4 uninstall
zoneadm: zone 'zone4': uninstall operation is invalid for mounted zones.

I am running Solaris 10u9 on M5000. All filesystems are ZFS.

Thanks In Advance!

Try:

zonecfg -z zone4 delete

I already tried that (even with "-F"). Here the error message I got:

Zone state is invalid for the requested operation

can you "detach" the zone?

# zoneadm -z <zonename> detach
zoneadm -z <zonename> unmount

It's undocumented, but neither is the mounted state which should be transcient only. Probably a system task was interrupted for some reason.

1 Like

System_Administration_Guide_Solaris_Containers-Resource_Management_and_Solaris_Zones.pdf

That worked! The zone was in the "installed" state when I listed it again. Then I ran "zoneadm -z <zonename> uninstall" which deleted the zone.

Thanks!!

Even though zoneadm makes sure that there are no processes
executing in the zone, the unmount operation can fail if processes in the global zone have open
files in the zone. Use the tools described in the proc(1) (see pfiles) and fuser(1M) man pages
to find these processes and take appropriate action. After these processes have been dealt with,
reinvoking zoneadm halt should completely halt of the zone.
(page 410 of the previous pdf link provided)

@ctsgnb: as I already wrote, this command is not documented so pointing to the docs won't help.
Here is where it is "undocumented":
Cross Reference: /onnv/onnv-gate/usr/src/cmd/zoneadm/zoneadm.c

edit: sorry we cross-posted. The troubleshouting chapter you point to is still relevant in the documented case.

@jilliagre ,

I didn't contradict you dude.

I apologize if you felt offended

I just posted that link because i thought that document was an accurate ressource to have for zone management problems in general.

I have also found that it could give some alternate ideas about what could be tried.(halting,shutdown the zone)

I am not a solaris admin but with a quick look at it i have found interesting information (just like the one of my previous post) that - i have tought - could also interest other people so i just shared.

No offense, no problem :wink:
That recent and extensive documentation is definitely worth reading indeed.

Thanks for the help just the same. :rolleyes: