SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Downloaden Sie, um offline zu lesen
Express-Guide
                                       ~to~
                                 Basic Setup of


                Solaris Zones
                       Native Zones & lx-Branded Zones
                                                by, ABK ~ http://www.twitter.com/aBionic


                                 ::Task Detail::

      Creating/Managing Solaris Zones
      mirroring an existing CentOS Box over a Zone
      setting up SVN service over a Zone
      setting CIFS over a Zone



                                 ::Background::

Solaris Zones are a part of Solaris Container Technology. Zones manage the
namespace isolation for containers implementing virtualization.

In Solaris 10, containers are zone using Resource Management Feature via Solaris
Resource Manager. There is no performance overhead to this approach.

Resources are used as a 'Dynamic resource Pool' managed between containers using
a 'Fair Share Scheduler'.

Broadly there are two types of zones:
    Native Zone
     These are basic stripped down native Solaris O.S. Instances.
     Native zones are further of two types where
       ◦ 'Small Zones' (also known as Sparse Root Zone) have several system
         directories shared with Solaris O.S. or Global Zone in non-writable mode
       ◦ 'Big Zones' (also known as Whole Root Zone) have all independent
         directories

    lx-Branded Zone
     these are zones installed from installer of O.S., currently only linux branded
     zones are available also called lx-zones.
::Execution Method::

         (a.) Creating native {small,big} and lx-branded zones

 Setting up Resource Pool to be used by zones
  ◦ Enabling Resource Pool features
     ▪ #pooladm -e

  ◦ Saving current resource pool
    ▪ #pooladm -s

  ◦ List current Pools
    ▪ #pooladm
    ▪ {generally only 'pool_default' is present on fresh zone}

  ◦ Configuring 'default_pool' to enable Fair Share              Scheduler
    over it
    ▪ #poolcfg     -c    'modify pool   pool_default              (string
       pool.scheduler="FSS")'
    ▪ #pooladm –c

  ◦ Priority Controller moving all processes and resources under
    Fair Share Scheduler
    ▪ #priocntl -s -c FSS -i class TS
    ▪ #priocntl -s -c FSS -i pid 1


 Configuring a Solaris Zone
  ◦ This lists the current zones
    ▪ #zoneadm list -cv

  ◦ Configuring a new Native Zone
    ▪ registering a new Zone
      • #zonecfg -z newZoneName

  ◦ regarding 3 different types of zones follow respective command
    ▪ for creating a native small-zone {with shared directories}
       • zonecfg:newZoneName>create
    ▪ for creating a native big-zone {with independent directories}
       • zonecfg:newZoneName>create -b
    ▪ for creating a lx-branded zone
       • zonecfg:lxZoneName>create -t SUNWlx
◦ assigning it a location on HDD to be installed
  ▪ zonecfg:newZoneName>set
     zonepath=/export/home/zones/newZoneName

◦ Adding a Network Interface Resource to it
  ▪ zonecfg:newZoneName>add net
  ▪ zonecfg:newZoneName:net>set address=192.168.16.61
  ▪ zonecfg:newZoneName:net>set physical=eth0
  ▪ zonecfg:newZoneName:net>end

◦ Assign a Resource Pool (should be already existing) to it
  ▪ zonecfg:newZoneName>set pool=pool_default

◦ Adding a resource controller to this Zone
  ▪ zonecfg:newZoneName>add rctl
  ▪ zonecfg:newZoneName:rctl>set name=zone.cpu-shares
  ▪ zonecfg:newZoneName:rctl>
    add value (priv=privileged,limit=1,action=none)
  ▪ zonecfg:newZoneName:rctl>end

◦ Giving a CD-ROM access (required if installing lx-zone from ISO or CD)
  ▪ zonecfg:newZoneName>add fs
  ▪ zonecfg:newZoneName:fs>set dir=/cdrom
  ▪ zonecfg:newZoneName:fs>set special=/cdrom
  ▪ zonecfg:newZoneName:fs>set typr=lofs
  ▪ zonecfg:newZoneName>set options=[nodevices]
  ▪ zonecfg:newZoneName>end

◦ Verify, Save and Exit
  ▪ zonecfg:newZoneName>verify
  ▪ zonecfg:newZoneName>commit
  ▪ zonecfg:newZoneName>exit

◦ Creating the HDD location for Zone
  ▪ #mkdir -p /export/home/zones/newZoneName

