WPAR - Best Practise

WPAR (Workload PARtition):

 WPAR is a miniature of the AIX (The AIXs running inside the AIX), Can be moveable from one server to another without disrupting main AIX. We can create more WPARs in the server.


Requirements:

AIX6 and Power6

WPAR Manager,

WPAR Agents,

NFS share with 1GB minimum

Setup:

WPAR Name: App1WPAR

Participating Nodes:
lb511p014_pub (can act as WPAR Manager too)
lpar23ml162f_pub


Increase the size of the /var:

lb511p014_pub[/] > chfs -a size=800000 /var

Filesystem size changed to 1048576

Creating a NFS share for WPAR:

lb511p014_pub[/] > crfs -v jfs2 -g rootvg -m /wpars -A yes -a size=1G

File system created successfully.

1048340 kilobytes total disk space.

New File System size is 2097152

lb511p014_pub[/] > mount /wpars

lb511p014_pub[/] > chmod 700 /wpars

lb511p014_pub[/] > vi /etc/exports

lb511p014_pub[/] > exportfs -a

lb511p014_pub[/] > cat /etc/exports

/wpars -rw,access=lb511p014_pub:lb424p017_pub:App1WPAR,root=lb511p014_pub:lb424p017_pub:App1WPAR



lb511p014_pub [/] > stopsrc -g nfs

0513-044 The biod Subsystem was requested to stop.

0513-044 The rpc.statd Subsystem was requested to stop.

0513-044 The rpc.lockd Subsystem was requested to stop.

lb511p014_pub [/] > stopsrc -s portmap

0513-044 The portmap Subsystem was requested to stop.

lb511p014_pub [/] > startsrc -s portmap

0513-059 The portmap Subsystem has been started. Subsystem PID is 127206.

lb511p014_pub [/] > startsrc -g nfs

0513-059 The biod Subsystem has been started. Subsystem PID is 69842.

0513-059 The nfsd Subsystem has been started. Subsystem PID is 253956.

0513-059 The rpc.mountd Subsystem has been started. Subsystem PID is 458926.

0513-059 The nfsrgyd Subsystem has been started. Subsystem PID is 463000.

0513-059 The gssd Subsystem has been started. Subsystem PID is 446568.

0513-059 The rpc.lockd Subsystem has been started. Subsystem PID is 442608.

0513-059 The rpc.statd Subsystem has been started. Subsystem PID is 393222.



lb511p014_pub [/] > lssrc -g nfs

Subsystem Group PID Status

biod nfs 69842 active

nfsd nfs 253956 active

rpc.mountd nfs 458926 active

rpc.lockd nfs 442608 active

rpc.statd nfs 393222 active

nfsrgyd nfs inoperative

gssd nfs inoperative



lpar23ml162f_pub[/] > lssrc -s portmap

Subsystem Group PID Status

portmap portmap 127206 active

WPAR Package Source:

lb511p014_pub[/] > ls -al /stage/middleware/AIX/WPM/installp/ppc

total 371864

drwx--S--- 2 root system 4096 Mar 26 2009 .

drwx--S--- 3 root system 256 Mar 26 2009 ..

-rwx------ 1 root system 76418 Mar 26 2009 .toc

-rwx------ 1 root system 88062976 Mar 26 2009 cas.agent

-rwx------ 1 root system 7203328 Mar 26 2009 mcr.rte

-rwx------ 1 root system 1559552 Mar 26 2009 tivoli.tivguid

-rwx------ 1 root system 486400 Mar 26 2009 wparmgt.agent

-rwx------ 1 root system 23630848 Mar 26 2009 wparmgt.cas.agentmgr

-rwx------ 1 root system 40960 Mar 26 2009 wparmgt.db

-rwx------ 1 root system 803840 Mar 26 2009 wparmgt.license

-rwx------ 1 root system 39651328 Mar 26 2009 wparmgt.lwi

-rwx------ 1 root system 28839936 Mar 26 2009 wparmgt.mgr

-rwx------ 1 root system 17408 Mar 26 2009 wparmgt.msg.en_US

Installation of WPAR manager:

lb511p014_pub[/] > installp -acXYgd /stage/middleware/AIX/WPM/installp/ppc wparmgt.mgr

Configuration of WPAR manager:

