IBM pSeries Power5 management without WebSM
If you asked me what my current job was, I would probably answer something along the lines of "I create and destroy partitions on Power5
systems for a living" and it's true. On an average week, I install between 10 and 40 partitions spread across several systems.
If you've got that kind of work to do, you wouldn't want to spend your time clicking your way through some gruesame application like
WebSM.. And I can do without it as well.
But I haven't found much help on the net, so I have decided to make a blog entry with my HMC commandline cheat sheet which should get
you on the way to partitioning IBM pSeries systems without WebSM
This command lists all P5 systems connected to the HMC. In my environment, there is only one
P5 connected to each HMC that's why you will find this command embedded into others very often
in my examples. If you add a filter with the -F option, you can make this command's
output suitable for others:
Lists all partitions on the connected system and its properties. If you use the -F option
again, you can only output the name and the state of all LPARs and feed that to one of the next two commands.
This "switches" the partition $PARTITION_NAME off immediately, just as the function in WebSM.
This powers on the LPAR $PARTITION_NAME using the profile "default"(-f default) and boots it into the SMS.
This simply resets the connection to the system identified by the --ip option
If you use the option -o remove, the connection is obviously removed not reset.
This restores the saved profile "backupFile" to the P5 system overwriting any settings already present there.
The file is taken from /var/hsc/profiles/$SERIAL_NUMBER/.
By adjusting the -l option, you can determine what to do with duplicate settings. If set to "1", all information
on the P5 is overwritten, if set to "2", settings from the profile override settings on the P5 and if set to "3", settings
from the P5 override settings from the profile.
There is a fourth option, -l 4 which doesn't take a profile name for input.
This last option is the equivalent of the "Initialize profile data" menu in WebSM and deletes all partition data.
As mentioned before, those profiles must be put into a special directory which is not writable for "hscroot".
There are ways around that, but you would lose all support from IBM if you did that and using these binary profiles
is not very practical when you're using virtual ethernet: These profiles contain MAC addresses which get copied if
you restore that profile on another machine. If had my problems with resetting connections, slow network performance
or no network at all, so trust me: You do not want to use these profiles on more than one machine unless you know what you're
doing!
A better way to copy partition profiles is to extract them to a textfile and replay that on another machine:
This scriptlet reads the partition profile "normal" for all LPARs on the connected machine. In theory, you could use this command's
output directly with mksyscfg, but in real life, you have to make a few adjustments to the output:
- Rename the "name=" parameter to "profile_name="
- rename the "lpar_name=" parameter to "name="
- delete the "virtual_serial_adapters=..." option completely, these adapters are created
automatically as soon as you create that partition
And if you're using that scriptlet above, check the order of the partitions!
If there is an I/O server, it must be create BEFORE any partitions with virtual I/O are created.
But even that scriptlet isn't very useful, because "hscroot" may not redirect outputs to a file.
So what do we do? You can also use the lssyscfg output and put it onto the mksyscfg
commandline.
Instead of doing this:
do this:
All of this has to go on one line and keep in mind that quotation marks may have to be quoted to keep the shell from removing them.
But an error message will remind you of that in case you have missed it.
This simply opens a console connection to the LPAR named $PARTITION name. If you know the name of the P5 system, you
can open a console as easy as this:
To close this connection, simply type "~~.". Eventually, you might have to type more "~", because the ssh session reacts
to that string as well. Dependent on the number of cascaded ssh sessions, you'll have to type more "~".
Another way to open a terminal is this simple, but nice command:
That's it for now, but it should get you started getting away from WebSM..
systems for a living" and it's true. On an average week, I install between 10 and 40 partitions spread across several systems.
If you've got that kind of work to do, you wouldn't want to spend your time clicking your way through some gruesame application like
WebSM.. And I can do without it as well.
But I haven't found much help on the net, so I have decided to make a blog entry with my HMC commandline cheat sheet which should get
you on the way to partitioning IBM pSeries systems without WebSM
lssysconn -r all
This command lists all P5 systems connected to the HMC. In my environment, there is only one
P5 connected to each HMC that's why you will find this command embedded into others very often
in my examples. If you add a filter with the -F option, you can make this command's
output suitable for others:
lssysconn -r all -F type_model_serial_num
lssyscfg -r lpar -m $(lssysconn -r all -F type_model_serial_number)
Lists all partitions on the connected system and its properties. If you use the -F option
again, you can only output the name and the state of all LPARs and feed that to one of the next two commands.
chsysstate -m "$(lssysconn -r all -F type_model_serial_num)" -o shutdown --immed -r lpar -n $PARTITION_NAME
This "switches" the partition $PARTITION_NAME off immediately, just as the function in WebSM.
chsysstate -m "$(lssysconn -r all -F type_model_serial_num)" -o on -r lpar -b sms -f default -n $PARTITION_NAME
This powers on the LPAR $PARTITION_NAME using the profile "default"(-f default) and boots it into the SMS.
rmsysconn -o reset --ip $(lssysconn -r all -F ipaddr)
This simply resets the connection to the system identified by the --ip option
If you use the option -o remove, the connection is obviously removed not reset.
rstprofdata -m "$(lssysconn -r all -F type_model_serial_num)" -l 1 -f backupFile
This restores the saved profile "backupFile" to the P5 system overwriting any settings already present there.
The file is taken from /var/hsc/profiles/$SERIAL_NUMBER/.
By adjusting the -l option, you can determine what to do with duplicate settings. If set to "1", all information
on the P5 is overwritten, if set to "2", settings from the profile override settings on the P5 and if set to "3", settings
from the P5 override settings from the profile.
There is a fourth option, -l 4 which doesn't take a profile name for input.
This last option is the equivalent of the "Initialize profile data" menu in WebSM and deletes all partition data.
As mentioned before, those profiles must be put into a special directory which is not writable for "hscroot".
There are ways around that, but you would lose all support from IBM if you did that and using these binary profiles
is not very practical when you're using virtual ethernet: These profiles contain MAC addresses which get copied if
you restore that profile on another machine. If had my problems with resetting connections, slow network performance
or no network at all, so trust me: You do not want to use these profiles on more than one machine unless you know what you're
doing!
A better way to copy partition profiles is to extract them to a textfile and replay that on another machine:
for LPAR in $(lssyscfg -r lpar -F lpar_id -m $(lssysconn -r all -F type_model_serial_num)); do
lssyscfg -r prof -m $(lssysconn -r all -F type_model_serial_num) --filter "lpar_ids=${LPAR}, profile_names=normal"
done
This scriptlet reads the partition profile "normal" for all LPARs on the connected machine. In theory, you could use this command's
output directly with mksyscfg, but in real life, you have to make a few adjustments to the output:
- Rename the "name=" parameter to "profile_name="
- rename the "lpar_name=" parameter to "name="
- delete the "virtual_serial_adapters=..." option completely, these adapters are created
automatically as soon as you create that partition
And if you're using that scriptlet above, check the order of the partitions!
If there is an I/O server, it must be create BEFORE any partitions with virtual I/O are created.
But even that scriptlet isn't very useful, because "hscroot" may not redirect outputs to a file.
So what do we do? You can also use the lssyscfg output and put it onto the mksyscfg
commandline.
Instead of doing this:
mksyscfg -r lpar -m $(lssysconn -r all -F type_model_serial_num) -f partitioning_data.txt
do this:
mksyscfg -r lpar -m $(lssysconn -r all -F type_model_serial_num) -i profile_name=default,name=VIOS1,lpar_id=1,lpar_env=vioserver,all_resources=0,min_mem=512,desired_mem=512,max_mem=1024,proc_mode=shared,min_proc_units=0.3,desired_proc_units=0.5,max_proc_units=0.7,min_procs=1,desired_procs=2,max_procs=2,sharing_mode=uncap,uncap_weight=128,\"io_slots=21030002/none/1,21020002/none/1\",lpar_io_pool_ids=none,max_virtual_slots=10,\"virtual_scsi_adapters=4/server/any//any/0,3/server/any//any/0,5/server/any//any/0\",virtual_eth_adapters=2/0/1//1/0,boot_mode=norm,conn_monitoring=0,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,redundant_err_path_reporting=0
All of this has to go on one line and keep in mind that quotation marks may have to be quoted to keep the shell from removing them.
But an error message will remind you of that in case you have missed it.
mkvterm -m "$(lssysconn -r all -F type_model_serial_num)" -p $PARTITION_NAME
This simply opens a console connection to the LPAR named $PARTITION name. If you know the name of the P5 system, you
can open a console as easy as this:
ssh hscroot@somehmc mkvterm -m someP5 -p someLPAR
To close this connection, simply type "~~.". Eventually, you might have to type more "~", because the ssh session reacts
to that string as well. Dependent on the number of cascaded ssh sessions, you'll have to type more "~".
Another way to open a terminal is this simple, but nice command:
vtmenu
That's it for now, but it should get you started getting away from WebSM..


If I want to created virtual scsi disk to both a vio server and then to my clients on already existing LPARs and profiles, what is the syntax to do this? I have approximatley 100 disk drives that need to be presented to both the VIO and client and don't want to click my way through websm.
Thanks.
I'm not at work right now, but I'll have a look at it on monday, when I've got access to the machines
tq....
Contact me by email with details and we'll work something out.
i just started working with a vendor company and no experience to handle any aix.
so i need ur opinion where should i start to master the aix and unix?(im nw doing ibm P Series)
is there any useful webside or redbook that i need to study?thanks man...