◦ Granting required permissions to location
  ▪ #chmod 700 /export/home/zones/newZoneName

◦ Confirming the registration of Zone Configuration
  ▪ #zoneadm list -cv
◦ It should show a listing for currently created zone like
     ▪ newZoneName configured at /export/home/zones/newZoneName, it is
         native and shared (small-zone)

 Installing the already configured zone
  ◦ Installing the zone if it's a Native {small or big} zone
     ▪ #zoneadm -z newZoneName install

   ◦ if it's a lx-brand zone with O.S. TarBall, automatically creating ZFS
     ▪ #zoneadm -z newZoneName install -d /tmp/os.tgz

   ◦ if it's a lx-branded zone with O.S. TarBall, not creating ZFS
     ▪ #zoneadm -z newZoneName install -x nodataset -d /tmp/os.tgz

   ◦ if no archive path is given then default is Disc Drive, but if you are
     installing from Disc Drive, you need to install VOLFS like:
     ▪ #svcadm enable svc:/system/filesystem/volfs:default
     ▪ #svcs | grep volfs

   ◦ If its installed without any error, just check its status using
     ▪ #zoneadm list -cv

   ◦ it should show a listing for currently created zone like newZoneName
     installed /export/home/zones/newZoneName native shared


 Using the installed Zone
  ◦ Now either make it ready to boot, or directly boot which will make it
     ready itself
     ▪ #zoneadm -z newZoneName ready
        • It should show a listing for currently created zone like
           ◦ newZoneName         ready     /export/home/zones/newZoneName
               native shared
           ◦ #zoneadm -z newZoneName boot

   ◦ It should show a listing for currently created zone like
     ▪ newZoneName running /export/home/zones/newZoneName
         native shared

   ◦ To login
     ▪ #zlogin newZoneName
     ▪ Now you are inside the Zone, running 'uname -a' should present you
        with newZoneName
◦ To login into Zone Console like remote connect
    ▪ #zlogin -C newZoneName

  ◦ To exit the zone
    ▪ #exit

  ◦ To halt the zone simply use
    ▪ #zoneadm -z newZoneName halt

  ◦ it should show a listing for currently created zone like
    ▪ newZoneName running /export/home/zones/newZoneName
        native shared

  ◦ To reboot the zone simply use
    ▪ #zoneadm -z newZoneName reboot

  ◦ To uninstall the zone
    ▪ #zoneadm -z newZoneName uninstall -F


           (b.) Mirroring an existing CentOS Box over a Zone

 There are two ways to achieve this
  ◦ TarBall the entire distro you want to port to Zone and use that TarBall to
    install the Zone.

  ◦ Suppose, you already have an lx-branded zone and use the same. Then
    you need to use utility like RSync to Sync the files from Source Machine
    to lx-Zone.

 You can also add packages like svn, gcc, make, netsnmp, openssl,
  CoolStack's ( apache2, mysql, php, perl, python, ruby, squid) to lx-zone and
  they work great over Zone.



                (c.) Setting up SVN service over a Zone

 Users connect to svn mirror servers, the WebDAV SVN module serves
  content from the local system, and sends commits to the main server. Then
  main server pushes commit to mirrors using 'svnsync' over a protected link
  only writable by main server.
  ◦ Install Collabnet SVN client & server binaries {available at
'http://www.collab.net/downloads/subversion/solaris.html'}

    ◦ Create a symlink collabnet modules a
      ▪ #ln     -s    /opt/CollabNet_Subversion/modules/mod_dav_svn.so
         /etc/httpd/modules/mod_dav_svn.so
      ▪ #
         ln   -s   /opt/CollabNet_Subversion/modules/mod_authz_svn.so
         /etc/httpd/modules/mod_authz_svn.so

    ◦ Add below lines to 'httpd.conf' under Apache2 directory as
      ▪ LoadModule dav_svn_module /etc/httpd/modules/mod_dav_svn.so
       LoadModule authz_svn_module /etc/httpd/modules/mod_authz_svn.so
       <Location /someproject>
       DAV svn
       SVNPath /repos/svn/repos/someproject
       AuthzSVNAccessFile /repos/svn/access/someproject/svn_access.conf
       AuthType Basic
       AuthName "Active Directory LDAP Authentication"
       AuthBasicProvider ldap
       AuthzLDAPAuthoritative off
       AuthLDAPBindDN user@adserver.thoughtworks.com
       AuthLDAPBindPassword somePassword
       AuthLDAPURL "ldap://adserver.company.com:389/ou=Principal,dc=
