Getting started with Workload Partitions in AIX 6.1
If you are a systems administrator who is responsible for care and feeding of IBM® System p™ servers, you are probably familiar with virtualization and server consolidation using logical partitions (LPARs). Using the Hardware Management Console (HMC) or the Integrated Virtualization Manager (IVM), you can quickly define a new LPAR, install AIX® or Linux®, configure your operating system, install applications, and then put your new virtual server to work.
AIX 6.1 introduces a new mechanism for virtualization: Workload Partitions (WPARs). In this article, you'll learn the basics of what WPARs are, how they differ from LPARs, and how you can quickly and easily try them out on your AIX 6.1 system. This article also provides some basic rules of thumb to help you decide which virtualization method is most appropriate for you and walks you through the steps to create your first WPAR. Then, you’ll examine additional life cycle management tasks that you can perform from the AIX command line or System Management Interface Tool (SMIT). Because this article is intended to be only a high-level introduction, you'll find some links to information that help you learn all the technical details about this new technology. Finally, you'll review some more advanced WPAR features, including Live Application Mobility—the ability to move a running WPAR-based application from one AIX system to another—using a new management tool, the IBM Workload Partitions Manager for AIX (WPAR Manager).
What are WPARs?
In contrast to LPARs, which are created and managed at the server's firmware level, AIX WPARs are software partitions that are created from, and share the resources of, a single instance of the AIX operating system. This means that you must have AIX 6.1 to create WPARs, but you can create WPARs on any System p hardware that supports AIX 6.1, including POWER4, POWER5, and POWER6 hardware. You don’t need an HMC or IVM to create or manage WPARs.
There are two kinds of WPARs:
- System WPARs
- Application WPARs
System WPARs are autonomous virtual system environments that have their own private file systems, users and groups, login, network space, and administrative domain. To users and applications, a system WPAR appears almost exactly like a full AIX system. Operating system services, such as telnet, are supported, so if network information has been configured, users can telnet into a system WPAR as root or any other defined user, issue commands, and run applications as they would on any other AIX system.
Here are a couple of quick examples of situations in which system WPARs might be useful:
- If you happen to be an administrator for an AIX system used in a
university computer science class, you can create a system WPAR for
each student. Students can each be the root user of their own private
virtual environment—defining users, installing applications,
and programming their class assignments. If a student is persuaded to
find out what happens when you type
rm –r *, only their WPAR is trashed—catastrophic events in one WPAR can't harm other WPARs or the global AIX environment. At the end of the semester, you might run a script that deletes and cleans up all the class WPARs.
- If you are setting up an application development or test environment, you can create it in a system WPAR. You don't have to acquire a dedicated server or LPAR but, if the new environment should have serious problems, any adverse effects will be confined to the WPAR.
Application WPARs provide an environment for isolation of applications and their resources to enable checkpoint, restart, and relocation at the application level. An application WPAR is essentially a wrapper around a running application or process for the purposes of isolation and mobility. It lacks some of the system services provided by system WPARs—for example, it’s not possible to log in or telnet into an application WPAR. When the application running in an application WPAR terminates, the WPAR also ceases to exist. Application WPARs are most useful when you want to enable Live Application Mobility—that is, when you want to be able to move a running application from one AIX system to another. You might want to relocate applications to avoid downtime resulting from scheduled maintenance or to improve performance by moving an application to a more powerful server.
How do WPARs compare with LPARs?
As noted earlier, you do not need access to the HMC or IVM to create WPARs as you do for LPARs. WPARs are lightweight and quicker to install, because they share many of the file systems and resources of the global AIX system in which they reside. While using an LPAR requires you to install an entire operating system, creation of system WPARs only installs private copies of a few file systems, and application WPARs share even more of the global system's resources. As a result, a WPAR can be created in just a few minutes without installation media. Ongoing administration and maintenance of WPARs should be simpler—fewer AIX licenses might be required, and you don’t have to install fixes and updates on so many virtual systems. There is a command for synchronizing the filesets of a WPAR with the corresponding filesets on the global system, so you have the choice of propagating AIX fixes to WPARs or continuing to run with the current versions of system files.
While LPARs offer a significantly higher degree of workload isolation, WPARs might provide "good enough" isolation for your particular workloads, especially temporary ones such as development or test environments. Similarly, with LPARs, you can achieve a greater degree of control over the usage of resources—by allocating entire processors or precise fractions of processors to an LPAR, for example. With WPARs, you don’t have such fine control over resource allocations, but you can allocate target shares or percentages of CPU utilization to a WPAR (if have used the AIX Workload Manager, you will find the share and percentage resource allocation scheme familiar). Similar differences exist for the allocation of memory, number of processes, and other resources.
Are you ready to create your first workload partition? All you need to get started is the capability to log in as the root user on an AIX 6 system—the official 6.1 product version is the most up-to-date but, if you happen to have downloaded an early copy during the Open Beta program, you can use that for basic WPAR operations.
Define a WPAR
Log in as root on your AIX 6 system, and run the following command:
mkwpar –n mywpar
That is all you need to do to create a system WPAR whose name is mywpar. After pressing the Enter key, a long series of messages display on the console that look very similar to those you see during a typical AIX installation. After a few minutes, a message displays, followed by a command prompt indicating that the WPAR creation is complete. To verify that your WPAR was created, run the following command to list all defined WPARs:
Listing 1 displays a table showing the WPAR named
mywpar that you just created. The D in the
State field means the WPAR is Defined; it exists,
but it has not been started. It has a type of S—that is,
it’s a system WPAR, because the
mkwpar command creates system
WPARs by default. Also by default, the hostname is the same as the WPAR
name, and the base directory for all the WPAR’s filesets is located at
# lswpar Name State Type Hostname Directory --------------------------------------------- mywpar D S mywpar /wpars/mywpar #
To start your new WPAR and log in, run the following command:
lswpar command again indicates that state of the
WPAR changed from D to A (for Active).
You have not defined network information for this WPAR, so unless the name you picked for your WPAR already resolves to a valid network address, you probably won’t be able to do any kind of network login yet. Since you are still on the system console, do a console login to the new WPAR:
The AIX welcome message and command prompt displays. You have created,
started, and logged in to your first WPAR! Run the
command to confirm this.
From this point, you can run most AIX commands, define other users, and do most anything you would do with a full AIX system.
Once you have logged into the WPAR, there is one important point to
remember: From the WPAR, you have no access to the global system or to any
other WPAR. So some familiar commands or SMIT menus will not work as they
usually do, or they might be missing altogether. For example, if you enter
hostname command, it returns the name of the WPAR and not
the hostname of the global AIX system. So for now, let’s leave the WPAR,
and return to the global AIX environment by typing the
command. Then to stop the WPAR, just type:
Using SMIT to change WPAR properties
How about using SMIT to define an IP address for the new WPAR? Of course,
you can also do this using the command line, since SMIT is just a command
processor. On the global AIX command line, type
display the initial SMIT menu. You’ll see a new menu choice, Workload
After selecting Workload Partition Administration, you’ll see three choices:
List All Workload Partitions Administer SYSTEM Workload Partitions Administer APPLICATION Workload Partitions
The first choice, List All Workload Partitions, executes the
lswpar command to show all defined WPARs on your system.
Choose Administer SYSTEM Workload Partitions to work with the
WPAR you defined earlier. This selection displays the following
List System Workload Partitions Create a System Workload Partition or Specification File Start / Stop / Reboot a System Workload Partition System Workload Partition Software Maintenance Change / Show System Workload Partition Characteristics Remove a System Workload Partition System Workload Partition Backup Manager
You do not need to create a WPAR, so select Change / Show System Workload Partition Characteristics, which results in the following submenu:
Change / Show General Characteristics Change / Show Network Interfaces Change / Show File Systems
The first choice, Change / Show General Characteristics, displays an input panel that lets you view or change the basic WPAR properties, such as the WPAR name, hostname, start options, and more advanced settings, including resource controls and security settings. You set out to work with network settings, so select Change / Show Network Interfaces, which results in the following data entry fields:
[Entry Fields] * Workload Partition Name  + Network INTERFACE + * Internet ADDRESS (dotted decimal)  Network MASK 
- Type or select the WPAR name in the Workload Partition Name field.
- In the Network INTERFACE field press F4 or Esc+4 to show the list of available network interfaces. Select the one that you want to use, then enter a valid IP address and network mask in the remaining fields
If you plan to define a bunch of WPARs, you’ll need to secure in advance a group of available hostnames and IP addresses in your network.
After completing the panel for adding a network interface, you can start
the WPAR, either by using SMIT menus, or issuing the
startwpar command from the command line. After the WPAR has
started, you should be able to log in remotely using telnet. Don’t forget
to set a root password and any other security measures that you normally
take when setting up a new AIX system. You might also want to add a line
to the /etc/hosts file on the global system containing the hostname and IP
address of the new WPAR.
Now that you can log in to your new system WPAR, either from the system console or remotely, you can do many of the things you would do with any new AIX system: create users, create new file systems, or install software. Regarding software installation, you might use NIM to perform network installs. Or, you can add a CD-ROM file system to the WPAR, which enables you to use a CD-ROM attached to the physical server to install software on the WPAR.
Creating and using application WPARs
Creating an application WPAR is similar to creating a system WPAR. However,
instead of the
mkwpar command, you use the
wparexec command, which not only creates the WPAR, but it
also starts the application inside it. As previously noted, an application
WPAR only exists so long as the application process is running. Once the
process terminates, the WPAR is stopped and cleaned up.
To create an (somewhat trivial) application WPAR named mywpar that will sleep for 100 seconds, enter the command:
wparexec –n myappwpar /usr/bin/sleep 100 &
After pressing Enter, several messages display indicating
that the WPAR is starting and that file systems are being mounted. If you
lswpar command, the following displays:
# lswpar Name State Type Hostname Directory --------------------------------------------- myappwpar A A myappwpar / #
This information indicates that a WPAR named myappwpar exists, that it is
in an active state, and that it is an Application WPAR. After 100 seconds,
a message displays that the system is shutting down all WPAR processes.
lswpar again to verify that the WPAR no longer
IBM Workload Partitions Manager for AIX (WPAR Manager) is a platform management solution that provides a centralized point of control for managing workload partitions across a collection of managed systems running AIX 6.1. The managed systems might all be LPARs on a single physical server, or they might be located on multiple physical servers. Using WPAR Manager, you can monitor the health and status of multiple WPARs on multiple managed AIX systems. You can also perform all the basic WPAR life cycle operations—including create, view and manage properties, start, stop, and delete.
WPAR Manager also supports relocation of WPARs between systems in a collection of managed servers. WPAR Manager supports two kinds of relocation:
- Manual relocation—This type of relocation is initiated by the user.
- Policy-based relocation—This type of relocation is initiated by WPAR Manager in response to workload conditions defined in a relocation policy.
WPAR Manager is not part of AIX—it’s a separately purchased licensed program (Program number 5756-WPM). But, if you are working with an AIX 6 image that you downloaded during the Open Beta program, you might have the early version of WPAR Manager that was shipped with the beta. This article only touches on the main capabilities of WPAR Manager. A later article will present a more detailed description of how it works and how to use it.
Managing WPARs on multiple AIX systems using the WPAR Manager requires two initial installation and configuration steps. First, you install and configure the management server software on an AIX system in your environment. Then, you install the WPAR Manager agent software on each AIX system that will be managed by WPAR Manager. The agent must then be configured to share WPAR data with a specific management server. After the WPAR Manager and agent components have been configured and started, the WPAR Manager automatically discovers all the managed systems, and begins to record data transmitted by the agents in an internal database.
One of WPAR Manager’s main resource views shows all managed AIX systems—that is, all AIX systems on which the WPAR Manager’s agent software has been installed and configured to communicate with the WPAR Manager server. This view provides information about the characteristics of each managed system, including its current operational state and connectivity with the WPAR Manager. From this view, you are able to drill down to see all the WPARs defined on any of your managed systems. You can also create and delete WPARs and perform any other life cycle tasks.
Figure 1. WPAR Manager systems view
Another main resource view shows all defined WPARs in your management environment. The WPARs in the list can be in one of several states:
- Active on one of the managed systems.
- Deployed on a managed system, but not currently running.
- Undeployed, that is, defined in the WPAR Manager’s database, but not yet deployed to any managed system.
There are also several other transitional and error states.
Figure 2. WPAR Manager WPARs view
In addition to the main resource views and associated task panels, the WPAR Manager contains both wizard and power user interfaces for creating WPARs and WPAR groups and for relocating WPARs from one system to another. There are also panels for viewing the status of tasks that you have initiated and for monitoring the performance of WPARs over time.
Live Application Mobility
Live Application Mobility is the capability to relocate a WPAR from one hosting system to another without having to restart any applications or processes running in the WPAR. (Live Application Mobility is the term seen in marketing materials, while the WPAR Manager’s user interface uses relocation.) It is important not to confuse Live Application Mobility with another recently announced feature of POWER6 servers: Live Partition Mobility. Partition mobility refers to the ability to move an entire running AIX LPAR from one physical server to another. Being a hardware-based function, partition mobility is only supported on POWER6 hardware; application mobility is supported on any hardware that supports AIX 6.
When a WPAR is relocated using WPAR Manager, all processes are checkpointed and then restarted on the target system, with minimal impact on the application or WPAR user. Although it is possible to use AIX commands to checkpoint a WPAR, copy critical files to another system, and then restart the WPAR on the target system, it is not easy, and the relocation might fail due to user error. Another important reason to use WPAR Manager to relocate WPARs is that it also offers an automated recovery mechanism. If, for whatever reason, the relocation process goes bad, WPAR Manager can be successful in restoring the WPAR to its original location and state. Log files and task status displays in the graphical user interface let you know if a task failed and provide stderr output to help understand what went wrong.
WPAR Manager also has the capability to monitor performance of workloads running in WPARs and relocate those workloads to different AIX systems to improve performance. For example, if CPU or memory usage in a WPAR or group of WPARs is, on average, higher than a value that you specify, then the WPAR Manager might attempt to relocate one or more WPARs to a more powerful, or less busy, server in your datacenter. The detailed mechanics of how the policy engine works are beyond the scope of this article, but will be covered in a later article.
WPAR Manager Information Center
The WPAR Manager Information Center is available from any panel in WPAR Manager by clicking on the Help link at the top of the WPAR Manager browser window. The same material is available in the AIX Information Center—look under the "IBM Workload Partitions Manager for AIX" heading (see Resources).
You can access help for individual pages by clicking the question mark icon at the upper right of any active WPAR Manager page. The page help provides detailed information on how to interact with the page being viewed.
In this article, you learned the following basics of workload partitions in AIX 6.1:
- WPARs are software-based partitions that extend and complement the System p server’s hardware-based LPARs.
- There are two types of WPARs: System and Application. Which is best for you depends on your requirements for workload isolation, mobility, and how complete an operating environment you need.
- You can create a WPAR quickly using either AIX commands or SMIT.
- Other commands and SMIT menus let you modify, start, stop, or remove WPARs.
- The WPAR Manager, a separate licensed program, extends WPAR management to multiple systems, and supports relocation of WPARs from one system to another.
The information presented here should encourage you to try out WPARs in your AIX 6.1 environment, and see for yourself what this new virtualization capability can do for you.
- AIX commands reference: Get more detailed usage information on individual commands and their parameters.
- The AIX Information center has additional information on IBM Workload Partitions for AIX and IBM Workload Partitions Manager for AIX.
- IBM Redbooks: Read Introduction to Workload Partition Management in IBM AIX Version 6 for comprehensive treatment of WPARs and WPAR Manager.
- AIX and UNIX: The AIX and UNIX developerWorks zone provides a wealth of information relating to all aspects of AIX systems administration and expanding your UNIX skills.
- New to AIX and UNIX?: Visit the New to AIX and UNIX page to learn more about AIX and UNIX.
- AIX Wiki: Discover a collaborative environment for technical information related to AIX.
- Search the AIX and UNIX library by topic:
- developerWorks technical events and webcasts: Stay current with developerWorks technical events and webcasts.
- 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.
- Participate in the developerWorks blogs and get involved in the developerWorks community.
- Participate in the AIX and UNIX forums:
Dig deeper into AIX and Unix on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Keep up with the best and latest technical info to help you tackle your development challenges.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.