Showing posts with label Solaris zone. Show all posts
Showing posts with label Solaris zone. Show all posts

Tuesday 18 July 2017

How to use zoneadm command in Solaris Servers

Please find the "zoneadm" commands with an example as describe below.
 
How to Verify a Solaris zone:

To verify the local solaris zone you need to run the below command with syntax.

!-[solaris]#zoneadm -z <zone> verify

Example: !-[solaris]#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.

How to Installing a Solaris zone:

To install the local Solaris zone you need to run the below command with syntax.

!-[solaris]#zoneadm -z <zone> install

Example: !-[solaris]#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.

How to Ready a Solaris zone:

To move the local zone in ready or maintainance state you need to run the below command.

!-[solaris]#zoneadm -z <zone> ready

Example: !-[solaris]#zoneadm -z sunz01 ready

In this example, when we run the above command then your local zone moved in to ready or maintianance state.

How to Boot a Solaris zone:

To boot the solaris zone on global system, you need to run the below command with syantx.

!-[solaris]#zoneadm -z <zone> boot

Example: !-[solaris]#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.

How to Reboot a Solaris zone:

To reboot or restart the solaris zone on Solaris server, you need to perform the below command on global zone.

!-[solaris]#zoneadm -z <zone> reboot

Example: !-[solaris]#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.

➤ How to 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.

!-[solaris]#zoneadm -z <zone> halt

Example: !-[solaris]#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.

How to Uninstall a Solaris zone:

If you want to uninstall any solaris zone then you need to run the below command for uninstall the zone.

!-[solaris]#zoneadm -z <zone> uninstall -F

Example: !-[solaris]#zoneadm -z sunz01 uninstall -F

"-F" syntax is used to uninstall the zone forcefully.

How to Viewing a Solaris zone:

if you want to local zone current status and any other display information you need to run the below command.

!-[solaris]#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

NFS mount on Solaris 11 Non-Global zones systems

In this article, we would learn how we mount folder from one Non-Global zone to another zone on Solaris 11 operating system using network file sharing.

For an example, we can use take a two local zone "sunz01" & "sunz02". We will mount one folder named "/export/backup" from "sunz01" local zone to another zone "sunz02" on "/project/export/data" location.

Step by Step method of NFS mount on Solaris 11:
 
➦ In the first step we will create the directory on "sunz02" zone where we want to mount the folder.

sunz02#mkdir /project/export/data
 
➦ In second step, we will make a configuration for this process. So for this work you need to login on global zone with root access and make an entry on the dfstb configuration file.

sun#vi /etc/dfs/dfstab

share -F nfs -o rw=sunz02 /zones/sunz01/root/export

If you see the above entry, we have provided the read/write access to directory on sunz02 server where we mount the folder from sunz01 local zone.
 
➦ In next step you need to login on sunz02 server and mount the shared folder using below command.

sunz02#mount sun:/zones/sunz01/root/export/backup /project/export/data
 
➦ Once you run the above command the folder is mount from one local zone to another zone temporarily. You can go to the directory and verify that the data which is listed on /export/backup folder is show on sunz02 directory.
 
➦ In the last step you need to restart the NFS service on the global zone so the configuration files and other changes makes affect. But these configuration are available until we are not taking reboot of the zone.

If you have any query regarding this topic, please post your comment here, we will get back to you shortly.

Tuesday 11 July 2017

How to Remove or Delete a Non-Global Zone from Solaris Operating system

As you aware that Non-Global zone are hosted on Global zone on Solaris Operating system. You can check the Non-Global zone list using "zoneadm" command. It will show you are running and installed zones on Global zones.
 
Please find the below step by step method to remove of local zone from global zone.

Step by Step Method of removal a Non-Global Zone:

First of all you need to check the Non-Global Zone list to ensure which zone is running on the server.

global# zoneadm list -iv

You will see a display that is similar to the following:

ID  NAME     STATUS       PATH                           BRAND      IP
 0    global       running         /                                   solaris    shared
 1    sunz01       running         /zones/sunz01                solaris    shared
In the above command output you can see the Non-Global Zone "sunz01" is running, which we need to remove or delete from Solaris Server.

Now, we need to shutdown the required zone which we need to delete. We can shutdown the Non-Global zone using below commands.
--------------------------------------------
global#zoneadm -z sunz01 halt
or
global#zoneadm -z sunz01 shutdown
or
global#zlogin sunz01 shutdown
-------------------------------------------
In next step when your Non-Global zone shutdown you need to uninstall the local zone. You can used the below method to uninstall the Non-Global Zone.

global#zoneadm -z sunz01 uninstall

Using above command Non-Global zone "sunz01" has been uninstall successfully.

In the last step you need to remove or delete all dataset and configuration files of Non-Global zone "sunz01" from Global zone.

global#zonecfg -z sunz01 delete

Using above command all the configuration files related to this Non-Global zone has been deleted successfully. Now you can remove the folder related to this zone.

So using above method we can remove or delete the Non-Global zone from global zone or Solaris Operating system. Please let me know if you are facing any issue during using this process.