dcString1,dc=dcStrin2?SAMAccountName?sub?(&(objectClass=user))"
       require vaild-user
       SVNPathAuthz off
       </Location>

    ◦ Reload httpd service
    ◦
    ◦ Add following lines to '/repos/svn/access/someproject/svn_access.conf'
      ▪ can_write_group=aduserA, aduserB,aduserC
         read_only_group=aduserD,aduserE,aduserF
         no_access_group=aduserG,aduserH,aduserJ
         [repository:/]
         @can_write_group=rw
         @read_only_group=r
         @no_access_group=

    ◦ Create a repository as follows:
      ▪ svnadmin create /repos/svn/repos/someproject
      ▪ change permissions as follows
      ▪ chmod -R g+w /repos/svn/repos/someproject
      ▪ chown -R apache.apache /repos/svn/repos/someproject

    ◦ Similarly, you can setup mirror server with the configuration given at
      Link Above.
(d.) Setting CIFS over a Zone

 Initial reading disclosed its not possible over local zones, only global zone
  could support CIFS.

 So just did practical with setting up SAMBA server on Solaris Zones;
  implemented SWAT (Samba Web Admin Tool) for easy configuration.
  ◦ for Solaris 10, SAMBA came up real easy to configure
     ▪ #svcs samba wins swat
     ▪ #svcadm enable samba
     ▪ #svcadm enable wins
     ▪ #svcadm enable swat

   ◦ Simply browsing http://samba_Zone_IPaddress:901/ presents with a nice
     SWAT GUI to configure SAMBA service on that zone.
     To get start with, you need to
     ▪ > select 'Shares', add new share with proper configuration
     ▪ > select 'Users', to add Users
     ▪ > Restart Services from UI itself
     ▪ > now try accessing this share from Windows as normal
        Windows Share using User created




                        ::Tools/Technology Used::

 Solaris Zones: http://www.solarisinternals.com/wiki/index.php/Zones
 CoolStack Software Bundles: {now superseded by WebStack} ~
  http://hub.opensolaris.org/bin/view/Project+webstack/sunwebstack
 Rsync: http://en.wikipedia.org/wiki/Rsync
 SVN: http://subversion.apache.org/
 Apache: http://www.apache.org/
 CIFS: http://msdn.microsoft.com/en-us/library/aa302188.aspx
 Samba: http://www.samba.org/
 SWAT: http://linux.die.net/man/8/swat



                                ::Inference::

 Solaris Zones is a highly under-used and over-capable technology.
 Due to its minimal overhead architecture on Virtualization, its the best
  option according to me for Virtualization of Linux Boxes.

 There is still a great scope left to be developed in this technology.



                       ::Troubleshooting/Updates::

 Problem: The Apache mod_dav and mod_dav_svn module was failing to
  integrate with SVN implementation.
  Solution:
  Initially I was using CoolStack's Software Bundle of Apache+PHP+MySQL
  due to ease of use on Native-Small Zone, but found out that actually it's
  implementation raised the incompatibility issue. So, created a Native Big-
  Zone and used standard Apache release, and it worked.

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Failsafe Mechanism for Yahoo Homepage
Failsafe Mechanism for Yahoo HomepageFailsafe Mechanism for Yahoo Homepage
Failsafe Mechanism for Yahoo Homepage
 
Docker advance topic
Docker advance topicDocker advance topic
Docker advance topic
 
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, DockerUnder the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
 
Installation Openstack Swift
Installation Openstack SwiftInstallation Openstack Swift
Installation Openstack Swift
 
What’s new in Swarm 1.1
What’s new in Swarm 1.1What’s new in Swarm 1.1
What’s new in Swarm 1.1
 
Deep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksDeep dive in Docker Overlay Networks
Deep dive in Docker Overlay Networks
 
Docker advance1
Docker advance1Docker advance1
Docker advance1
 
Docking postgres
Docking postgresDocking postgres
Docking postgres
 
Docker Networking & Swarm Mode Introduction
Docker Networking & Swarm Mode IntroductionDocker Networking & Swarm Mode Introduction
Docker Networking & Swarm Mode Introduction
 
Deep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay NetworksDeep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay Networks
 
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on DockerRunning High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
 
