Pages

AIX WPAR

WPAR (Workload Partition) is IBM AIX's OS-level virtualization technology introduced starting with AIX 6.1. It allows partitioning a single AIX operating system instance into multiple virtualized environments called workload partitions. 

Each WPAR acts as a separate virtualized OS environment with isolated application processes, file systems, users, groups, and network addresses. WPARs share the same OS kernel but provide isolation at the process and resource level.

There are three types of WPARs:
System WPAR: behaves like a complete AIX system with its own writable file systems, network configuration, and user management.
Application WPAR: a lightweight environment focused on running isolated application processes, with limited OS features.
Versioned WPAR: hosts different AIX versions within a WPAR, supported on AIX 7.1 and later.

WPARs allow more efficient resource utilization on IBM Power Systems by enabling multiple virtualized environments without the overhead of separate Logical Partitions (LPARs), which require multiple OS instances. WPARs are managed within AIX and can be created, started, and stopped at the command line or using system tools.

LPARs (Logical Partitions):
So, the structure typically has Hardware → Hypervisor → LPARs → AIX OS → WPARs.

Physical Hardware Layer:
  • The actual IBM Power System server hardware (CPU, memory, disk, NICs, etc.).
PowerVM Hypervisor:
  • Sits on top of the hardware and manages LPARs (Logical Partitions).
  • Provides hardware abstraction and resource allocation.
LPARs (Logical Partitions):
  • Each LPAR runs a separate AIX operating system instance.
  • This is the main OS-level virtualization boundary.
  • WPARs are created inside these AIX instances.
AIX Operating System:
  • The base OS installed in each LPAR.
  • Provides the WPAR management framework (commands like mkwpar, lswpar, etc.).
WPARs (Workload Partitions):
  • Lightweight OS-level partitions within an AIX instance.
  • Share the same kernel but have isolated file systems, process trees, and network configurations.
Management Tools:
  • NIM (Network Installation Manager) or PowerVC for centralized management.
  • WPAR Manager GUI or CLI for creating, starting, stopping, and migrating WPARs.
Application WPAR:
An Application WPAR is a lightweight workload partition in AIX designed to run a single application or command in isolation — rather than a full AIX system environment.
It’s essentially an encapsulated process with its own:
  • Process ID space
  • File system view
  • Network configuration
  • Resource controls
When you create an Application WPAR, AIX sets up:
  • A process namespace
  • A temporary root directory structure
  • Optional filesystem and network isolation
  • The specified application runs inside that namespace.
Creating an Application WPAR:
You can create an Application WPAR live, without rebooting the host.
Example: Run a Shell Inside an Application WPAR
# mkwpar -n appwpar1 -p /usr/bin/ksh
Explanation:
-n appwpar1 → WPAR name
-p /usr/bin/ksh → Run the ksh shell as the WPAR’s main process
The WPAR will exist only while that process runs.
Example: Run a Custom Application
# mkwpar -n db_wpar -p "/usr/bin/db2start"
This runs db2start inside an isolated application environment.
When the DB2 process exits, the WPAR is destroyed automatically.
Example: Hot (Live) WPAR with Network
# mkwpar -n appweb -p "/usr/sbin/httpd -D FOREGROUND" -N interface=en0 address=192.168.1.120
Adds a virtual network interface to the Application WPAR.

System WPAR:
A System WPAR is a virtual AIX environment (a full “mini-system”) that runs its own init process, file systems, users, network interfaces, and daemons, but still shares the same kernel as the global (host) AIX. It behaves like a standalone AIX instance — you can log in, run services, and administer it independently.

Steps to Configure a System WPAR:

1. Verify WPAR Filesets:
Make sure WPAR support is installed:
indaixwpr01 / # lslpp -l | grep wpar
  bos.wpars                  7.2.4.1  COMMITTED  AIX Workload Partitions
  bos.wpars                  7.2.4.1  COMMITTED  AIX Workload Partitions
indaixwpr01 / #

If missing, install them using:
# smitty installp

2. Create the System WPAR
indaixwpr01 / # mkwpar -n syswpar1 -N address=192.162.10.20 interface=en1 netmask=255.255.255.0 -i -I rtdest=0.0.0.0 rtgateway=192.162.10.1
**********************************************************************
Warning
mkwpar: 0960-125 network.address: 192.162.10.20/255.255.255.0 is not in the same network as any of the global interfaces.

