”We have to implement new application that will have two environments: PROD and TEST, and we need it yesterday…..” This post is about a real thing. It shows how little time is required to create a new AIX “host” which is not lpar but wpar, and how wpar is “indistinguishable” from the “real” machine. For clarity, I renamed the test wpar/host to TEST and the “owning” it lpar to PROD.
I created one lpar with enough resources for these two environments (CPU, RAM, etc). By the way, all disks even the “boot” come to PROD and TEST via SAN. Next, I modified lpars /etc/hosts to include an entry describing the TEST environment host name and its IP address. It is time to build wpar!
Let’s make one wpar with its own rootvg! Bellow, you see all hdisks owned by PROD. One disk will be given to wpar (TEST) which will use as its rootvg hdisk.
PROD:/root>lspv
hdisk1 00cd683432d2c709 rootvg active
hdisk2 00cd68341891b769 None
hdisk3 00cd6834181aa3ea None
PROD:/root>bootinfo -s hdisk2
409600
PROD:/root>bootinfo -s hdisk3
20480
Hdisk2 is big! It will become TEST’s data volume group. Hdisk3 is smaller and big enough for a rootvg disk.
PROD:/root mkwpar -A -D devname=hdisk3 rootvg=yes -O -h TEST \
-l -n TEST -N interface=en0 address=159.14.245.56 netmask=255.255.255.0 \
-P -r -s -o /root/wpar.config
Creating workload partition's rootvg. Please wait...
mkwpar: Creating file systems...
/
/admin
/home
/opt
/proc
/tmp
/usr
/var
Mounting all workload partition file systems.
mkwpar: Copying base files...
….. ….
During wpar creation, its rootvg disk will be temporarily assigned to volume group called vg00. This disk like all disks assigned to wpar will eventually disappear from the lpar (PROD) inventory. Bellow, you see the vg00 – the wpar’s rootvg is not yet fully ready.
PROD:/root>lspv
hdisk1 00cd683432d2c709 rootvg active
hdisk2 00cd68341891b769 None
hdisk3 00cd6834181aa3ea vg00 active
After creation of wpar’s rootvg the installation process starts loading it with AIX.
…......... ….....
os.net.nfs.client 6.1.4.5 ROOT APPLY SUCCESS
ifor_ls.base.cli 6.1.0.0 ROOT APPLY SUCCESS
lum.base.cli 5.1.2.0 ROOT APPLY SUCCESS
Finished populating scratch file systems.
Workload partition TEST created successfully.
Starting workload partition TEST.
Mounting all workload partition file systems.
Loading workload partition.
Exporting workload partition devices.
hdisk3 Defined
Starting workload partition subsystem cor_TEST.
0513-059 The cor_TEST Subsystem has been started. Subsystem PID is 377058.
Verifying workload partition startup.
To display the state of the new wpar:
PROD:/root>lswpar
Name State Type Hostname Directory RootVG WPAR
-----------------------------------------------------------------------
TEST A S TEST /wpars/TEST yes
PROD:/root>
The wpar is Active and ready to be used. Now, let see what is going on with its rootvg disks.
PROD:/root>lspv
hdisk1 00cd683432d2c709 rootvg active
hdisk2 00cd68341891b769 None
PROD:/root>
The disk is gone, lpar no longer owns it. Fact to remember – each disk originally owned by lpar after acquiring by wpar disappears from the lpar inventory. Now it is time, to give TEST wpar another disk – the disk which will be used to create a volume group which file systems will be used to load the application binaries, data, and so forth.To assign PROD’s owned hdisk2 to the wpar, we need to execute:
PROD:/root>chwpar -D devname=hdisk2 devtype=disk TEST
Now, we need to login to wpar to put hdisk2 to use – to build a volume group.How to get there? Either execute clogin TEST or just telnet or ssh to open a login session. Once inside, let’s look around.
# lspv
hdisk0 00cd6834181aa3ea rootvg active
Something is missing. Where is hdisk2? I need to execute cfgmgr. After all , this is AIX, right?!.
cfgmgr;lspv
hdisk0 00cd6834181aa3ea rootvg active
hdisk1 00cd68341891b769 None
Hdisk name did change but its PVID tells us that this is the same disk! Next, executing df -g shows /usr dangerously low on free space.
TEST:/etc>df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
Global 0.09 0.04 62% 2668 24% /
/dev/hd4 0.09 0.04 62% 2668 24% /
/dev/hd2 4.38 0.19 96% 45642 50% /usr
/dev/hd10opt 0.50 0.28 44% 8823 12% /opt
/dev/hd11admin 0.03 0.03 3% 5 1% /admin
/dev/hd1 0.03 0.03 3% 5 1% /home
/dev/hd3 0.09 0.09 2% 15 1% /tmp
/dev/hd9var 0.12 0.06 52% 4406 24% /var
Global 0.12 0.12 2% 5 1% /etc/objrepos/wboot
Global - - - - - /proc
I need to increase /usr capacity.
TEST:/etc>chfs -a size=+1G /usr
Filesystem size changed to 11272192
Inlinelog size changed to 22 MB.
TEST:/etc>df -g | grep usr
/dev/hd2 5.38 1.18 78% 45642 15% /usr
As I look around, I receive an email to let me know that the requirements of the new TEST environment have changed and now it requires more storage then announced earlier. OK, I send a ticket to SAN Administrator to zone two LUNS to this lpar. The bigger LUN will used by PROD and the smaller one will go to TEST. Soon, he responds and cfgmr executed on the lpar (PROD) brings them in. For the second time, I have to assign one of them to wpar (TEST).
PROD:/root>bootinfo -s hdisk10
102400
PROD:/root>bootinfo -s hdisk11
491520
PROD:/root>
The smaller disk goes to wpar. The bigger one stays here, it will be used for PROD storage. Hdisk10 has to be assigned to the wpar.
PROD:/root>chwpar -D devname=hdisk10 devtype=disk TEST
I have a second PUTTY session open on TEST where I execute:
TEST:/etc>cfgmgr
TEST:/etc>lspv
hdisk0 00cd6834181aa3ea rootvg active
hdisk1 00cd68341891b769 None
hdisk2 none None
TEST:/etc>
Let’s build a volume group in TEST.
TEST:/etc>mkvg -f -y infoTST_vg -s 512 hdisk1 hdisk2
infoTST_vg
The rest is trivial, build logical volumes, then their file systems, change their permissions and ownership, mount them. Do not forget to create users and their group and then check and modify the entries in /etc/security. Do not assume that since wpar is a copy of lpar the copy is 100%. LPAR is not a NIM server for its WPARS. Each wpar /etc/security is the same “shape” as if you installed a new OS from CD or DVD.
Recent Comments