How to create a WPAR step-by-step
ch
lpar in the managed system may have a different operating systems. Each
workload partition runs only AIX. Lpar owns everything it uses, wpar
shares lpar resources (memory, cpu, adapters). Usage of lpar resources
(the amount of their processing power – so to speak) by wpar can be
defined, limited not to exceed certain amount – if needed. Why I got
interested in workload partitions (wpar)? I had to install application
on AIX6.1. There is also a ”frequent” but not continuous requirement of
testing patches and new releases of this application – not a constant
need. As the time flows the operating system will evolve as well –
patches, fixes, ML’s …. The test environment must have identical OS as
the production environment – are you beginning to see my point?
Let’s create one “private” workload partition which I will call
wpar (today, for a change I have no imagination). Why “private”? Because it will have its own (private) /usr.mkwpar -g wpar_vg -h wpar -l -n wpar -N interface=en0 address=159.14.245.85 nemtask=255.255.255.0 -P -r -s -o /root/wpar.config -g wpar_vg -> will create all file systems owned by wpar using the capacity of the indicated volume group-h wpar -> specifies the host name assigned to this wpar-l -> create private and writable /opt and /usr-n wpar -> workload partition name (wpar)-N -> Network info follows-P -> set the root password interactively-r -> duplicate network name resolution services (/etc/resolv.conf and so forth)-s -> start the wpar after creation-o /root/wpar.config -> create wpar.config file that can be used to re-create the wpar
what we get as soon as we execute this command is:
......... Workload partition wpar created successfully.
As
you can see this wpar has its own copy of the operating system created
in the specified vg – wpar_vg. Now, let’s create some file systems in
another (dedicated to it) volume group which (the file systems) we will
assign to our wpar.
entaimq1:MDC:/root>lsvg
Let’s make the logical volumes first:
entaimq1:MDC:/root>
Now, let’s make file system on the top of each logical volume:/lang_en]
crfs -v jfs2 -d inform1_lv -m /wpars/wpar/inform1 -A yes -a log=INLINE
It’s too late but I forgot to include the mount type above so now, I have to execute the
chfs against each file system.entaimq1:MDC:/root>chfs -u wpar /wpars/wpar/inform1
and
..../inform2 and ..../inform3
Now, inside the lpar that owns the
wpar execute the mount all and let’s go and see thewpar . To login from the lpar directly into its wpar, execute:entaimq1:MDC:/root>clogin wpar -l root
Once inside, let’s do some poking aroung.
# df -g
Now, lets increase the size of one the last three file systems made.
# chfs -a size=2G /inform1
Guess, what? There are no stanzas for these file systems in the wpar own
/etc/filesystems . Let’s do the increase operation on the “owner” side (inside the lpar). So, execute exit to logout from the wpar, and then let’s grow the file systems as required.entaimq1:MDC:/root>chfs -a size=2G /wpars/wpar/inform1
Going back into the wpar and what do you see?
# df -g
Who owns these file systems?
# ls -ld /inform2
Let’s change it and assign it to a user and a group I have created earlier inside this wpar.
# chown infouser.info /inform1
Who owns these file systems now?[lan_pl]Kto obecnie posiada te pliki?
# ls -ld /inform1
In
another putty session I tried to login to this wpar (using its IP
address), and I failed. I could login only after I got back into the
wpar via the
clogin than I executed the passwd command
and I set the root password in the wpar. I tried again to login via
wpar IP address and this time it worked. Could it be that while
executing mkwpar its-P options failed? Maybe, who knows – now, I do not have time to to worry about it.
I have to load a software that arrived on a CD media. How to use a
CD to load a software into a wpar? I try to mount CD drive into a file system accessible to my wpar, but the operation fails.entaimq1:MDC:/>mount -v cdrfs -o ro /dev/cd0 /wpars/wpar/cd0
It
could be that I did not assign the adapter and CD to the partition
(lpar) controlling my wpar… Let’s do it (HMC). Guess what? After I
executed
cfgmgr the CD showed up and I could mount it.entaimq1:MDC:/>lsdev | grep -i cd entaimq1:MDC:/>mount -v cdrfs -o ro /dev/cd0 /wpars/wpar/cd0
Study the previous line to understand how mounting from an lpar and into one of its wpars. Do I have access to
CD from my wpar?# df
Yes, indeed. I got it, I see it. Can I have a peak at it content too?
# cd /cd0
Well,
well, well. Now I can proceed with software installations – this CD
contains the “Expansion Pack for AIX”. This is not the right CD!
Back
to reality. I have made a dynamic change to my lpar configuration – I
added the adapter controlling the CD. Few of you may yet not know (I
belonged to this category too) but in case of an lpar anything called
dynamic is nothing short of dynamic – in absence of any further steps
the dynamic changes will disappear the next time the lpar will be
rebooted. So the question is this ”how to make the dynamic change a
permanent one?” What I did? On HMC, I go toConfiguration -> Save Current Configuration. This operation creates a new profile. Remember to make it the Default profile so if lpar reboots it will boot with this one and not the previous profile.
[lang-en]Let’s stop the wpar.
entaimq1:MDC:/>lswpar Stopping workload partition wpar.
Have you noticed that I stopped the wpar from its lpar?
entaimq1:MDC:/>lswpar
And now, let start it up.
entaimq1:MDC:/>startwpar -v wpar
Since I did not put the appropriate stanza in the
/etc/filesystems no CD got mounted, has to go to the lpar to do this again:
entaimq1:MDC:/>mount -v cdrfs -o ro /dev/cd0 /wpars/wpar/cd0
What happens when I try to unmount
cd0 being inside wpar?# umount /cd0
This can be done from the ”owning” lpar.
entaimq1:MDC:/>umount /wpars/wpar/cd0
Since nobody know where is the install CD, I have to kill the time in some other way. With the help from
ftp ,I install the VNC software, and after login as me (duszyk) not root, I try to start it executing:$ vncserver
It does not work… . VNC would not start until I made some changes to the
/usr/bin/X11/vncserver . I followed the advice included in this link: ”http://www.ee.pw.edu.pl/~pileckip/aix/vnc_setup.htm” – I tried Doug Ranz’ method. Following the changes, I was able to start the vncserver and connect to this ”machine” from my laptop as this images shows:
How to get rid of a wpar? Easy, you can do it like that:
entaimq1:MDC:/root>rmwpar -Fsv wpar
Well,
now I have been told that this wpar host name and its IP address has to
change because of some requirement. The new hostname will be a very
descriptive one indeed: infaprtu001, and its IP address will be
159.14.245.56. To execute the change I will add the appropriate entry to
lpar
/etc/hosts and execute:chwpar -h infaprtu001 -N address=159.14.245.56 wpar entaimq1:MDC:/root>lswpar
I use the new address to login (with putty) into the wpar and what do I see here?
$ ifconfig -a
Do you understand the difference between the host and wpar name? They do not need to be the same.
* Source Article from : Internet |