AIX Container
AIX Container
Zeyuan Zhu
WPAR and Docker container. And I will show you how to perform some common
Container technology has become a hot topic in the IT world in the last few years,
partly as a result of the popularity of Docker and its high adoption rate. Container
provides workloads with isolated operating system environment instances, while all
the instances access the same kernel on the host. It has better cost efficiency than
the kernel. Another common feature that containers have is the encapsulation of its
runtime stack, which enables quick deployment and convenient mobility. These
characteristics align well with today's agile development methodology and the large
distributed environment that workloads run in. It also helps business consolidate
their workloads into fewer machines so that it reduces the administration cost.
It was first featured in AIX in 2007. The technology has matured over the years and
has successfully helped many AIX customers save resources and isolate workloads
from each other. Here I want to give a brief refresh on some features that AIX WPAR
NPIV, or vscsi) can be exported to and used inside WPARs as either rootvg or
used inside WPARs which allows direct provisioning of a lun. WPARs without
Shared vs. Non-shared WPARs: By default, a system WPAR shares the /usr
file system and the /opt file systems from the global environment using read-
writable /usr file system and /opt file system, which makes application
installation simpler. A non-shared WPAR is also the type of WPAR that you
WPAR using the image of the LPAR created by mksysb. This provides a way of
names and hostids. This makes a WPAR appear as a stand-alone system for
others as well as for the applications within it. Users may login to the WPAR
framework for saving WPAR backup images and restoring them later.
AIX 5.3 Versioned WPAR: AIX versioned WPAR feature provides its users
with the option to run workloads on AIX 5.3 in versioned WPARs as a tactical
solution until able to migrate to latest AIX version. Once ready, versioned
WPARs can be migrated to the same level as the LPAR using migwpar
command.
copy of the WPAR “bootset” to allow a quick roll-back in scenarios like testing
WPAR and Docker differ in a few aspects, but it's not as different as you would think
when it comes to managing the container. I'm going to show you the comparison of
some basic container management tasks. A very common task that's involved in
needs to launch a container instance to serve web applications. The example I'm
about to show you uses Websphere Liberty Profile to serve a sample web application
provided by IBM.
System Environment
The demonstration of the WPAR usage is executed in an AIX 7.2 environment on an
IBM POWER server. The Docker version of both the server and the client Docker
modules installed on the partition are 1.10.3 with API version 1.22, GoLang version
container configuration and the files that need to be in the container instance. It can
that's usually a script of some sort. Creating the container image enables quick
The Websphere Liberty Runtime that I used in this example can be downloaded
created is a private WPAR. Private WPARs have their own copies of /opt and /usr
filesystems. Option -s starts the WPAR after it is created. WPARs can have their own
IP addresses so that they are able to communicate with the public network just like
an individual server, it is also required in order to make the WPAR accessible from
Now that the WPAR is created, you can use your favorite tool to transfer the
Websphere Liberty runtime zip to the WPAR. Here I'm using scp.
ssh root@tyrant
cd /opt/ibm/
unzip wlp.tar
The Websphere Liberty runtime contains a utility program that you can use to install
an application from the IBM repository, it also resolves and installs dependency
To save this WPAR instance to an image file, you can now go back to the terminal of
Docker hub is a registry service that allows Docker users to manage images in a
centralized way. The official Docker hub has a collection of ppc64le Docker images
available to pull and there is a Websphere Liberty image that already contains the
runtime stack Docker needs to run Websphere Liberty. But for the sake of
comparison, I'm going to show you how to build a Websphere Liberty image based
First you have to pull the base image that you will build your own image upon. In
Now that you have a base image, launch a container that we're going to use to create
technology, Docker by default can't simply just assign an allocated public IP address
to the container that it is going to create. The most common way for a Docker
container to talk to the public network is to map ports to ports on its host. We will
go over that later when we launch the actual instance for serving the web
application. The –it is required if a tty needs to be allocated for the container. The
–d option leaves the container to start in the background as we need to copy the zip
Once container is created, copy the Websphere Liberty runtime zip file using the
docker cp interface.
docker cp /tmp/wlp.zip wlp_prep:/opt/ibm/
Get into the terminal of the container using docker attach and unzip the wlp.zip
cd /opt/ibm/
unzip wlp.zip
At this point, we have a new local image saved that is named daytrader3sample
We use restwpar to launch a WPAR instance from the image file that has been saved,
the parameters required are the path to the base filesystem of the WPAR and the
network specification.
The WPAR is up and running, now ssh to the WPAR and start the web server.
ssh root@toyman
daytrader3sample:latest /bin/bash
Here, we're mapping the ports 9080 in the container to the port 9080 on its host,
this way all the packets sent to port 9080 on the host will be routed to port 9080 of
The commands that are used to stop, restart and remove container instances
are quite straight forward, and they're almost identical for both WPAR and
Docker.
WPAR Docker
stop stopwpar Docker stop
start startwpar Docker start
remove rmwpar Docker rm
filesystem
When a private WPAR is created, the complete /opt and /usr filesystems are
copied to the WPAR's own filesystems, the usually large sizes of these two
filesystems would make operations on the WPAR take more time and result in a
larger image file. Although there are scenarios where keeping private copies of these
filesystems are necessary and beneficial, in some cases this would be unnecessary.
For example, Websphere Liberty keeps everything under its root path
to be private writable space for the WPAR while sharing the rest of the /usr and
/opt filesystem with the host with only read permission. The solution to achieve
this is to use a shared WPAR instead of a private WPAR and create the filesystem
that the WPAR needs write permission for. To do this, the only step involved from
the demonstration I showed above is mkwpar. First we create the mount point for
the wlp directory that the WPAR is going to use to mount the writable filesystem
mkdir –p /opt/ibm/wlp
wpar.
There is much similarity between how you manage WPARs and Docker containers.
demonstration grouped by main steps in order to give you a clear view of the
similarities.
Launching an Instance
Start the Container
restwpar –s -F -f /tmp/daytrader.bff -n name -d docker run -itd -p 9080:9080 -p 9443:9443 –name
/wpars/name -M '-N netattr' name daytrader:latest /bin/bash
Stopping an Instance
stopwpar name docker stop name
Removing an Instance
rmwpar name docker rm name
Summary
I hope that this paper helps you as a guideline to start exploring the native container
technology on IBM AIX. As we have seen in this paper, the ways to perform some
basic container management tasks are quite similar between WPAR and Docker.
There are many additional aspects of the two container technologies that would be
interesting to investigate. I might write more about containers on AIX in the future
and I also encourage you to implement your container strategy exploiting the AIX