IBM Support

AIX WPARs - How to

Question & Answer


Question

This document describes the WPAR concept, methods of creation, installation, modifying and troubleshooting

Answer

Contents:
01. What Is WPAR.
02. Methods of WPAR creation.
03. Checking and modifying WPAR.
04. WPAR Cloning and backup/restore.
05. Wpar troubleshooting and Debug.



01. What Is WPAR:
----------------------
Workload Partitions (WPARs) are virtualized operating system environments that are
Created within a single AIX image.
While they may be self-contained in the sense that each
WPAR has its own private execution environment with its own filesystems and network
Addresses, they still run inside the global environment.
The global environment -- the actual LPAR -- owns all the physical resources of the
Logical partition.

- It is important to also note that the global environment can see all the processes running
Inside the specific WPARs.
WPAR has few types:
S => System workload partition
L => Versioned system workload partition (VWPAR)
A => Application workload partition

- The prerequisites to create WPARs are:
I) AIX 6.1 as a Global Environment.
II) The filesets:
bos.wpars => for WPAR binaries.
wio.common, wio.fcp, wio.vscsi => For WPAR I/O


02. Methods of WPAR creation:
--------------------------------------
Creating a WPAR can be done through multiple methods:

02.1. SMIT menu: # smitty wpar || # smitty mkwpar:

# smitty mkwpar
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

Each WPAR should have a unique name. The name GLOBAL is reserved surely
For the global environment.

* Workload Partition Name []
HOSTNAME []
Base Directory []
Default Volume group name [] +
Copy Global Name Resolution settings Yes +
Network INTERFACE +
Internet ADDRESS (dotted decimal)[]
Network MASK []
-ORIPv6
ADDRESS (colon delimited) []
Prefix Length []
WPAR-Specific Routing? No +
Create the Workload Partition? Yes +
Specification Output File [] /
START Workload Partition? No +
Start at system boot? No +
Automatically RESOLVE conflicts? No +
Architecture Compatibility +

02.2. Actual mkwpar command: # mkwpar:

For reference, The mkwpar can use the following options/flags:
-g → Will create all file systems owned by wpar using the capacity of the indicated
Volume group .
-h → Specifies the host name assigned to this wpar.
-l → Create private and writable /opt and /usr .
-n → Workload partition name .
-N → Network info follows .
-P → Set the root password interactively.
-r → Duplicate network name resolution services (/etc/resolv.conf and so forth).
-s → Start the wpar after creation .
-o → Create wpar.config file that can be used to re-create the wpar.
-D → [devname=device name] – To allocate device when creating the WPAR.

Example:
# mkwpar -g wparvg -h wpar1 -l -n wpar1 -P -r -s -o /var/wpar1.config

The example will create a WPAR with a specific hostname and wpar name, Also with
A dedicated ethernet adapter configured with network details.

You also can create rootvg wpars , which is a system WPAR configured with
Its own rootvg.

On one or more dedicated storage devices. Configuring a rootvg WPAR gives the WPAR
Admin complete control over managing:
– The storage devices exported to the WPAR.
– The VGs on those devices.
– The LVs and file systems within those volume groups.

A system WPAR- which is not a rootvg WPAR - does not have its own root volume
Group, but it has file systems created in logical volumes created out of the rootvg
Of the global system.

For a rootvg WPAR, storage devices must be exported (or allocated) to the WPAR when
It is created. After it has been created, the chwpar command can be used to allocate
Additional disks to the WPAR's rootvg or, if it contains multiple disks, to deallocate
A disk from the WPARs root volume group.

It is not possible to change a WPAR without its own root volume group into a rootvg
WPAR after it has been created.

A configuration with a WPAR owned root volume group (a RootVG WPAR) helps to
Isolate the filesystems and volume groups of a WPAR from the global system.
Rootvg WPAR can be created using the below command:
# mkwpar -l -n wpar2 -o /etc/wpar2.config -D devname=hdisk3 rootvg=yes

03. Checking and modifying WPAR:
-------------------------------------------
# lsvg -l wparvg
# lswpar
# startwpar [-v] wpar1
# stopwapar [-v] wpar1
# lswpar wpar1
# lswpar -L wpar1
# lswpar -t S testwpar

-t {[A][S][L][C]}: Filters the output based on workload partition types.