**********************************************************************
mkwpar: Creating file systems...
 /
 /home
 /opt
 /proc
 /tmp
 /usr
 /var
Mounting all workload partition file systems.
x ./usr
...
...
installp:  APPLYING software for
...

3. Start the WPAR
indaixwpr01 / # startwpar syswpar1
**********************************************************************
Warning
ckwpar: 0960-125 network.address: 192.162.10.20/255.255.255.0 is not in the same network as any of the global interfaces.

**********************************************************************
Starting workload partition syswpar1.
Mounting all workload partition file systems.
Loading workload partition.
192.162.10.1 net default: gateway 192.162.10.1
Exporting workload partition devices.
Exporting workload partition kernel extensions.
Starting workload partition subsystem cor_syswpar1.
0513-059 The cor_syswpar1 Subsystem has been started. Subsystem PID is 6947308.
Verifying workload partition startup.
indaixwpr01 / #

indaixwpr01 / # df -g | grep wpars
/dev/fslv01        0.09      0.05   48%     2651    19% /wpars/syswpar1
/dev/fslv02        0.03      0.03    3%        7     1% /wpars/syswpar1/home
/opt               1.00      0.93    7%      297     1% /wpars/syswpar1/opt
/proc                 -         -    -        -      - /wpars/syswpar1/proc
/dev/fslv03        0.09      0.09    2%       22     1% /wpars/syswpar1/tmp
/usr               3.00      0.97   68%    38156    15% /wpars/syswpar1/usr
/dev/fslv04        0.25      0.24    3%      304     1% /wpars/syswpar1/var
indaixwpr01 / # ifconfig -a
en0: flags=e084863,14c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 192.168.20.13 netmask 0xffffff00 broadcast 192.168.20.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
en1: flags=e084863,14c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 192.168.10.13 netmask 0xffffff00 broadcast 192.168.10.255
        inet 192.162.10.20 netmask 0xffffff00 broadcast 192.162.10.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/64
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/64
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
indaixwpr01 / #

This boots the WPAR just like a standalone AIX system — you’ll see /etc/inittab processes, rc scripts, etc.


4. Log in to the WPAR
indaixwpr01 / # clogin syswpar1
*******************************************************************************
*                                                                             *
*                                                                             *
*  Welcome to AIX Version 7.2!                                                *
*                                                                             *
*                                                                             *
*  Please see the README file in /usr/lpp/bos for information pertinent to    *
*  this release of the AIX Operating System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************

#

You now have a shell inside the new virtual AIX environment.

You can verify:
# hostname
syswpar1
# lsdev
inet0  Available  Internet Network Extension
lo0    Available  Loopback Network Interface
pkcs11 Defined    ACF/PKCS#11 Device
pty0   Available  Asynchronous Pseudo-Terminal
sys0   Available  System Object
wio0   Available  WPAR I/O Subsystem
# df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
Global             0.09      0.05   48%     2653    19% /
Global             0.03      0.03    3%        7     1% /home
Global             1.00      0.93    7%      297     1% /opt
Global                -         -    -        -      - /proc
Global             0.09      0.09    2%       21     1% /tmp
Global             3.00      0.97   68%    38156    15% /usr
Global             0.25      0.24    3%      304     1% /var
#

You’ll notice:
Hostname = syswpar1
Limited device visibility (no physical disks)
Logical file systems mounted under /wpars/syswpar1

5. Configure File Systems:
Each WPAR can have its own logical filesystems.
To add or change one:
# chwpar -M dev=/wpars/syswpar1/var directory=/var type=jfs2 wpar=syswpar1
To see all file systems for a WPAR:
# lswpar -f syswpar1

6. Set Resource Limits:
You can control CPU, memory, and process limits.
Example – limit CPU to 25%:
# chwpar -R cpu=25 syswpar1
Or set memory limit to 2 GB:
# chwpar -R memory=2048M syswpar1

7. Check Network Configuration
Inside WPAR:
# ifconfig -a
You’ll see the virtual IP (192.168.1.50 in this example).
Network isolation is provided at the IP layer — the NIC itself (en0) remains owned by the global instance.

8. File System Structure on the Host
When you create a System WPAR, AIX sets up:
/wpars/syswpar1/
/wpars/syswpar1/root/
/wpars/syswpar1/usr/
/wpars/syswpar1/var/
/wpars/syswpar1/home/
These contain the WPAR’s root filesystem, user data, and logs.

