When you are working on the Solaris operating system then you must aware about this command "zoneadm" which is basic command in Solaris operating system. In this post I would like to explain you how to use the zoneadm command in Solaris servers.
"zoneadm" command are used for verification, installation, boot or viewing of the local zones which are created on the Solaris Server. Please find the below syntax with an example.
1. Verify a Solaris zone:
To verify the local solaris zone you need to run the below command with syntax.
[sun]#zoneadm -z <zone> verify
Example: [sun]#zoneadm -z sunz01 verify
In this example once you run the above command, if your zone is installed properly without any error then this is not showing you any output, that's means it is verified. After running the command if it is showing a message then you need to check the configuration of this zone.
2. Installing a Solaris zone:
To install the local Solaris zone you need to run the below command with syntax.
[sun]#zoneadm -z <zone> install
Example: [sun]#zoneadm -z sunz01 install
In this example when you run the above command then your local zone has been started for installation. It is installed the local zone using the Solaris repostiory or flar images which you are kept at server location.
3. Ready a Solaris zone:
To move the local zone in ready or maintainance state you need to run the below command.
[sun]#zoneadm -z <zone> ready
Example: [sun]#zoneadm -z sunz01 ready
In this example, when we run the above command then your local zone moved in to ready or maintianance state.
4. Boot a Solaris zone:
To boot the solaris zone on global system, you need to run the below command with syantx.
[sun]#zoneadm -z <zone> boot
Example: [sun]#zoneadm -z sunz01 boot
After running the above command your local solaris zone has been boot successfully if it is not showing any error during boot time. If you see any message during the boot time then please check where is the issue.
5. Reboot a Solaris zone:
To reboot or restart the solaris zone on Solaris server, you need to perform the below command on global zone.
[sun]#zoneadm -z <zone> reboot
Example: [sun]#zoneadm -z sunz01 reboot
Using this command the local zone "sunz01" has been restart again successfully. You need to run this command from global zone only.
6. Shutdown/Halt a Solaris zone:
If you want to shutdown or halt your local zone without login it, then you need to run the below command from global zone.
[sun]#zoneadm -z <zone> halt
Example: [sun]#zoneadm -z sunz01 halt
After running this command local solaris zone state change from running to installed state that's means your server is shutdown now.
7. Uninstall a Solaris zone:
If you want to uninstall any solaris zone then you need to run the below command for uninstall the zone.
[sun]#zoneadm -z <zone> uninstall -F
Example: [sun]#zoneadm -z sunz01 uninstall -F
"-F" syntax is used to uninstall the zone forcefully.
8. Viewing a Solaris zone:
if you want to local zone current status and any other display information you need to run the below command.
[sun]#zoneadm list -icv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
1 sunz01 running /zones/sunz01 solaris excl
2 sunz02 running /zones/sunz02 solaris excl
Using above command you can check the current status of all installed zones on Solaris server. It is show you the zone path and zone information. All the above command you need to run from Global zone with root privileges.