lb511p014_pub[/] > /opt/IBM/WPAR/manager/bin/WPMConfig.sh -i console

Note: Pls choose the good password and remember the same while configuring the agent

Installation of WPAR agent in the WPAR manager:

lb511p014_pub[/] > installp -acXYgd /stage/middleware/AIX/WPM/installp/ppc wparmgt.agent

Configuration of WPAR agent in the WPAR manager:

lb511p014_pub[/] > /opt/IBM/WPAR/agent/bin/configure-agent -amhost lb511p014_pub -prompt

Note: It will prompt the WPAR manager registration password

BTC7861I Checking if the common agent is already registered...done


BTC7866I The common agent registration password...

Enter password: ********
Retype password: ********

BTC7872I Checking the common agent state...the common agent is not running


Resolved configuration:

The common agent connection information:

name = localhost

port = 9510

jport = 9514

nport = 9515

wport = disabled

wsport = disabled

The agent manager information:

Common agent managed by the agent manager

amhost = lb511p014_pub

amport = 9513

ctxroot = /AgentMgr

The common agent service information:

noinstall = false

nostart = false



BTC7878I Validating the resolved configuration of the common agent...done

BTC8623I Validating the connection to the agent manager...done

BTC8624I Validating the registration password...done



BTC7880I Configuring the common agent...done

BTC7881I Installing the common agent service...done

BTC7882I Starting the common agent...done


Installation of WPAR agent in second server:

lb424p017_pub[/] > installp -acXYgd /stage/middleware/AIX/WPM/installp/ppc wparmgt.agent

Configuration of WPAR agent in second server:

lb424p017_pub[/] > /opt/IBM/WPAR/agent/bin/configure-agent -amhost lb511p014_pub -prompt

BTC7861I Checking if the common agent is already registered...done

BTC7866I The common agent registration password...

Enter password: ******
Retype password: ******

BTC7872I Checking the common agent state...the common agent is not running



Resolved configuration:

The common agent connection information:

name = localhost

port = 9510

jport = 9514

nport = 9515

wport = disabled

wsport = disabled

The agent manager information:

Common agent managed by the agent manager

amhost = lb511p014_pub

amport = 9513

ctxroot = /AgentMgr

The common agent service information:

noinstall = false

nostart = false



BTC7878I Validating the resolved configuration of the common agent...done

BTC8623I Validating the connection to the agent manager...done

BTC8624I Validating the registration password...done



BTC7880I Configuring the common agent...done

BTC7881I Installing the common agent service...done

BTC7882I Starting the common agent...done



lb511p014_pub[/] > ls -al /wpars
total 80

drwx------ 19 root system 4096 Oct 23 09:26 .

drwxr-xr-x 25 root system 4096 Oct 23 07:39 ..

drwxr-xr-x 2 root system 256 Oct 23 09:23 App1WPAR

drwxr-xr-x 3 root system 256 Oct 05 2007 admin

drwxr-x--- 2 root audit 256 Oct 05 2007 audit

lrwxrwxrwx 1 bin bin 8 Oct 23 09:23 bin -> /usr/bin

drwxrwxr-x 2 root system 256 Oct 23 09:23 dev

drwxr-xr-x 29 root system 16384 Oct 23 09:28 etc

drwxr-xr-x 4 bin bin 256 Oct 23 09:23 home

lrwxrwxrwx 1 bin bin 8 Oct 23 09:23 lib -> /usr/lib

drwx------ 2 root system 256 Oct 23 06:52 lost+found

drwxr-xr-x 176 bin bin 8192 Oct 23 09:28 lpp

drwxr-xr-x 2 bin bin 256 Oct 05 2007 mnt

drwxr-xr-x 2 root system 256 Oct 23 09:23 opt

drwxr-xr-x 2 root system 256 Oct 23 09:23 proc

drwxr-xr-x 3 bin bin 256 Oct 23 09:24 sbin

drwxrwxr-x 2 root system 256 Oct 23 09:26 tftpboot

drwxrwxrwt 3 bin bin 4096 Oct 23 09:28 tmp

lrwxrwxrwx 1 bin bin 5 Oct 23 09:23 u -> /home

drwxr-xr-x 2 root system 256 Oct 23 09:23 usr

drwxr-xr-x 28 bin bin 4096 Oct 23 09:28 var

