|
Blogs
A Zone is a virtual instance of a (Solaris) guest operating system within a (Solaris) host system. The concept is pretty similar to BSD Jails or Linux VServer and comparable to an extended chroot environment: the guest operating systems share the same kernel and drivers but run within an isolated environment containing an individual directory structure, user management and so on. All guest systems (also referred to as "local" zones) are accessible from the "global zone" which is the host system. Within the local zone neither other zones nor the host system is accessible or even viewable. This way a lot of independent OS environments can be created and hosted within one physical server hardware.
Why installing SAP in a virtual environment?Well, of course the benefits of installing applications in virtualized environments depend on the business case.Anyway, in general there are some general advantages which should be valid for the most scenarios including
Why not installing SAP in virtual environments?Where's light, there's shadow. Of course there are some (big) disadvantages when using virtualization techniques. Here are some of them:
Why installing SAP in Solaris Zones?Of course the Solaris Zones solution is just one way of implementing virtualization concepts. There are various implementations on the market which could be used and they all have their special benefits and disadvantages.One simple answer why one would choose to use Solaris Zones could be: It's a supported environment. That's important due to SAP does not support all virtualization types and products in general at the moment. Therefore you might risk the support for your SAP system when installing it in an unsupported environment. Anyway, a much more practical reason is: Zones are pretty easy to use! And they are included in every Solaris 10 distribution by default. Here are some other pros and cons for installing a SAP system within a Zone:
(+) Resource Management available (Solaris Containers [2] - CPU, network consumption and Memory consumption can be limited explicitly)
How to do itSetting up a new zone is pretty easy. However, I don't want to explain zone creation in detail (because there are already various resources available which do that much better then I could [4]). But I want to give a quick overview about the zone creation and administration tools to provide a first impression how to handle with zones
Tools
zonecfg
zoneadm
zlogin
zonename
Steps to create a zone: ExampleIt is pretty easy to create a new zone from scratch and should be done in a few minutes:
Installing the zone
Booting the zone
Logon to the zone
Known IssuesThe setup of SAP within a zone is pretty much the same as setting up the system within a regular Solaris environment. But some zone limitations may require workarounds.
Read-Only directoriesPlease read Wolfgang Pungartnik's comment regarding read-only directories!The /usr directory is only writeable in the global zone which means within the host system. There is only read-only access available within the local zone (i. e. within the virtual environments). This may cause problems if you want to install a SAP system within a zone due to the fact SAPInst requires /usr as installation directory. A workaround is to create an alias in the global zone which links e.g. to /sap. This way you may create a directory named /sap within the local zone's root directory and the installer is linked to this directory automatically.
If you are plan to install a database in a different zone, you need to create a /sap directory there, too. Otherwise the installer searches /usr/sap for existing installations and crashes due to the link is pointing to nowhere. There are also other directories mounted read-only from the global zone (e.g. /sbin) which may cause errors when installing additional software, e.g. database tools.
NFSAnother restriction of local zones is that the implementation of a NFS server is not possible at the moment. If you want to share the /sapmnt directory via NFS you need to do this in the global zone.
Access to the file system of another zoneIf you are planning to use several zones you may need to get access to a directory of other zones. For example, if you are installing the database instance within another zone you can get access to the /sapmnt directory of the SAP zone directly. To do so, just may use the Loopback File Systems (LOFS) which enables mounting resources locally, e.g. one directory to another location. This is specified within the zone configuration file as listed below.Start the zone configuration tool (zonecfg), add a new file system (add fs) and set the type to LOFS (set type=lofs). You also need to provide the source directory (set special= ) and the destination directory (set dir= ). Here's a simple example configuration for a database zone configuration:
fs:
Solaris installation problemsDue to Zones are virtualized Solaris 10 environments during the installation the standard Solaris installation problems may occur. For instance, the /home directory is read-only due to the auto-mount feature is enabled by default. This usually causes problems with the installer when creation of the users is required.
Other zone limitationsThe concept of zones includes that the kernel of the host system is used. Therefore other limitations may occur when adapting the OS kernel is required. Also the read-only directories mounted from the global zone may cause problems.
ConclusionsYou may ask yourself: Ok, it is possible to install SAP in Solaris Zones, there are some benefits and disadvantages. But is that all you wanted to show me?Well, of course virtualization does not fit to every scenario. And if you do not really need it you shouldn't use it. Anyway, there are pretty interesting concepts you can realize applying virtualization techniques. For example, I already created a prototype using Solaris Zones, ZFS, and a bash script which creates a shadow system within a few seconds without any downtimes of the productive SAP system or database instance. This shadow system may be used for upgrades, patches, backups and so on afterwards and can improve the availability of SAP systems dramatically. And all this is done using native OS functions. Nice, isn't it? Read More: Creating SAP system clones using Solaris 10 virtualization concepts
References
[1] http://www.kernelthread.com/publications/virtualization/
Mark Wondratschek is working for SAP's NetWeaver Regional Implementation Group since 2002.
| |||||||||||||||||||||||