530 likes | 848 Views
Viraf Patel viraf@us.ibm.com. AIX Workload Partions. Agenda. Introduction to AIX Workload Partitions (WPAR) WPAR characteristics and positioning System WPARs Application WPARs WPAR administration WPAR Performance Tools Summary. What are AIX Workload Partitions?.
E N D
Viraf Patel viraf@us.ibm.com AIX Workload Partions
Agenda • Introduction to AIX Workload Partitions (WPAR) • WPAR characteristics and positioning • System WPARs • Application WPARs • WPAR administration • WPAR Performance Tools • Summary
What are AIX Workload Partitions? • Created via software as virtualized environments in a single AIX instance • Partitioned system capacity • Each Workload Partition obtains a regulated share of the processor and memory resources • Each Workload Partition has separate network and filesystems and many system services (e.g. telnetd, etc.) • Separate Administrative control • Each Workload partition is a separate administrative and security domain • Shared system resources • I/O Devices • Processor • Operating system • Shared Library and Text AIX Image Workload Partition App Svr Workload Partition Billing Svr Workload Partition Test Svr Workload Partition Web Svr Workload Partition E
Single System or LPAR Application A Application B Application C AIX Partition #1 AIX Partition #2 AIX Partition #3 Benefits of IBM AIX Workload Partitions • reduced administration expense by leveraging a single AIX image • drive higher system utilization • reduce the number of system images to maintain • “good enough” isolation for many workloads Sys3 Sys2 Sys1
AIX Workload Partitions can be used in LPARs Dedicated Processor LPAR Finance Dedicated Processor LPAR Planning MicroPartition Processor Pool LPAR Asia LPAR LPAR Americas LPAR EMEA WPAR #1 MFG WPAR #1 Bus Dev WPAR #1 eMail VIO Server WPAR #2 Test WPAR #2 Planning WPAR #3 Billing POWER Hypervisor
IBM System p5 Flexible Resource Management AIX Workload Partitions complement System p5 Logical Partitions AIX Workload Partitions Ease of Administration MicroPartition LPAR Dedicated Processor LPAR Workload Manager Workload Isolation
WPAR Implications • What workloads to use on WPARs? • Need for dedicated I/O resources • Isolation and security • Security/backup/management standards for WPARs • When to use Application WPARs versus System WPARs
WPAR Terminology • Global environment • Checkpoint and restart • Mobility • Departure system • Arrival system
WPAR Types • There are 2 types of WPARS • System WPAR • Application WPAR • Both WPAR type can be configured for mobility via the AIX Workload Partition Manager product
Characteristics of WPARs • Devices • Managed and administered in the global environment • Support pseudo-devices in WPARs • Networking • Support multiple addresses for login and network services • WPARs IP address is aliased to IP address in the global environment • Configurable at creation time or later • Security • Limited interaction with global environment • Limited interaction with persistent objects
Characteristics of WPARs • WPAR isolation • System WPARs and application WPARs are isolated from each other • System WPARs are integrated with AIX RBAC facility which is not true for Application WPARs • Resource Control • Ability to change resources dynamically within a WPAR • Allows share based allocation or percentage based allocation for processor and memory resources
Devices in a WPAR • Unavailable • /dev/mem • /dev/nvram • Storage available from global environment via a mounted file system • Network addressing through IP address aliasing from the global environment
WPAR filesystem • System WPAR localized view of filesystem • / • /usr • /opt • /tmp • /var • /home • 3 primary forms of file system access • Shared-system • /usr and /opt are shared read-only from the global environment via namefs mounts • nfs hosted • Set of fs’s which can include /usr and /opt mounted ro or rw via a nfs host server • Non-shared • /usr and /opt are separate local filesystems (jfs/jfs2) within the WPAR
Specification file • To use a specification file to create a system WPAR • mkwpar -f /tmp/specfile1 • To create a specification file as part of the WPAR creation process • mkwpar -n wpar_name -o /tmp/specfile • To generate a specification file without creating the WPAR, mkwpar -o /tmp/specfile3 -w • /usr/samples/wpars/sample.spec file.
Resource Control of WPARs • To initialize resource control settings, run the following mkwpar command • mkwpar -n wpar_name -R active=yes CPU=10%-20%,50% totalProcesses=1024 • A minimum of 10% of the global environment’s processors upon request • A maximum of 20% of the global environment’s processors when there is contention • A maximum of 50% of the global environment’s processors when there is no contention • A maximum of 1024 processes at a time • Change resource control settings dynamically for an existing active or inactive application WPAR • chwpar -R totalThreads=2048 shares_memory=100 wpar_name • chwpar –R shares_CPU=70 wpar_name • chwpar –R CPU=5%-20%,50% wpar_name
Resource Control of WPARs • Understanding CPU shares • wpar A has 4 shares, wpar B has 8 shares, wpar C has 12 shares • total shares=4+8+12=24 • allocation would be wpar A = 4/24=16.6% , B=8/24=33.3%, C=12/24=50% • If another wpar is added shares would alll be adjusted • added wpar D 6 shares • wpar A =4/30=13.3% ….. wpar D = 6/30=20%.... wpar C=12/30=40% • Memory shares operate similarly • By default number of shares for each WPAR is unlimited
Listing Resource of WPARs • CPU shares – (lswpar –L edited output) RESOURCE CONTROLS Active: yes Resource Set: CPU Shares: unlimited CPU Limits: 0%-100%,100% Memory Shares: unlimited Memory Limits: 0%-100%,100% Per-Process Virtual Memory Limit: unlimited Total Processes: unlimited Total Threads: unlimited
Attributes before creating system WPAR root@ec10 (/) > oslevel -s 6100-00-03-0808 root@ec10 (/) > uname -nuML ec10 IBM,9117-MMA IBM,02109A4AF 12 ec10_aix_wpar root@ec10 (/) > df -k Filesystem 1024-blocks Free %Used Iused %Iused Mounted on /dev/hd4 131072 18920 86% 7736 61% / /dev/hd2 1703936 158400 91% 33809 47% /usr /dev/hd9var 131072 9280 93% 5235 64% /var /dev/hd3 131072 130296 1% 33 1% /tmp /dev/hd1 131072 130688 1% 7 1% /home /dev/hd11admin 131072 130708 1% 5 1% /admin /proc - - - - - /proc /dev/hd10opt 262144 113744 57% 2888 11% /opt /dev/fslv00 1048576 940096 11% 21 1% /wpcode • Can create WPARs using specification file or image.data file • mkwpar –o /tmp/spec1 –w (generate specification file) • mkwpar –I image.data file –n wpar_name
Attributes before creating system WPAR root@ec10 (/) > netstat -ni Name Mtu Network Address ZoneID Ipkts Ierrs Opkts Oerrs Coll en0 1500 link#2 4e.c4.33.6.45.2 11255767 0 2884729 0 0 en0 1500 9.19.51 9.19.51.137 11255767 0 2884729 0 0 lo0 16896 link#1 1895 0 3398 0 0 lo0 16896 127 127.0.0.1 1895 0 3398 0 0 lo0 16896 ::1 0 1895 0 3398 0 0 root@ec10 (/) > ifconfig en0 en0:flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPT64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN> inet 9.19.51.137 netmask 0xffffff00 broadcast 9.19.51.255 tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 Note : - you can edit /etc/hosts and insert entry for new WPARs - you can use clogin from global environment to access wpar
Creating System WPAR root@ec10 (/) > lswpar Name State Type Hostname Directory ----------------------------------------- wp04 A A wp04 / root@ec10 (/) > mkwpar -n wp03 mkwpar: Creating file systems... / /home /opt /proc /tmp /usr /var ………… mkwpar: Workload partition wp03 created successfully. To start the workload partition, execute the following as root: startwpar [-v] 'ec09‘ root@ec10 (/) > startwpar -v wp03 Starting workload partition wp03. Invalid Script File... Mounting all workload partition file systems root@ec10 (/usr/local) > lswpar Name State Type Hostname Directory ----------------------------------------- wp03 A S wp03 /wpars/wp03 wp04 A A wp04 /
rootvg – before WPAP is created root@sq18 (/wpars) > du -k /wpars 0 /wpars Space required is abt 384 Mbyes for a WPAR
rootvg after WPAR is created root@sq18 (/) > du -k /wpars 1849472 /wpars/ec09 1849472 /wpars
Creating WPAR on P5 system root@ec10 (/) > lswpar root@ec10 (/) > mkwpar -n wp03 mkwpar: Creating file systems... / /home /opt /proc /tmp /usr /var ………. root@ec10 (/) > clogin ec20 Workload partition wp03 is not active. root@ec10 (/) > startwpar -v wp03 Starting workload partition subsystem cor_wp03 Return Status = SUCCESS root@ec10 (/) > clogin wp03 ************************************************************************************************** * * * * * Welcome to AIX Version 6.1! * * * * * * Please see the README file in /usr/lpp/bos for information pertinent to * * this release of the AIX Operating System. * * * * * ************************************************************************************************** mkwpar: Workload partition wp03 created successfully. To start the workload partition, execute the following as root: startwpar [-v] ‘wp03` real 3m57.74s user 1m30.02s sys 0m48.23s root@sq18 (/) > lswpar Name State Type Hostname Directory ----------------------------------------- ec20 A S ec20 /wpars/ec20
Creating WPAR on a P6 system # lswpar Name State Type Hostname Directory ----------------------------------------- wp04 D S wp04 /wpars/wp04 # time mkwpar -n wp04 mkwpar: Creating file systems... / /home /opt /proc /tmp /usr /var ……………… mkwpar: Workload partition wp04 created successfully. To start the workload partition, execute the following as root: startwpar [-v] `wp04' real 4m0.22s user 1m4.13s sys 0m37.17s
Starting WPARs # startwpar -v ec09 Starting workload partition ec09. Invalid Script File... Mounting all workload partition file systems. Mounting /wpars/ec09. Mounting /wpars/ec09/home. Mounting /wpars/ec09/opt. Mounting /wpars/ec09/proc. Mounting /wpars/ec09/tmp. Mounting /wpars/ec09/usr. Mounting /wpars/ec09/var. Loading workload partition. $corral_t = { 'vips' => [ [ 'en0', '9.19.51.136', '255.255.255.0', '9.19.51.255' ] ], 'opts' => 4, 'name' => 'ec09', 'path' => '/wpars/ec09', 'hostname' => 'ec09', 'id' => 0, 'key' => 7 }; Exporting workload partition devices. Starting workload partition subsystem cor_ec09. 0513-059 The cor_ec09 Subsystem has been started. Subsystem PID is 405548. Verifying workload partition startup. Return Status = SUCCESS.
Viewing WPARs from global environment root@sq18 (/) > cd /wpars root@sq18 (/) > ls ec08 ec09 root@sq18 (/) > lswpar Name State Type Hostname Directory ----------------------------------------- ec09 A S ec09 /wpars/ec09 ec10 A S ec10 /wpars/ec10 ec11 A S ec11 /wpars/ec11
Viewing WPARs filesystems from global environment root@sq18 (/) > lswpar Name State Type Hostname Directory ----------------------------------------- ec09 A S ec09 /wpars/ec09 ec10 T A ec10 / ec12 A S ec12 /wpars/ec12 root@sq18 (/) > df -k Filesystem 1024-blocks Free %Used Iused %Iused Mounted on /dev/hd4 131072 69524 47% 1820 9% / /dev/hd2 1703936 283080 84% 33479 34% /usr /dev/hd9var 196608 183652 7% 452 2% /var /dev/hd3 196608 195804 1% 38 1% /tmp /dev/hd1 917504 917000 1% 7 1% /home /proc - - - - - /proc /dev/hd10opt 786432 730492 8% 1108 1% /opt /dev/fslv00 2097152 1394432 34% 482 1% /0728a /dev/fslv01 65536 46372 30% 1631 14% /wpars/ec12 /dev/fslv02 65536 64136 3% 7 1% /wpars/ec12/home /opt 786432 730492 8% 1108 1% /wpars/ec12/opt /proc - - - - - /wpars/ec12/proc /dev/fslv03 131072 128348 3% 13 1% /wpars/ec12/tmp /usr 1703936 283080 84% 33479 34% /wpars/ec12/usr /dev/fslv04 131072 118728 10% 395 2% /wpars/ec12/var /dev/fslv05 65536 46964 29% 1631 14% /wpars/ec09 /dev/fslv06 65536 64136 3% 7 1% /wpars/ec09/home /opt 786432 730492 8% 1108 1% /wpars/ec09/opt /proc - - - - - /wpars/ec09/proc /dev/fslv07 131072 128348 3% 13 1% /wpars/ec09/tmp /usr 1703936 283080 84% 33479 34% /wpars/ec09/usr /dev/fslv08 131072 118756 10% 396 2% /wpars/ec09/var
WPAR listing and ip address aliasing view lswpar Name State Type Hostname Directory ----------------------------------------- ec09 A S ec09 /wpars/ec09 ec10 A S ec10 /wpars/ec10 netstat -ni Name Mtu Network Address ZoneID Ipkts Ierrs Opkts Oerrs Coll en0 1500 link#2 0.9.6b.dd.43.ba 3119936 0 433744 4 0 en0 1500 9.19.51 9.19.51.54 3119936 0 433744 4 0 en0 1500 9.19.51 9.19.51.136 8909 0 10740 0 0 en0 1500 9.19.51 9.19.51.137 1067 0 2045 0 0 lo0 16896 link#1 20997 0 21007 0 0 lo0 16896 127 127.0.0.1 20997 0 21007 0 0 lo0 16896 ::1 0 20997 0 21007 0 ifconfig en0 en0: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN> inet 9.19.51.54 netmask 0xffffff00 broadcast 9.19.51.255 inet 9.19.51.136 netmask 0xffffff00 broadcast 9.19.51.255 inet 9.19.51.137 netmask 0xffffff00 broadcast 9.19.51.255 tcp_sendspace 131072 tcp_recvspace 65536 lswpar -N ec08 Name Interface Address Netmask Broadcast --------------------------------------------------------- ec08 en0 9.19.51.154 255.255.255.0 9.19.51.255
Application WPARs • Provide path to the application or command that requires the application WPAR • Use specification file or command line argument • Not necessary to specify WPAR name explicitly at creation
Creating Application WPARs root@sq18 (/) > lswpar Name State Type Hostname Directory ----------------------------------------- ec12 A S ec12 /wpars/ec12 root@sq18 (/) > wparexec -n ec10 /usr/local/loadgen -t 10 /usr/bin/ps –ef > ps.out wparexec: Verifying file systems... wparexec: Workload partition ec10 created successfully. Invalid Script File... root@sq18 (/) > lswpar Name State Type Hostname Directory ----------------------------------------- ec10 A A ec10 / ec12 A S ec12 /wpars/ec12 root@sq18 (/) > clogin ec10 root@ec10 (/) > uname -a AIX ec10 1 6 00C1677E4C00
Application WPAR listing and ip address aliasing view root@sq18 (/) > lswpar Name State Type Hostname Directory ----------------------------------------- ec10 A A ec10 / ec12 A S ec12 /wpars/ec12 root@sq18 (/) > netstat -ni Name Mtu Network Address ZoneID Ipkts Ierrs Opkts Oerrs Coll en0 1500 link#2 0.9.6b.dd.43.ba 5196841 0 569426 4 0 en0 1500 9.19.51 9.19.51.54 5196841 0 569426 4 0 en0 1500 9.19.51 9.19.51.139 1540 0 1073 0 0 en0 1500 9.19.51 9.19.51.137 9 0 0 0 0 lo0 16896 link#1 91272 0 91289 0 0 lo0 16896 127 127.0.0.1 91272 0 91289 0 0 lo0 16896 ::1 0 91272 0 91289 0 0 root@sq18 (/) > ifconfig en0 en0: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN> inet 9.19.51.54 netmask 0xffffff00 broadcast 9.19.51.255 inet 9.19.51.139 netmask 0xffffff00 broadcast 9.19.51.255 inet 9.19.51.137 netmask 0xffffff00 broadcast 9.19.51.255 tcp_sendspace 131072 tcp_recvspace 65536
Removing WPARs # rmwpar ec09 rmwpar: Workload partition 'ec09' is running. rmwpar: Specify -s or -F to stop the workload partition before removing. rmwpar: Return Status = FAILURE # rmwpar A workload partition name must be specified. Usage: rmwpar [-F] [-p] [-s] wparName Flags: -F = Forced remove. The '-s' flag is implied. -p = Preserve file systems (system workload partitions only). -s = Stops the workload partition before removing (system workload partitions only - application workload partitions should use the stopwpar command).
Removing WPARs # rmwpar -s ec09 rmwpar: Removing workload partition ec09 rmwpar: Stopping workload partition ec09 Stopping workload partition ec09. Stopping workload partition subsystem cor_ec09. 0513-044 The cor_ec09 Subsystem was requested to stop. stopwpar: 0960-261 Waiting up to 600 seconds for workload partition to halt. Advanced Accounting is not running. stopwpar: 0960-231 ATTENTION: /usr/lib/wpars/wparinstcmd failed with return code 1. Shutting down all workload partition processes.
Removing WPARs # rmwpar -F ec09 rmwpar: Removing workload partition ec09 rmwpar: Stopping workload partition ec09 stopwpar: 0960-254 Workload partition ec09 is not currently active. rmwpar: Removing file system /wpars/ec09/var. rmlv: Logical volume fslv08 is removed. rmwpar: Removing file system /wpars/ec09/usr. rmwpar: Removing file system /wpars/ec09/tmp. rmlv: Logical volume fslv07 is removed. rmwpar: Removing file system /wpars/ec09/proc. rmwpar: Removing file system /wpars/ec09/opt. rmwpar: Removing file system /wpars/ec09/home. rmlv: Logical volume fslv06 is removed. rmwpar: Removing file system /wpars/ec09. rmlv: Logical volume fslv05 is removed. rmwpar: Return Status = SUCCESS # lswpar Name State Type Hostname Directory ----------------------------------------- ec08 D S ec08 /wpars/ec08
WPAR administration – backup and restore • WPARs are backed up using the “mkwpardata” command • Image files are generated using the “savewpar” command • WPARs are restored using “restwpar” command root@sq18 (/) > restwpar -f /dev/rmt1 root@sq18 (/) > lswpar Name State Type Hostname Directory ----------------------------------------- ec12 A S ec12 /wpars/ec12 root@sq18 (/) > savewpar ec12 0512-057 savewpar: Device /dev/rmt0 is not in the available state or is not a tape device or valid file name.
Tools available within WPAR # ps PID TTY TIME CMD 335920 pts/0 0:00 -ksh 491650 pts/0 0:00 ps # wlmstat CLASS CPU MEM DKIO ec12 0.45 0.41 0.00 TOTAL 0.45 0.41 0.00 # df Filesystem 512-blocks Free %Used Iused %Iused Mounted on /dev/fslv01 131072 93472 29% 1632 14% / /dev/fslv02 131072 128272 3% 7 1% /home /opt 1572864 1460984 8% 1108 1% /opt /proc - - - - - /proc /dev/fslv03 262144 256696 3% 13 1% /tmp /usr 3407872 566160 84% 33479 34% /usr /dev/fslv04 262144 237464 10% 396 2% /var # users root
WPAR monitoring tools • Limited support for # netstat -i Name Mtu Network Address ZoneID Ipkts Ierrs Opkts Oerrs Coll en0 1500 link#2 0.9.6b.dd.43.ba 3256 0 2207 0 0 en0 1500 9.19.51 9.19.51.139 3256 0 2207 0 0 lo0 16896 link#1 1495 0 1525 0 0 lo0 16896 127 loopback 1495 0 1525 0 0 lo0 16896 ::1 0 1495 0 1525 0 0 # w 03:00PM up 4:12, 1 user, load average: 0.00, 0.00, 0.00 User tty login@ idle JCPU PCPU what root pts/0 02:54PM 0 4 0 w # svmon size inuse free pin virtual memory 524288 10541 175618 130036 148410 pg space 131072 1148 work pers clnt other pin -24581 0 0 24693 in use 7411 0 3130
Summary • WPARs reduce administration expense by leveraging a single AIX image • LPARs and WPARs drive higher system utilization and optimize the customers investment • WPARs provide dynamic resource allocation capabilities • WPARs provide “good enough” isolation for many workloads • Simple, lightweight, centralized partition administration