9. Autostart on Host Boot
Add to /etc/rc.wpars:
# startwpar syswpar1
So the WPAR starts automatically when the host AIX system boots.

The smitty wpar interface provides administrators with structured menu-driven access to manage both System and Application Workload Partitions, including creation, startup and shutdown operations, configuration changes, file system management, networking, backup, and restore functions.

IBM AIX SMITTY WPAR MENU
========================

smitty wpar
|
+-- List All Workload Partitions
|
+-- Administer SYSTEM Workload Partitions
| |
| +-- List System Workload Partitions
| |
| +-- Create a System Workload Partition or Specification File
| | |
| | +-- Create a System Workload Partition
| | +-- Create a System Workload Partition (Advanced)
| | +-- Create a Specification File from a System Workload Partition
| | +-- Create a System Workload Partition from a Specification File
| |
| +-- Start / Stop / Reboot a System Workload Partition
| | |
| | +-- Start a System Workload Partition
| | +-- Start a System Workload Partition in Maintenance Mode
| | +-- Stop a System Workload Partition
| | +-- Reboot a System Workload Partition
| |
| +-- System Workload Partition Software Maintenance
| |
| +-- Change / Show System Workload Partition Characteristics
| | |
| | +-- Change / Show General Characteristics
| | |
| | +-- Change / Show Network Interfaces
| | | |
| | | +-- List All Network Interfaces
| | | +-- Add a Network Interface
| | | +-- Remove a Network Interface
| | |
| | +-- Change / Show File Systems
| | |
| | +-- List All File Systems
| | +-- List All Mounted File Systems
| | +-- Add a File System to the Mount List
| | +-- Remove a File System from the Mount List
| | +-- Mount a File System
| | +-- Unmount a File System
| |
| +-- Remove a System Workload Partition
| |
| +-- System Workload Partition Backup Manager
| |
| +-- Back Up a System Workload Partition
| | |
| | +-- Back Up a System Workload Partition to Tape/File
| | +-- Back Up a Workload Partition to CD
| | +-- Back Up a Workload Partition to DVD
| |
| +-- Restore a System Workload Partition
| +-- Preview Information about a Workload Partition Backup
| +-- List Filesets in a Workload Partition Backup
| +-- List Files in a Workload Partition Backup
| +-- Restore Files in a Workload Partition Backup
| +-- Verify the Readability of a Backup (Tape only)
|
+-- Administer APPLICATION Workload Partitions
|
+-- List Application Workload Partitions
|
+-- Create an Application Workload Partition or Specification File
| |
| +-- Create an Application Workload Partition
| +-- Create an Application Workload Partition (Advanced)
| +-- Create a Specification File from an Application Workload Partition
| +-- Create an Application Workload Partition from a Specification File
|
+-- Change / Show Application Workload Partition Characteristics
| |
| +-- Change / Show General Characteristics
| |
| +-- Change / Show Network Interfaces
| | |
| | +-- List All Network Interfaces
| | +-- Add a Network Interface
| | +-- Remove a Network Interface
| |
| +-- Change / Show File Systems
| |
| +-- List All File Systems
| +-- List All Mounted File Systems
|

+-- Stop and Remove an Application Workload Partition

Examples Commands:
1 To create a workload partition called roy, enter the following command:
mkwpar -n roy -N address=192.168.0.51
All values that are not specified are generated or discovered from the global system settings.
2 To create a workload partition based on an existing specification file, enter the following command:
mkwpar -f /tmp/wpar1.spec
3 To create a modified copy of a specification file with a new IP address, host name, and workload partition name (without creating a workload partition), enter
the following command:
mkwpar -f /tmp/wpar1.spec -N address=219.168.45.132 -h www.flowers.com -n wpar2
-o /tmp/wpar2.spec -w
4 To create a specification file, which is based on an existing workload partition, enter the following command:
mkwpar -e wpar1 -o /tmp/wpar2.spec -w
5 To recreate a workload partition that was previously removed with the rmwpar -p command, enter the following command:
mkwpar -p wparname
6 To create a rootvg workload partition, enter the following command:
mkwpar -n test -D devname=hdisk1 rootvg=yes -O
7 To create a rootvg workload partition called wpar1 with the storage device on an adapter, enter the following command (assuming that hdisk3 is attached to the
adapter, fcs2):
mkwpar -n wpar1 -D devname=fcs2 -D devname=hdisk3 rootvg=yes
8 To create a specification file from an existing workload partition, without including bootset related information, enter the following command:
mkwpar -e <existing wparname> -W -w -o <path to spec file>
9 To create a WPAR with a default route, enter the following command:
mkwpar -n wparB -N address=192.162.1.2 interface=en0 netmask=255.255.255.0 -i -I rtdest=0.0.0.0 rtgateway=192.162.1.1
10 To create a WPAR with its own routing table but no default route, enter the following command:
mkwpar -n wparA -N address=192.152.1.2 interface=en0 netmask=255.255.255.0 -i

