mohi_aix7[/] > wparexec -n myapp '/usr/bin/ps -ef > /tmp/p.p'
mohi_aix7[/] > lspwar
Name State Type Hostname Directory RootVG WPAR
--------------------------------------------------
hema_wpar A S hema_wpar /wpars/hema_wpar no
mohi_wpar A S mohi_wpar /wpars/mohi_wpar no
myapp T A myapp /
mohi_aix7[/] > cat /tmp/p.p
UID PID PPID C STIME TTY TIME CMD
root 1 0 10 05:27:44 pts/0 0:00 /usr/lib/corrals/vinit myapp /usr/bin/ps -ef > /tmp/p.p
root 9568376 1 9 05:27:44 pts/0 0:00 /usr/bin/ps -ef
Creating a Sample System WPAR:
mohi_aix7[/] > mkwpar -h mano_wpar -i -r -N address='172.29.149.65' -n mano_wpar -o /tmp/mano_wpar.out
mohi_aix7[/] > lswpar
Name State Type Hostname Directory RootVG WPAR
----------------------------------------------------
hema_wpar A S hema_wpar /wpars/hema_wpar no
mano_wpar D S mano_wpar /wpars/mano_wpar no
mohi_wpar A S mohi_wpar /wpars/mohi_wpar no
mohi_aix7[/] > lswpar -M mano_wpar
Name MountPoint Device Vfs Nodename Options
-------------------------------------------------------------------------
mano_wpar /wpars/mano_wpar /dev/fslv08 jfs2
mano_wpar /wpars/mano_wpar/home /dev/fslv09 jfs2
mano_wpar /wpars/mano_wpar/opt /opt namefs ro
mano_wpar /wpars/mano_wpar/proc /proc namefs rw
mano_wpar /wpars/mano_wpar/tmp /dev/fslv10 jfs2
mano_wpar /wpars/mano_wpar/usr /usr namefs ro
mano_wpar /wpars/mano_wpar/var /dev/fslv11 jfs2
mohi_aix7[/] > startwpar mano_wpar
Starting workload partition mano_wpar.
Mounting all workload partition file systems.
Loading workload partition.
Exporting workload partition devices.
Exporting workload partition kernel extensions.
Starting workload partition subsystem cor_mano_wpar.
0513-059 The cor_mano_wpar Subsystem has been started. Subsystem PID is 5046352.
Verifying workload partition startup.
mohi_aix7[/] > clogin mano_wpar
**************************************************************************
* Welcome to AIX Version 7.1! *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
**************************************************************************
# hostname
mano_wpar
# ifconfig -a
en0: flags=1e080863,480
inet 172.29.149.65 netmask 0xffffc000 broadcast 172.29.191.255
tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
lo0: flags=e08084b,c0
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1%1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
Backup/Remove/Restore/Clone of the WPAR:
Backup:
mohi_aix7[/] > savewpar -f /backup/manowpar.bk mano_wpar
Creating list of files to back up.
Backing up 2863 files
2863 of 2863 files (100%)
0512-038 savewpar: Backup Completed Successfully.
mohi_aix7[/] > ls -al /backup/manowpar.bk
-rw-r--r-- 1 root system 29286400 Dec 24 05:43 /backup/manowpar.bk
mohi_aix7[/] > du -sm /backup/manowpar.bk
27.93 /backup/manowpar.bk
Note: See the size of the total WPAR it is just a 27MB due to the /usr and /opt are derived from Global AIX.
Remove:
mohi_aix7[/] > clogin mano_wpar
*******************************************************************************
* Welcome to AIX Version 7.1! *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
*******************************************************************************
Last login: Fri Dec 24 05:38:24 CST 2010 on /dev/Global from mohi_aix7
# shutdown -F
SHUTDOWN PROGRAM
Fri Dec 24 05:45:44 CST 2010
0513-044 The sshd Subsystem was requested to stop.
Wait for '....Halt completed....' before stopping.
Error reporting has stopped.
Advanced Accounting has stopped...
Process accounting has stopped.
nfs_clean: Stopping NFS/NIS Daemons
0513-004 The Subsystem or Group, nfsd, is currently inoperative.
0513-044 The biod Subsystem was requested to stop.
0513-004 The Subsystem or Group, rpc.lockd, is currently inoperative.
0513-044 The rpc.statd Subsystem was requested to stop.
0513-004 The Subsystem or Group, gssd, is currently inoperative.
0513-004 The Subsystem or Group, nfsrgyd, is currently inoperative.
0513-004 The Subsystem or Group, rpc.mountd, is currently inoperative.
0513-004 The Subsystem or Group, ypbind, is currently inoperative.
0513-044 The qdaemon Subsystem was requested to stop.
0513-044 The writesrv Subsystem was requested to stop.
0513-044 The clcomd Subsystem was requested to stop.
0513-044 The ctrmc Subsystem was requested to stop.
0513-044 The IBM.ERRM Subsystem was requested to stop.
0513-044 The IBM.AuditRM Subsystem was requested to stop.
All processes currently running will now be killed...
Unmounting the file systems...
....Halt completed....
mohi_aix7[/] > lswpar
Name State Type Hostname Directory RootVG WPAR
-----------------------------------------------------------------
hema_wpar A S hema_wpar /wpars/hema_wpar no
mano_wpar D S mano_wpar /wpars/mano_wpar no
mohi_wpar A S mohi_wpar /wpars/mohi_wpar no
mohi_aix7[/] > rmwpar mano_wpar
rmwpar: Removing file system /wpars/mano_wpar/var.
rmlv: Logical volume fslv11 is removed.
rmwpar: Removing file system /wpars/mano_wpar/usr.
rmwpar: Removing file system /wpars/mano_wpar/tmp.
rmlv: Logical volume fslv10 is removed.
rmwpar: Removing file system /wpars/mano_wpar/proc.
rmwpar: Removing file system /wpars/mano_wpar/opt.
rmwpar: Removing file system /wpars/mano_wpar/home.
rmlv: Logical volume fslv09 is removed.
rmwpar: Removing file system /wpars/mano_wpar.
rmlv: Logical volume fslv08 is removed.
mohi_aix7[/] > lswpar
Name State Type Hostname Directory RootVG WPAR
-----------------------------------------------------------------
hema_wpar A S hema_wpar /wpars/hema_wpar no
mohi_wpar A S mohi_wpar /wpars/mohi_wpar no
Restore:
mohi_aix7[/] > restwpar -f /backup/manowpar.bk
New volume on /backup/manowpar.bk:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Fri Dec 24 05:43:19 CST 2010
Files are backed up by name.
The user is root.
x 2919 ./.savewpar_dir/wpar.spec
x 4666 ./.savewpar_dir/image.data
x 182289 ./.savewpar_dir/backup.data
The total size is 189874 bytes.
The number of restored files is 3.
.
.
.
.
.
.
The file system has read permission only.
rm: 0653-609 Cannot remove /usr/idebug.
The file system has read permission only.
Finished processing all filesets. (Total time: 0 secs).
+-----------------------------------------------------------------------------+
Summaries:
+-----------------------------------------------------------------------------+
Installation Summary
--------------------
Name Level Part Event Result
-------------------------------------------------------------------------------
ibmdebugger 7.1.0.0 ROOT APPLY FAILED
ibmdebugger 7.1.0.0 ROOT CLEANUP SUCCESS
syncroot: Error synchronizing installp software.
syncroot: Returns Status = FAILURE
Workload partition mano_wpar created successfully.
mkwpar: 0960-390 To start the workload partition, execute the following as root: startwpar [-v] mano_wpar
mohi_aix7[/] > lswpar
Name State Type Hostname Directory RootVG WPAR
-----------------------------------------------------------------
hema_wpar A S hema_wpar /wpars/hema_wpar no
mano_wpar D S mano_wpar /wpars/mano_wpar no
mohi_wpar A S mohi_wpar /wpars/mohi_wpar no
mohi_aix7[/] > startwpar mano_wpar
Starting workload partition mano_wpar.
Mounting all workload partition file systems.
Loading workload partition.
Exporting workload partition devices.
Exporting workload partition kernel extensions.
Starting workload partition subsystem cor_mano_wpar.
0513-059 The cor_mano_wpar Subsystem has been started. Subsystem PID is 11075780.
Verifying workload partition startup.
mohi_aix7[/] > lswpar
Name State Type Hostname Directory RootVG WPAR
-----------------------------------------------------------------
hema_wpar A S hema_wpar /wpars/hema_wpar no
mano_wpar A S mano_wpar /wpars/mano_wpar no
mohi_wpar A S mohi_wpar /wpars/mohi_wpar no
Note: We have sucessfully restored the WPAR
Clone:
mohi_aix7[/] > restwpar -h cloned_wpar -n cloned_wpar -d /wpars/cloned_wpar -r -U -M "-N address=172.29.149.66" -f /backup/manowpar.bk
New volume on /backup/manowpar.bk:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Fri Dec 24 05:43:19 CST 2010
Files are backed up by name.
The user is root.
x 2919 ./.savewpar_dir/wpar.spec
x 4666 ./.savewpar_dir/image.data
x 182289 ./.savewpar_dir/backup.data
The total size is 189874 bytes.
The number of restored files is 3.
mkwpar: Creating file systems...
.
.
.
.
.
.
The file system has read permission only.
rm: 0653-609 Cannot remove /usr/idebug/readme/README.debug.
The file system has read permission only.
rm: 0653-609 Cannot remove /usr/idebug/readme.
The file system has read permission only.
rm: 0653-609 Cannot remove /usr/idebug.
The file system has read permission only.
Finished processing all filesets. (Total time: 0 secs).
+-----------------------------------------------------------------------------+
Summaries:
+-----------------------------------------------------------------------------+
Installation Summary
--------------------
Name Level Part Event Result
-------------------------------------------------------------------------------
ibmdebugger 7.1.0.0 ROOT APPLY FAILED
ibmdebugger 7.1.0.0 ROOT CLEANUP SUCCESS
syncroot: Error synchronizing installp software.
syncroot: Returns Status = FAILURE
Copying network name resolution configuration...
/etc/resolv.conf
/etc/hosts
/etc/netsvc.conf
Workload partition cloned_wpar created successfully.
mkwpar: 0960-390 To start the workload partition, execute the following as root: startwpar [-v] cloned_wpar
mohi_aix7[/] > lswpar
Name State Type Hostname Directory RootVG WPAR
-----------------------------------------------------------------------
cloned_wpar D S cloned_wpar /wpars/cloned_wpar no
hema_wpar A S hema_wpar /wpars/hema_wpar no
mano_wpar A S mano_wpar /wpars/mano_wpar no
mohi_wpar A S mohi_wpar /wpars/mohi_wpar no
mohi_aix7[/] > lswpar -M cloned_wpar
Name MountPoint Device Vfs Nodename Options
----------------------------------------------------------------------------
cloned_wpar /wpars/cloned_wpar /dev/wlv7 jfs2
cloned_wpar /wpars/cloned_wpar/home /dev/wlv8 jfs2
cloned_wpar /wpars/cloned_wpar/opt /opt namefs ro
cloned_wpar /wpars/cloned_wpar/proc /proc namefs rw
cloned_wpar /wpars/cloned_wpar/tmp /dev/wlv9 jfs2
cloned_wpar /wpars/cloned_wpar/usr /usr namefs ro
cloned_wpar /wpars/cloned_wpar/var /dev/wlv10 jfs2
mohi_aix7[/] > startwpar cloned_wpar
Starting workload partition cloned_wpar.
Mounting all workload partition file systems.
Loading workload partition.
Exporting workload partition devices.
Exporting workload partition kernel extensions.
Starting workload partition subsystem cor_cloned_wpar.
0513-059 The cor_cloned_wpar Subsystem has been started. Subsystem PID is 11272208.
Verifying workload partition startup.
mohi_aix7[/] > lswpar
Name State Type Hostname Directory RootVG WPAR
-----------------------------------------------------------------------
cloned_wpar A S cloned_wpar /wpars/cloned_wpar no
hema_wpar A S hema_wpar /wpars/hema_wpar no
mano_wpar A S mano_wpar /wpars/mano_wpar no
mohi_wpar A S mohi_wpar /wpars/mohi_wpar no
mohi_aix7[/] > lswpar -M cloned_wpar
Name MountPoint Device Vfs Nodename Options
----------------------------------------------------------------------------
cloned_wpar /wpars/cloned_wpar /dev/wlv7 jfs2
cloned_wpar /wpars/cloned_wpar/home /dev/wlv8 jfs2
cloned_wpar /wpars/cloned_wpar/opt /opt namefs ro
cloned_wpar /wpars/cloned_wpar/proc /proc namefs rw
cloned_wpar /wpars/cloned_wpar/tmp /dev/wlv9 jfs2
cloned_wpar /wpars/cloned_wpar/usr /usr namefs ro
cloned_wpar /wpars/cloned_wpar/var /dev/wlv10 jfs2
mohi_aix7[/] > clogin cloned_wpar
*********************************************************************
* Welcome to AIX Version 7.1! *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
*********************************************************************
Last login: Fri Dec 24 05:38:24 CST 2010 on /dev/Global from mohi_aix7
# hostname
cloned_wpar
# ifconfig -a
en0: flags=1e080863,480
inet 172.29.149.66 netmask 0xffffc000 broadcast 172.29.191.255
tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
lo0: flags=e08084b,c0
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1%1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1