Skip to main content

Posts

Showing posts with the label Solaris Zones

FOR/WHILE COMMAND how to halt/boot all the containers/zones with a for/while command (Solaris 10/11)

FOR COMMAND HOW TO HALT/BOOT  (Containers/Zones) with a FOR command 1.- List zones / containers in running state in order to check what zones you need  stop/boot after finishing the task that you perform on the global zone # zoneadm list -v ID NAME STATUS PATH 0 global running / 1 zone1 running /zones/zone1 2 zone2 running /zones/zone2 3 zone3 running /zones/zone3 6 zone4 running /zones/zone4 7 zone5 running /zones/zone5 8 zone6 running /zones/zone6 9 zone12 running /zones/zone12 12 zone15 running /zones/zone15 14 zone16 running /zones/zone16 19 zone17 running /zones/zone17 2.- Send the zones list to a file only with the NAME of the zones to zones.txt file #zoneadm list -v | awk '{print $2}' | egrep -v global >> zones.txt 3.- List the information capture in order to verify zones.txt # cat zones.txt 4.- Halt Zones with a for command # for i in `cat zones.txt`; do zoneadm -z $i halt; done   5.- Boot Zones with a for command   # for i in

How to install nagios client and plugins in solaris 10

How to install nagios client in Solaris 10 and NRPE Plugings 1.- Download the Nagios Client Installer You can download the nagios client for solaris 10 from exchange.nagios.org, previously you need to have connection from the server to internet #wget assets.nagios.com/downloads/nagiosxi/agents/solaris-nrpe-agent.tar.gz  (Only if you have installed the wget package) 2.- If you do not have connection, please download in your machine and upload it to the server as below # scp -pr solaris-nrpe-agent.tar.gz    root@india:/var/tmp Password: solaris-nrpe-agent.t 100% |**************************************************************************************************************************************************|  4202 KB    00:00 Once you uploaded the package, connect with ssh to the server, plesase uncompress the information in order to execute the install program 2.- Execute the fullinstall script in order to begin the installation root@india:/var/tmp #gunzip solari

How to add swap space to Solaris Zone without reboot

How to add swap space to Solaris zone without reboot root@sin:/ # zoneadm list -civ   ID NAME             STATUS     PATH                           BRAND    IP    0 global           running    /                               native   shared    1 lab01             running    /zones/lab01                    native   shared root@sin:/ # If you see the following error root@sin:/# zlogin lab01 Last login: Tue Feb 18 09:44:33 on pts/20 Oracle Corporation      SunOS 5.10      Generic Patch   January 2005 Sourcing //.profile-EIS..... -bash: fork: Not enough space You can can add swap space without reboot the zone lab01, always verify that you have the enough space to add it root@sin:/ # prctl -n zone.max-swap -r -v 30gb -i zone lab01 root@sin:/# zlogin lab01 [Connected to zone 'lab01' pts/7] Last login: Mon Feb 24 08:08:50 on pts/7 Oracle Corporation      SunOS 5.10      Generic Patch   January 2005 Sourcing //.profile-EIS..... DISPLAY=zone:global:0.0 lab

How to configure pool resource for a zone

1.-create pool_backup in order asigning a minimum 4 and maximun 6 We added in the poolnew file all the configuration for the new pool root@sol:/# cat poolnew create pset backup-pset (uint pset.min = 4; uint pset.max = 6) create pool pool_backup associate pool pool_backup (pset backup-pset) 2.-Apply the changes root@sol:/ # pooladm -c 3.-Check the new pool information added root@sol:/ # poolcfg –c info   4.-Now you can see that we have a new pool "pool_backup" with 6 vcpu added and the default that is used by the global root@sol:/ # poolstat                                               pset id pool                             size used load   1 pool_backup              6 0.00 0.01   0 pool_default            10 0.00 0.12 5.-we will modify the zone configuration in order to assign it to the new cpu pool "pool_backup" root@sol:/ # root@sol:/ # zoneadm list -civ    6 backup-zone     running     /zones/backup-zone            native    shared 6.-We will add the follow

How to create a Zone in Solaris 10

How to check zones in the Global Zone   ID NAME             STATUS     PATH                           BRAND    IP    0 global           running    /                                        native   shared    1  bpass          running    /zones/bpass                native   shared The directory where the zone will be running need 700 permission root@/ # cd zones root@/ # mkdir -p /newzone root@/ # chmod 700 newzone root@/ # zonecfg -z newzone Use 'create' to begin configuring a new zone. zonecfg:newzone>create zonecfg:newzone>set zonepath=/zones/newzone zonecfg:newzone>set autoboot=true zonecfg:capped-memory>set physical=2g zonecfg:capped-memory>set swap=4g zonecfg:capped-memory>set locked=1g zonecfg:capped-memory>end If you want to create a Whole zone, you will use shared file system, and you can see when you perform a "zonecfg -z newzone info" the following file systems shared /lib /platform /sbin /usr However you can remove them in order to avoid

How to migrate zpool Solaris 10/11

Migrate Zpool #zpool list NAME             SIZE  ALLOC   FREE  CAP  HEALTH  ALTROOT zbackserver      831G  800G     31G  96%  ONLINE  - #zfs list NAME                                  USED   AVAIL  REFER  MOUNTPOINT rpool                    136G  20.6G   115G  15%  ONLINE  - zbackserver                           800G   31G    31K  none zbackserver/backupserver              800G   31G    800G  /backup We have a new LUN assigned on the server, we will need to label it #format -e c5t600601600551220046512D30807CE311d0s2 format>label SMI   <-------------Select SMI EFI format>p partition>p Part      Tag    Flag     First Sector        Size        Last Sector   0        usr    wm               256      999.99GB         2934223710   1 unassigned    wm                 0          0              0   2 unassigned    wm                 0          0              0   3 unassigned    wm                 0          0              0   4 unassigned    wm