WPAR is an isolated execution environment with its own init processes inside standard AIX machines. To the end user, WPAR appears as a standalone AIX machine with its own set of processes similar to standard AIX machines. This article concentrates on the following concepts, which are useful in setting up a DB2 environment inside a WPAR:
- Types of WPARs (system and application WPARs)
- Creating system WPARs
- Installing and configuring DB2 on a WPAR
The instructions and tips provided in this article can help users of WPARs with installation and configuration of various products, such as DB2, Oracle, IDS, WebSphere® Application Server, and SAP.
WPARs can be categorized as system and application WPARs.
- A system WPAR is a process inside standard AIX machines (which I will call "Global") with its own execution environment. It provides all standard (/ /usr /opt /var /etc /tmp and /home) file systems to the end user. System WPARs can share /usr or /opt from Global in read-only mode or can have its own /usr or /opt file systems. File systems in system WPARs could be configured in three different ways: with shared /usr and /opt (which is namefs type), with private /usr and /opt, and with so-called "remote" - root file systems are configured as NFS types (could be nfsv3 and nfsv4) and mounted from a NFS server.
- An application WPAR is also a process inside the Global machine with its own
execution environment and uses all file systems from the global environment. Application
WPARs start with a startup script and end whenever the startup script completes its
execution. For instance:
wparexec -n "application wpar name" "absolute path of the script to be executed with arguments if any"
# wparexec -n appwpar /usr/bin/sleep 10 Starting workload partition appwpar. Mounting all workload partition file systems. Loading workload partition. [ ----Script will start execution here---- ] Shutting down all workload partition processes.
Appwpar will be started and execute the script given. In this case, it is sleep 10. Application WPAR will terminate itself after sleeping for 10 seconds.
How do you create system WPARs?
There are three ways to create system WPARs based on how you allocate file systems to system WPARs:
- System WPAR with shared /usr
- System WPAR with private /usr
- System WPAR with remote OR NFS exported file systems
In this WPAR, /usr and /opt of Global are shared by the system WPAR. The following command creates the shared system WPAR:
mkwpar -n shared_wpar |
The following figure shows the file system mapping of Global and the shared system WPAR.
Figure 1. Shared WPAR in Global environment
# lsfs|grep shared_wpar
/dev/fslv00 -- /wpars/shared_wpar jfs2
/dev/fslv01 -- /wpars/shared_wpar/home jfs2
/opt -- /wpars/shared_wpar/opt namefs
/proc -- /wpars/shared_wpar/proc namefs
/dev/fslv02 -- /wpars/shared_wpar/tmp jfs2
/usr -- /wpars/shared_wpar/usr namefs
/dev/fslv03 -- /wpars/shared_wpar/var jfs2
|
System WPARs with private /usr
In this WPAR, /usr and /opt are created separately for the system WPAR. Global gives Logical Volumes required to create /usr and /opt file systems (see Figure 2). The following command creates the private system WPAR:
mkwpar -l -N interface=en0 address="IP" netmask=255.255.255.192 broadcast=9.2.60.255 -n "wpar name having DNS entry" |
IP and DNS name are needed for system WPARs as DB2 probes for it while creating the DB2 instance. The following figure shows file system mapping of Global and the private system WPAR.
Figure 2. Private WPAR in the Global environment
File systems in a private WPAR
# lsfs|grep private_wpar
/dev/fslv04 -- /wpars/private_wpar jfs2
/dev/fslv05 -- /wpars/private_wpar/home jfs2
/dev/fslv06 -- /wpars/private_wpar/opt jfs2
/proc -- /wpars/private_wpar/proc namefs
/dev/fslv07 -- /wpars/private_wpar/tmp jfs2
/dev/fslv08 -- /wpars/private_wpar/usr jfs2
/dev/fslv09 -- /wpars/private_wpar/var jfs2
|
System WPAR with remote OR NFS exported File systems
In this WPAR, all the file systems come from a NFS server, which exports file systems using the mknfsexp command. The following figure shows file system mapping of Global and Remote System WPARs.
Figure 3. Remote WPAR in Global env ironment
# lsfs|grep remote_wpar
/remote_wpar janet01 /wpars/remote_wpar nfs
/remote_wpar/opt janet01 /wpars/remote_wpar/opt nfs
/proc -- /wpars/remote_wpar/proc namefs
/remote_wpar/tmp janet01 /wpars/remote_wpar/tmp nfs
/remote_wpar/usr janet01 /wpars/remote_wpar/usr nfs
/remote_wpar/var janet01 /wpars/remote_wpar/var nfs
|
The following command creates remote WPARs:
/usr/sbin/mkwpar -A -F -s -r -n remote_wpar -f remote_wpar.cf |
remote_wpar.cf is the specification file used to create remote_wpar WPAR.
Entries in remote_wpar.cf are:
#cat remote_wpar.cf
network:
interface = en0
netmask = 255.255.255.192
address = 9.2.65.91
general:
privateusr=yes
mount:
dev = /remote_wpar
directory = /
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/usr
directory = /usr
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/opt
directory = /opt
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/var
directory = /var
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/home
directory = /home
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/tmp
directory = /tmp
vfs = nfs
host = janet01
|
Here janet01 is the NFS server holding file systems required for remote system WPARs.
The following shows how to create and export /remote_wpar/* file systems on an NFS server:
Creation of file systems
crfs -v jfs2 -g ${VG} -m /remote_wpar -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/usr -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/opt -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/var -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/home -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/tmp -A yes -a size=${SZ}
|
where VG is Volume Group and SZ is size of file system.
This example shows how to export file systems:
mknfsexp -d /remote_wpar -B -a 0 -v 3 -t rw -r *.ibm.com mknfsexp -d /remote_wpar/usr -B -a 0 -v 3 -t rw -r *.ibm.com mknfsexp -d /remote_wpar/opt -B -a 0 -v 3 -t rw -r *.ibm.com mknfsexp -d /remote_wpar/var -B -a 0 -v 3 -t rw -r *.ibm.com mknfsexp -d /remote_wpar/home -B -a 0 -v 3 -t rw -r *.ibm.com mknfsexp -d /remote_wpar/tmp -B -a 0 -v 3 -t rw -r *.ibm.com |
The previous steps are required to set up various types of system WPARs. To create a DB2 environment, you can use any of the three types. Here are the possible configurations:
- To install DB2 in the default directory (/opt is default directory), you need either a private or remote system WPAR.
- To install DB2 in a non-default location, you can use any of the above-mentioned system WPAR types.
DB2 installation and setup on a system WPAR:
The following shows how to install and configure DB2 inside of a system WPAR:
- Create a system WPAR (private or remote). DB2 needs a bigger /usr, /opt and /home directories. You might need to increase them in case of failure.
-
Start the system WPAR:
startwpar remote_wpar
- Log in to remote_wpar using either clogin or telnet.
- Install DB2. This is similar to how you do installation on normal AIX machines
(Global).
- Copy the DB2 images or mount a directory where DB2 images are available.
mount "ImageServer":/DB2Images /mnt on your System WPAR
cd /mnt/"DB2 path"
- Run db2_install (here we need to select the DB2 install path. You can change the path if you want to go for a non-default location.)
- Copy the DB2 images or mount a directory where DB2 images are available.
- List all DB2 filesets.
lslpp -l |grep db2 lists
- Create a DB2 instance just to reconfirm the installation.
mkuser test mkuser testfc /DB2 Installation Dir/instance/db2icrt -a SERVER -s ESE -w 64 -u testfc test
- DB2 is now ready on system WPAR and can be used to run DB2 applications.
This section described set up DB2 on a system WPAR. The following section describes how set up DB2 setup on an application WPAR.
DB2 installation and setup on an application WPAR
As stated earlier, application WPARs use all the file systems from Global only.
- Install DB2 on Global. There is no need to create DB2 instance at this stage.
- Create the application WPAR using the wparexec command and pass the createdb2instance
script as the startup script to wparexec command:
wparexec -N interface=en0 address="IP" netmask=255.255.255.192 broadcast=9.2.60.255 -n "App WPAR name having DNS entry" /"absolutePath"/createdb2instance
createdb2instance is a script, which creates the DB2 instance. We need to create the DB2 instance in this manner so that DB2 will take the IP and hostname from the current execution environment, which is nothing but the application WPAR environment.
#cat createdb2instance: mkuser test mkuser testfc /"DB2 Installation Dir"//instance/db2icrt -a SERVER -s ese -w 64 -u testfc test
- After completing the createdb2instance, we can infer:
- Application WPAR exits.
- DB2 instance (test in this case) exists on global file systems.
- DB2 instance (test) internally contains application WPAR IP and DNS names.
- At this stage we have DB2 on Global and a DB2 instance with application WPAR references.
- Now we can start our application on the application WPAR and its DB2 instance.
wparexec -N interface=en0 address="IP" netmask=255.255.255.192 broadcast=9.2.60.255 -n "App WPAR having DNS entry" /"absolutePath"/somedb2application
Here somedb2application is a DB2 application uses the DB2 instance created inside the application WPAR.
This article discussed how to create various types of WPARs and install DB2 inside of a WPAR. The instructions and tips provided here can help users of WPARs with installation and configuration of various products, such as DB2, Oracle, IDS, WebSphere Application Server, and SAP.
Here are the importatnt points to be noted with respect to WPAR and DB2:
- The WPAR name should have an IP and associated DNS entry.
- /etc/hosts entry with WPAR IP and DNS name
- Selection of type of system WPAR to be used for DB2 installation
Learn
-
"RedBook:Introduction
to Workload Partition Management in IBM AIX Version 6.1 presents Workload Partitions (WPARs), a set of completely new software-based system virtualization features introduced in IBM AIX Version 6.1."
-
"Developer Work ArticleAIX 6 Workload Partition and Live Application Mobility introduces WPAR concepts, gives hands-on details to show ease of use, and provides steps that correctly outline the Live Application Mobility function."
-
"Installing a DB2 product manually"
-
The AIX and UNIX developerWorks
zone provides a wealth of information relating to all aspects of IBM®
AIX® systems administration and expanding your UNIX skills.
-
New to AIX and UNIX?
Visit the New to AIX and UNIX page to learn more.
-
developerWorks technical
events and webcasts: Stay current with developerWorks technical events and
webcasts.
-
AIX 5L Wiki:
Visit this collaborative environment for technical information related to AIX.
-
Podcasts: Tune in and
catch up with IBM technical experts.
Get products and technologies
-
IBM
trial software: Build your next development project with software for download
directly from developerWorks.
Discuss
-
Participate in the AIX and UNIX forums:
- AIX 5L -- technical forum
- AIX for Developers Forum
- Cluster Systems Management
- IBM Support Assistant
- Performance Tools -- technical
- Virtualization -- technical
- More AIX and UNIX forums

Pavan holds a Master's Degree in Computer Science and Engineering and has eight years experience in IBM. Pavan has worked in DCE support, SARPC Linux porting, and WebSphere FVT team and has played various roles like developer, tester, and product builder. Currently, he is leading the AIX WPAR UPT team. His technical interests includes CGI-PERL coding and DB2. You can contact Pavan at apavan@in.ibm.com.