Examples Commands:
1 To modify the host name of the workload partition called roy, enter the following command:
chwpar -h roy.com roy
2 To remove a network address from the workload partition called dale, enter the following command:
chwpar -K -N address=219.81.45.65 dale
3 To disable resource controls in the workload partition called wayne while retaining the settings for future use, enter the following command:
chwpar -R active=no wayne
4 To modify the bootlist attribute of a workload partition to the ordered list of bootset 1, bootset 2, and bootset 3, enter the following command:
chwpar -b bootlist=1,2,3 <wpar name>
5 To create a bootset that consists of hdisk3 and hdisk4 to a RootVG workload partition, enter the following command:
chwpar -B devname=hdisk3 -B devname=hdisk4 <wpar name>
6 To create a bootset that consists of hdisk3 and hdisk4 with the bootset ID 3 for a RootVG workload partition, enter the following command:
chwpar -B devname=hdisk3 bootset=3 -B devname=hdisk4 bootset=3 <wpar name>
7 To create a bootset to a non RootVG workload partition, enter the following command:
chwpar -B <wpar name>
8 To create a bootset on a certain volume group for a non RootVG workload partition, enter the following command:
chwpar -B vg=<volume group> <wpar name>
9 To create a bootset on a certain volume group with the bootset ID 5 for a non RootVG workload partition, enter the following command:
chwpar -B bootset=5 vg=<volume group> <wpar name>
10 To remove a bootset whose bootset ID is 3 from a workload partition, enter the following command:
chwpar -K -B bootset=3 <wpar name>
11 To unexport a device from a workload partition, enter the following command:
chwpar -K -D devname=hdisk1 <wpar name>
12 To export a device, enter the following command:
chwpar -D devname=hdisk1 devtype=disk <wpar name>
13 To rename the workload partition from moore to hart, enter the following command:
chwpar -n hart moore
14 To add an adapter, fcs2, to a workload partition named 'roy', enter the following command:
chwpar -D devname=fcs2 roy
15 To remove an adapter, fcs2, from a workload partition named 'roy', enter the following command:
chwpar -K -D devname=fcs2 roy

Examples Commands:
To start the workload partition called roy, enter:
startwpar roy

Examples Commands:
1 To log in to a workload partition named bucko as user dan, enter the following command:
clogin bucko -l dan
2 To run the /usr/bin/ps command with the -T 1 option as user root in a workload partition named howdy, enter the following command:
clogin howdy -l root /usr/bin/ps -T 1

Examples Commands:
1 To view tabular information about all workload partitions, enter the following command:
# lswpar
Name State  TypeHostnameDirectory  RootVG WPAR
-----------------------------------------------------------------------
bar  ASbar.austin.ibm.com  /wpars/baryes
foo  DSfoo.austin.ibm.com  /wpars/foono
trigger  AAtrigger /
2 To view limited tabular information about application workload partitions only, enter the following command:
# lswpar -t A -a name,application,script
Name  Application Script
------------------------------------------------------------
trigger  /usr/sbin/apachectl start  /home/joe/trigger.script

3 To view colon-separated general information with no headers for all active and defined workload partitions, enter the following command:
# lswpar -G -c -q -s AD
bar:A:S:bar.austin.ibm.com:/wpars/bar:/home/bar/wpar.scr:no:no:yes::no
foo:D:S:foo.austin.ibm.com:/wpars/foo::no:no:no::no
trigger:A:A:trigger:/:/home/joe/trigger.script
:no:no:yes:/usr/sbin/apachectl start:no