Introductory Overview to Managing AWS with Terraform
Introductory Overview to Managing AWS with TerraformIntroductory Overview to Managing AWS with Terraform
Introductory Overview to Managing AWS with Terraform
 
JDO 2019: Container orchestration with Docker Swarm - Jakub Hajek
JDO 2019: Container orchestration with Docker Swarm - Jakub HajekJDO 2019: Container orchestration with Docker Swarm - Jakub Hajek
JDO 2019: Container orchestration with Docker Swarm - Jakub Hajek
 
New Docker Features for Orchestration and Containers
New Docker Features for Orchestration and ContainersNew Docker Features for Orchestration and Containers
New Docker Features for Orchestration and Containers
 
Docker up and running
Docker up and runningDocker up and running
Docker up and running
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With Rpm
 
Percona Live 2012PPT: introduction-to-mysql-replication
Percona Live 2012PPT: introduction-to-mysql-replicationPercona Live 2012PPT: introduction-to-mysql-replication
Percona Live 2012PPT: introduction-to-mysql-replication
 
Deeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksDeeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay Networks
 
Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & Ansible
 

Andere mochten auch (7)

Wlan
WlanWlan
Wlan
 
Lecture 19 dynamic web - java - part 1
Lecture 19   dynamic web - java - part 1Lecture 19   dynamic web - java - part 1
Lecture 19 dynamic web - java - part 1
 
Syslog Centralization Logging with Windows ~ A techXpress Guide
Syslog Centralization Logging with Windows ~ A techXpress GuideSyslog Centralization Logging with Windows ~ A techXpress Guide
Syslog Centralization Logging with Windows ~ A techXpress Guide
 
Insecurity-In-Security version.2 (2011)
Insecurity-In-Security version.2 (2011)Insecurity-In-Security version.2 (2011)
Insecurity-In-Security version.2 (2011)
 
Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)
 
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress GuideEthernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
 
DevOps with Sec-ops
DevOps with Sec-opsDevOps with Sec-ops
DevOps with Sec-ops
 

Ähnlich wie Solaris Zones (native & lxbranded) ~ A techXpress Guide

An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring
Abhishek Kumar
 
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster NodesWSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2
 
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
Kasun Gajasinghe
 
Add and configure lu ns in solaris
Add and configure lu ns in solarisAdd and configure lu ns in solaris
Add and configure lu ns in solaris
Amrita Dey
 

Ähnlich wie Solaris Zones (native & lxbranded) ~ A techXpress Guide (20)

An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring
 
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster NodesWSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
 
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
 
Step by Step to Install oracle grid 11.2.0.3 on solaris 11.1
Step by Step to Install oracle grid 11.2.0.3 on solaris 11.1Step by Step to Install oracle grid 11.2.0.3 on solaris 11.1
Step by Step to Install oracle grid 11.2.0.3 on solaris 11.1
 
Sharded cluster tutorial
Sharded cluster tutorialSharded cluster tutorial
Sharded cluster tutorial
 
MongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster TutorialMongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster Tutorial
 
MongoDB – Sharded cluster tutorial - Percona Europe 2017
MongoDB – Sharded cluster tutorial - Percona Europe 2017MongoDB – Sharded cluster tutorial - Percona Europe 2017
MongoDB – Sharded cluster tutorial - Percona Europe 2017
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 
Terraform Cosmos DB
Terraform Cosmos DBTerraform Cosmos DB
Terraform Cosmos DB
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Docker container management
Docker container managementDocker container management
Docker container management
 
Add and configure lu ns in solaris
Add and configure lu ns in solarisAdd and configure lu ns in solaris
Add and configure lu ns in solaris
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Oracle goldengate and RAC12c
Oracle goldengate and RAC12cOracle goldengate and RAC12c
Oracle goldengate and RAC12c
 
Ubic
UbicUbic
Ubic
 
Ubic-public
Ubic-publicUbic-public
Ubic-public
 
OpenStack Tokyo Meeup - Gluster Storage Day
OpenStack Tokyo Meeup - Gluster Storage DayOpenStack Tokyo Meeup - Gluster Storage Day
OpenStack Tokyo Meeup - Gluster Storage Day
 
The age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementThe age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster management
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructure
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 

Mehr von Abhishek Kumar

Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Abhishek Kumar
 

Mehr von Abhishek Kumar (11)