Name State Type Hostname Directory RootVG WPAR
----------------------------------------------------------------------------
wpar1 D S wpar1 /wpars/wpar1 no

WPAR States:
-----------------
D => Defined
L => Loaded
A => Active
F => Frozen
P => Paused
N => Maintenance
M => Moving
T => Transitional
B => Broken
E => Error

- Logging into WPAR:
# clogin wpar1
# uname -W --> To know the wpar ID (Global lpar will have ID 0).
# exit (Log out from the wpar environment into global Lpar)

- Stopping the WPAR:
# stopwpar testwpar (From the global Lpar).
# shutdown (From the wpar itself.)

- Removing the WPAR:
# rmwpar wpar1 (It should be stopped firstly.)
# rmwpar -p wpar1
This will do a preservation removal.
(i.e: Will remove the WPAR from the database without removing its local filesystems).

Hence, it can be used when creating a new wpar using existing
Filesystems.

-p
Performs a preservation removal of this workload partitionworkload
Partition. Configured local file systems (logical volumes or
Subdirectories within pre-existing logical volumes) are not
Emptied or removed. This flag is for System wpars only.
File systems preserved using this flag can be used with "mkpwar -p"
To create a new workload partitionworkload partition attached to them.

Example:
# mkwpar -n NEW_WPAR_NAME -p OLD_WPAR_NAME -d
/wpars/NEW_WPAR_NAME

– The entries in /etc/filesystems will get updated with the new mount points.
Changing wpar configuration:

- Add new IP address attribute:
# chwpar -N address=10.70.90.12 testwpar
This will add an alias IP to the default wpar ethernet.

- Delete the IP address attribute:
# chwpar -K -N address=10.70.90.12 testwpar
This will delete the IP address.

- Modify hostname attribute:
# chwpar -h NEW_HOSTNAME WPAR_NAME

* Wpar information database(s):

A- /etc/corrals/index file
Contains name and ID information of wpars
Example : 1 : S : wpar1 : 1
Definition: WparID:Type:Kernel_CID_value
- Kernel CID value is the index of entry in the kernel
WPAR table used for this wpar. 0 means not not running,
Any other value means it's running.

B- /etc/corrals/<wpar_name>.cf
Contains wpar configuration

C- /etc/filesystems -> Of the global Lpar
Contains all information about all filesystems of the global Lpar and wpars inside.
Specification file usage:
# mkwpar -e existing_wpar_name -o /tmp/wpar1.spec -w
-w: Writes the specification file only and do not create the wpar.
- Specification file can then be used to create a workload partition at a later time using
The -f flag.
- To create a workload partition based on an existing specification file, enter the
Following command:
# mkwpar -f /tmp/wpar1.spec
Or,
# mkwpar -f /tmp/wpar1.spec -n NEW_WPAR_NAME


04. WPAR Cloning and backup/restore:
-----------------------------------------------

To clone a wpar:
# mkwpar -e EXISTING_WPAR -n NEW_WPAR
Backup & Restore:
# savewpar -f BACKUP_FILE/DEVICE_PATH wpar_name

- It invokes the command # mkwpardata
Which creates the default directory: /tmp/wpardata/wpar_name

- The directory has the following files:
filesystems image.data image.info wpar.spec
# restwpar -f BACKUP_FILE/DEVICE_PATH

- You can add the flags:
`-n` new_wpar -d /wpars/new_wpar


05. Wpar troubleshooting:
-------------------------------
- Turn on WPAR debugging:

# export WPAR_SCREEN_LVL=D
# export WPAR_LOGFILE_LVL=D
- You can use the shell debug:
# sh -x /usr/sbin/wpar_command wpar_name >/var/adm/wpars/wpar.debug 2>&1
- Check for '-v' flag in a few wpar commands.
- Ask for the below files :
/var/adm/wpars/wpar.debug
/var/adm/wpars/event.log
/var/adm/ras/wpar.<wpar_name>.log
/etc/corrals/<wpar_name>.cf
/etc/corrals/index
/etc/filesystems







Thank you very much for taking the time to read through this guide.
I hope it has been not only helpful but an easy read. If you feel you have found any inconsistencies,
Please don’t hesitate to email me at ahdmashr@eg.ibm.com

Ahmed Mashhour

[{"Product":{"code":"SWG10","label":"AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"}],"Version":"6.1;7.1","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
17 June 2018

UID

isg3T1023516