drwxr-xr-x 2 root system 256 Oct 23 09:23 wpars



lb511p014_pub[/] > du -sm /wpars

134.92 /wpars

Start WPAR in lb511p014_pub server:

lb511p014_pub[/] > startwpar App1WPAR



After Successful starting of WPAR in lb511p014_pub server,



lb511p014_pub[/] > lswpar

Name State Type Hostname Directory

-------------------------------------------------

App1WPAR A S App1WPAR /wpars/App1WPAR



Finally, 

Login to WPAR,


lb511p014_pub[/] > clogin App1WPAR2



You can move the WPAR to the second server while online by using

“ IBM PowerVM workload partition manager “

URL: https://lb511p014_pub:14443/ibm/console

lb424p017_pub[/] > lsconf |grep -i machine

Machine Serial Number: 108E424

The following resources are installed on the machine.


Hints:

To Uninstall:

installp -ug wparmgt.agent
installp -ug wparmgt.mgr

WPAR Commands:

Most of these commands are only runable by root user for the Global LPAR (Global
Environment).

chwpar Modifies dynamically the configuration options of the WPAR even when it is
running.

clogin Provides a mechanism for the root user to log in or run a command within a workload partition. The “clogin” command uses a pseudo-terminal allocated on the Global Environment (see in the mobility part the impact of this) and creates a login shell running which belongs to the workload partition.

lswpar Prints information about WPARs

mkwpar Specific for System WPAR - Builds the infrastructure and the configuration file. Then it creates and populates the WPARs file systems. Allocate the specified resources as well as the WLM information (if any) and eventually starts it. Specifying whether the workload partitions should be automatically started on system boot or when /etc/rc.wpars is executed.

startwpar Activates the System WPAR defined with mkwpar

wparexec Specific for Application WPAR – Builds, create specification file and eventually starts the Application WPAR

rebootwpar Stops and resumes a System Workload Partition. It cannot be run within a WPAR

rmwpar Deletes the specified Workload Partition from the system as well as its configuration and its WLM profile

stopwpar Kills the WPAR and deallocate all resources belonging to it. It removes the Application WPAR

syncwpar Specific to System WPAR - Synchronizes the software installed in the global shared parts (usually /usr and /opt) with the workload partition's root part

Note: The mkwpar and chwpar can update the global file /etc/wpars:

Note: /etc/rc.wpars: Specific to System WPAR - this script is run at main system boot it invokes the startwpar command on all workload partitions with the autostart option.
Some commands have different or enhanced behavior in a WPAR environment. The list includes acctcom, acctctl, df, domainname, hosted, hostname, ifconfig, ioo, ipcrm, ipcs, mkclass, mount, netstat, nfso, no, projctl, ps , schedo, uname, vmo, wlmstat, wlmtune, wlmcntrl. This change is described in the AIX 6 documentation.

The simplest way to administrate WPARs using command lines (CLI) is to issue the command smitty wpar which will provide the interface to these commands.

On Global Server,

ps –ef -@
pg

ps –ef -@ wparname
pg

topas -@


WPAR Backup and Restore in same workload partition:

savewpar -Nif /backup/app1wpar2.bk app1wpar2 -> to take a WPAR backup while in Active

stopwpar –hN app1wpar2

rm -fr app1wpar1*/* app1wpar1*/.* ; ls -l app1wpar1*

rmwpar app1wpar2 -> to remove the definition

lswpar -> will don’t show the wpar now

lssavewpar –f app1wpar2.bk
pg

restwpar –f /backup/app1wpar2.bk

WPAR Cloning (Backed up wpar restored in different partition:

Source WPAR= app1wpar2

Dest WPAR(Cloned as)=app1wpar3


restwpar -h secondsrv -n app1wpar3 -d /wpars/app1wpar3 -r -U -M "-N address=192.168.0.3 -M directory=/ vfs=nfs host=192.169.0.1 dev=/wpars/app1wpar3root -M directory=/home vfs=nfs host=192.168.0.1 dev=/wpars/app1wpar3home -M directory=/tmp vfs=nfs host=192.168.0.1 dev=/wpars/app1wpar3 -M directory=/var vfs=nfs host=192.168.0.1 dev=wpars/app1wpar3" -f /backup/app1wpar2.bk

No comments:

Post a Comment