DevOps?!@
DevOps?!@DevOps?!@
DevOps?!@
 
xml-motor ~ What,Why,How
xml-motor ~ What,Why,Howxml-motor ~ What,Why,How
xml-motor ~ What,Why,How
 
XML-Motor
XML-MotorXML-Motor
XML-Motor
 
Squid for Load-Balancing & Cache-Proxy ~ A techXpress Guide
Squid for Load-Balancing & Cache-Proxy ~ A techXpress GuideSquid for Load-Balancing & Cache-Proxy ~ A techXpress Guide
Squid for Load-Balancing & Cache-Proxy ~ A techXpress Guide
 
An Express Guide ~ "dummynet" for tweaking network latencies & bandwidth
An Express Guide ~ "dummynet" for tweaking network latencies & bandwidthAn Express Guide ~ "dummynet" for tweaking network latencies & bandwidth
An Express Guide ~ "dummynet" for tweaking network latencies & bandwidth
 
An Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
An Express Guide ~ Cacti for IT Infrastructure Monitoring & GraphingAn Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
An Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
 
An Express Guide ~ SNMP for Secure Rremote Resource Monitoring
An Express Guide ~ SNMP for Secure Rremote Resource MonitoringAn Express Guide ~ SNMP for Secure Rremote Resource Monitoring
An Express Guide ~ SNMP for Secure Rremote Resource Monitoring
 
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
 
XSS Defeating Concept - Part 2
XSS Defeating Concept - Part 2XSS Defeating Concept - Part 2
XSS Defeating Concept - Part 2
 
XSS Defeating Trick ~=ABK=~ WhitePaper
XSS Defeating Trick ~=ABK=~ WhitePaperXSS Defeating Trick ~=ABK=~ WhitePaper
XSS Defeating Trick ~=ABK=~ WhitePaper
 
