Monday, December 31, 2007

Comparing WPARs with LPARs

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.

Using WPARs

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: lswpar

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 /wpars/.

Listing 1. lswpar command output
# lswpar
Name State Type Hostname Directory
mywpar D S mywpar /wpars/mywpar

To start your new WPAR and log in, run the following command: startwpar mywpar

Running the 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: clogin mywpar

The AIX welcome message and command prompt displays. You have created, started, and logged in to your first WPAR! Run the hostname 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 the 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 exit command. Then to stop the WPAR, just type: stopwpar mywpar

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 smit to display the initial SMIT menu. You’ll see a new menu choice, Workload Partition Administration.

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 sub-menu: 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 []
* 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 type the 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. Enter lswpar again to verify that the WPAR no longer exists.

WPAR Manager

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.


Narender said...

hi Santosh, Are you brother of Rajesh from Kalwa? Narinder

Santosh Gupta said...

Yes Sir. How are you doing. mail me at

SeanPof said...

Appreciate the effort! You helped me a lot!