4 To view extended information about the workload partition named trigger, enter the following command:
# lswpar -L trigger
================
trigger - Active
================
GENERAL
Type:A
Hostname:triggerWPAR
-Specific Routing:  yes
Directory:  /
Start/Stop Script:/home/joe/trigger.script
Auto Start: no
Private /usr: no
Checkpointable:  yes
Application:/usr/sbin/apachectl start
NETWORK
Interface AddressMask/PrefixBroadcast
-----------------------------------------------------------------
en01.2.3.4255.255.255.0 1.2.3.255
en15.6.7.8255.255.255.0 5.6.7.255
USER-SPECIFIED ROUTES
Type DestinationGateway  Interface
---------------------------------------------------------------
net  9.1.2.241.2.3.1  en0
host 192.168.1.21.2.3.1  en1
FILESYSTEMS
MountPoint  DeviceVfs Nodename  Options
-----------------------------------------------------------------
/share/nfs2/share  nfs nfsserver rw
RESOURCE CONTROLS
Active:yes
RSet: isp1
CPU Shares:  2
CPU Limits:  5%-10%,50%
Memory Shares: 3
Memory Limits: 10%-20%,30%

Per-Process Virtual Memory Limit: 1024MB
Total Processes:  64
Total Threads: 1024
Total PTYs:  8
Total Large Pages:16
Max Message queue IDs:20%
Max Semaphore IDs:30%
Max Shared memory IDs:50%
Max Pinned memory:20%
OPERATION:
Operation:restart
Process ID:  905266
Start time:  11:19
Privileges:  PV_AU_,PV_AU_ADD,PV_AU_ADMIN,PV_AU_PROC,
 PV_AU_READ,PV_AU_WRITE,PV_AZ_ADMIN,
 PV_AZ_CHECK,PV_AZ_READ,PV_AZ_ROOT,PV_DAC_,
 PV_DAC_GID,PV_DAC_O,PV_DAC_R,PV_DAC_RID,
 PV_DAC_UID,PV_DAC_W,PV_DAC_X,PV_DEV_CONFIG,
 PV_DEV_QUERY,PV_FS_CHOWN,PV_FS_CHROOT
DEVICE EXPORTS
Name  Type  Virtual Device RootVGStatus
-----------------------------------------------------------------------------------------
hdisk4disk yes ALLOCATED
/dev/null pseudo ALLOCATED
/dev/tty  pseudo ALLOCATED
/dev/random  pseudo ALLOCATED
/dev/urandom pseudo ALLOCATED
/dev/console pseudo ALLOCATED
/dev/zero pseudo ALLOCATED
/dev/clonepseudo ALLOCATED
/dev/sad  clone  ALLOCATED

5 To view machine-readable network information that is separated by pipes for workload partitions called roy, enter the following command:
# lswpar -d'|' -N roy
#name|interface|address|mask_prefix|broadcast
roy|en0|192.168.1.50|255.255.255.128|192.168.1.127
roy|en1|2001:DB8::|32|

6 To view machine-readable, resource-control information for all workload partitions, enter the following command:
# lswpar -cR
#name:state:active:rset:shares_CPU:CPU:shares_memory:memory:procVirtMem:
totalProcesses:totalThreads:totalPTYs:
totalLargePages:pct_msgIDs:pct_semIDs:pct_shmIDs:pct_pinMem
dale:A:no:::::::
roy:A:yes:rogers:3::2::32:128
trigger:A:yes:isp1:2:5%-10%,50%:3:10%-20%,30%:1024MB:64:1024:8:
16:20%:30%:50%:20%

7 To view operation information about the workload partition named foo, enter the following command:
# lswpar T foo
=================================================================
foo - Transitional
=================================================================
Operation: restart
Process ID: 905266
Start time: 11:19
8 To view information about devices that are exported and allocated in the workload partitions named roy, enter the following command:
# lswpar -D roy
Name  Device NameType Virtual Device  RootVG Status
------------------------------------------------------------------
roy/dev/nullpseudo EXPORTED
...
royfcs0adapterEXPORTED
royhdisk2diskhdisk0yes
9 To view information about bootset of a RootVG workload partition, enter the following command:
lswpar -Br <WPAR name>
10 To view information about bootlist of a workload partition, enter the following command:
lswpar -b <WPAR name>
xxxxxxxxxxxxxxxx

Examples Commands:
1 To stop the workload partition called roy, enter:
stopwpar roy
2 To discontinue the shutdown processing for the workload partition called pinto after 85 seconds, enter:
stopwpar -t 85 pinto

Examples Commands:
1 To remove the workload partition called "roy", enter:
rmwpar roy
2 To stop and remove the workload partition called "roy", preserving data on its file system, enter:
rmwpar -p -s roy

No comments:

Post a Comment