FreeSWITCH on RedHat, Fedora, CentOS
FreeSWITCH on RedHat, Fedora, CentOSFreeSWITCH on RedHat, Fedora, CentOS
FreeSWITCH on RedHat, Fedora, CentOS
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Solaris Zones (native & lxbranded) ~ A techXpress Guide

  • 1. Express-Guide ~to~ Basic Setup of Solaris Zones Native Zones & lx-Branded Zones by, ABK ~ http://www.twitter.com/aBionic ::Task Detail::  Creating/Managing Solaris Zones  mirroring an existing CentOS Box over a Zone  setting up SVN service over a Zone  setting CIFS over a Zone ::Background:: Solaris Zones are a part of Solaris Container Technology. Zones manage the namespace isolation for containers implementing virtualization. In Solaris 10, containers are zone using Resource Management Feature via Solaris Resource Manager. There is no performance overhead to this approach. Resources are used as a 'Dynamic resource Pool' managed between containers using a 'Fair Share Scheduler'. Broadly there are two types of zones:  Native Zone These are basic stripped down native Solaris O.S. Instances. Native zones are further of two types where ◦ 'Small Zones' (also known as Sparse Root Zone) have several system directories shared with Solaris O.S. or Global Zone in non-writable mode ◦ 'Big Zones' (also known as Whole Root Zone) have all independent directories  lx-Branded Zone these are zones installed from installer of O.S., currently only linux branded zones are available also called lx-zones.
  • 2. ::Execution Method:: (a.) Creating native {small,big} and lx-branded zones  Setting up Resource Pool to be used by zones ◦ Enabling Resource Pool features ▪ #pooladm -e ◦ Saving current resource pool ▪ #pooladm -s ◦ List current Pools ▪ #pooladm ▪ {generally only 'pool_default' is present on fresh zone} ◦ Configuring 'default_pool' to enable Fair Share Scheduler over it ▪ #poolcfg -c 'modify pool pool_default (string pool.scheduler="FSS")' ▪ #pooladm –c ◦ Priority Controller moving all processes and resources under Fair Share Scheduler ▪ #priocntl -s -c FSS -i class TS ▪ #priocntl -s -c FSS -i pid 1  Configuring a Solaris Zone ◦ This lists the current zones ▪ #zoneadm list -cv ◦ Configuring a new Native Zone ▪ registering a new Zone • #zonecfg -z newZoneName ◦ regarding 3 different types of zones follow respective command ▪ for creating a native small-zone {with shared directories} • zonecfg:newZoneName>create ▪ for creating a native big-zone {with independent directories} • zonecfg:newZoneName>create -b ▪ for creating a lx-branded zone • zonecfg:lxZoneName>create -t SUNWlx
  • 3. ◦ assigning it a location on HDD to be installed ▪ zonecfg:newZoneName>set zonepath=/export/home/zones/newZoneName ◦ Adding a Network Interface Resource to it ▪ zonecfg:newZoneName>add net ▪ zonecfg:newZoneName:net>set address=192.168.16.61 ▪ zonecfg:newZoneName:net>set physical=eth0 ▪ zonecfg:newZoneName:net>end ◦ Assign a Resource Pool (should be already existing) to it ▪ zonecfg:newZoneName>set pool=pool_default ◦ Adding a resource controller to this Zone ▪ zonecfg:newZoneName>add rctl ▪ zonecfg:newZoneName:rctl>set name=zone.cpu-shares ▪ zonecfg:newZoneName:rctl> add value (priv=privileged,limit=1,action=none) ▪ zonecfg:newZoneName:rctl>end ◦ Giving a CD-ROM access (required if installing lx-zone from ISO or CD) ▪ zonecfg:newZoneName>add fs ▪ zonecfg:newZoneName:fs>set dir=/cdrom ▪ zonecfg:newZoneName:fs>set special=/cdrom ▪ zonecfg:newZoneName:fs>set typr=lofs ▪ zonecfg:newZoneName>set options=[nodevices] ▪ zonecfg:newZoneName>end ◦ Verify, Save and Exit ▪ zonecfg:newZoneName>verify ▪ zonecfg:newZoneName>commit ▪ zonecfg:newZoneName>exit ◦ Creating the HDD location for Zone ▪ #mkdir -p /export/home/zones/newZoneName ◦ Granting required permissions to location ▪ #chmod 700 /export/home/zones/newZoneName ◦ Confirming the registration of Zone Configuration ▪ #zoneadm list -cv
  • 4. ◦ It should show a listing for currently created zone like ▪ newZoneName configured at /export/home/zones/newZoneName, it is native and shared (small-zone)  Installing the already configured zone ◦ Installing the zone if it's a Native {small or big} zone ▪ #zoneadm -z newZoneName install ◦ if it's a lx-brand zone with O.S. TarBall, automatically creating ZFS ▪ #zoneadm -z newZoneName install -d /tmp/os.tgz ◦ if it's a lx-branded zone with O.S. TarBall, not creating ZFS ▪ #zoneadm -z newZoneName install -x nodataset -d /tmp/os.tgz ◦ if no archive path is given then default is Disc Drive, but if you are installing from Disc Drive, you need to install VOLFS like: ▪ #svcadm enable svc:/system/filesystem/volfs:default ▪ #svcs | grep volfs ◦ If its installed without any error, just check its status using ▪ #zoneadm list -cv ◦ it should show a listing for currently created zone like newZoneName installed /export/home/zones/newZoneName native shared  Using the installed Zone ◦ Now either make it ready to boot, or directly boot which will make it ready itself ▪ #zoneadm -z newZoneName ready • It should show a listing for currently created zone like ◦ newZoneName ready /export/home/zones/newZoneName native shared ◦ #zoneadm -z newZoneName boot ◦ It should show a listing for currently created zone like ▪ newZoneName running /export/home/zones/newZoneName native shared ◦ To login ▪ #zlogin newZoneName ▪ Now you are inside the Zone, running 'uname -a' should present you with newZoneName
  • 5. ◦ To login into Zone Console like remote connect ▪ #zlogin -C newZoneName ◦ To exit the zone ▪ #exit ◦ To halt the zone simply use ▪ #zoneadm -z newZoneName halt ◦ it should show a listing for currently created zone like ▪ newZoneName running /export/home/zones/newZoneName native shared ◦ To reboot the zone simply use ▪ #zoneadm -z newZoneName reboot ◦ To uninstall the zone ▪ #zoneadm -z newZoneName uninstall -F (b.) Mirroring an existing CentOS Box over a Zone  There are two ways to achieve this ◦ TarBall the entire distro you want to port to Zone and use that TarBall to install the Zone. ◦ Suppose, you already have an lx-branded zone and use the same. Then you need to use utility like RSync to Sync the files from Source Machine to lx-Zone.  You can also add packages like svn, gcc, make, netsnmp, openssl, CoolStack's ( apache2, mysql, php, perl, python, ruby, squid) to lx-zone and they work great over Zone. (c.) Setting up SVN service over a Zone  Users connect to svn mirror servers, the WebDAV SVN module serves content from the local system, and sends commits to the main server. Then main server pushes commit to mirrors using 'svnsync' over a protected link only writable by main server. ◦ Install Collabnet SVN client & server binaries {available at
  • 6. 'http://www.collab.net/downloads/subversion/solaris.html'} ◦ Create a symlink collabnet modules a ▪ #ln -s /opt/CollabNet_Subversion/modules/mod_dav_svn.so /etc/httpd/modules/mod_dav_svn.so ▪ # ln -s /opt/CollabNet_Subversion/modules/mod_authz_svn.so /etc/httpd/modules/mod_authz_svn.so ◦ Add below lines to 'httpd.conf' under Apache2 directory as ▪ LoadModule dav_svn_module /etc/httpd/modules/mod_dav_svn.so LoadModule authz_svn_module /etc/httpd/modules/mod_authz_svn.so <Location /someproject> DAV svn SVNPath /repos/svn/repos/someproject AuthzSVNAccessFile /repos/svn/access/someproject/svn_access.conf AuthType Basic AuthName "Active Directory LDAP Authentication" AuthBasicProvider ldap AuthzLDAPAuthoritative off AuthLDAPBindDN user@adserver.thoughtworks.com AuthLDAPBindPassword somePassword AuthLDAPURL "ldap://adserver.company.com:389/ou=Principal,dc= dcString1,dc=dcStrin2?SAMAccountName?sub?(&(objectClass=user))" require vaild-user SVNPathAuthz off </Location> ◦ Reload httpd service ◦ ◦ Add following lines to '/repos/svn/access/someproject/svn_access.conf' ▪ can_write_group=aduserA, aduserB,aduserC read_only_group=aduserD,aduserE,aduserF no_access_group=aduserG,aduserH,aduserJ [repository:/] @can_write_group=rw @read_only_group=r @no_access_group= ◦ Create a repository as follows: ▪ svnadmin create /repos/svn/repos/someproject ▪ change permissions as follows ▪ chmod -R g+w /repos/svn/repos/someproject ▪ chown -R apache.apache /repos/svn/repos/someproject ◦ Similarly, you can setup mirror server with the configuration given at Link Above.
  • 7. (d.) Setting CIFS over a Zone  Initial reading disclosed its not possible over local zones, only global zone could support CIFS.  So just did practical with setting up SAMBA server on Solaris Zones; implemented SWAT (Samba Web Admin Tool) for easy configuration. ◦ for Solaris 10, SAMBA came up real easy to configure ▪ #svcs samba wins swat ▪ #svcadm enable samba ▪ #svcadm enable wins ▪ #svcadm enable swat ◦ Simply browsing http://samba_Zone_IPaddress:901/ presents with a nice SWAT GUI to configure SAMBA service on that zone. To get start with, you need to ▪ > select 'Shares', add new share with proper configuration ▪ > select 'Users', to add Users ▪ > Restart Services from UI itself ▪ > now try accessing this share from Windows as normal Windows Share using User created ::Tools/Technology Used::  Solaris Zones: http://www.solarisinternals.com/wiki/index.php/Zones  CoolStack Software Bundles: {now superseded by WebStack} ~ http://hub.opensolaris.org/bin/view/Project+webstack/sunwebstack  Rsync: http://en.wikipedia.org/wiki/Rsync  SVN: http://subversion.apache.org/  Apache: http://www.apache.org/  CIFS: http://msdn.microsoft.com/en-us/library/aa302188.aspx  Samba: http://www.samba.org/  SWAT: http://linux.die.net/man/8/swat ::Inference::  Solaris Zones is a highly under-used and over-capable technology.
  • 8.  Due to its minimal overhead architecture on Virtualization, its the best option according to me for Virtualization of Linux Boxes.  There is still a great scope left to be developed in this technology. ::Troubleshooting/Updates::  Problem: The Apache mod_dav and mod_dav_svn module was failing to integrate with SVN implementation. Solution: Initially I was using CoolStack's Software Bundle of Apache+PHP+MySQL due to ease of use on Native-Small Zone, but found out that actually it's implementation raised the incompatibility issue. So, created a Native Big- Zone and used standard Apache release, and it worked.