HMC Command Line Interface (CLI) support is provided so that users can write scripts to automate their system management tasks. Therefore, it is the intent to provide a command line interface for every HMC function that users may want to automate. Command line interfaces for other HMC functions will also be provided as required.
The command line interface is not available from a remote HMC. From a local HMC, the interface is available by right-clicking on the desktop (outside of the HMC web user interface screen). Click on 'Terminals' and 'rshlogin'. A restricted shell command line window will appear.
AudienceAll parts of this course are directed toward IBM customers.
Prerequisites
A basic understanding of web site navigation is all you need. No prior knowledge of command line interface information is assumed. However, before doing any work with managed systems, be sure you have an understanding of the difference between logical partitions (LPARs), partition profiles, and system profiles.
Migration Considerations
While the HMC for Power6 systems does not support legacy systems, it is still desirable to support the existing syntax when possible. Because eServer p6 hardware and requirements are vastly different from legacy hardware and requirements, the syntax of many commands has been changed, and the old syntax has been deprecated. Deprecated syntax is not supported on eServer p6 and OpenPower systems.
When a command is issued using deprecated syntax, if there is a replacement command that performs an equivalent function then an error message is displayed that gives the new command syntax to use. If there is not a replacement command available, then a general invalid syntax error message is displayed.
Command Help
Help text is available for each HMC command. The help text for a command consists of the command usage statement, a brief description of the command's function, a brief description of each of the command's parameters, and a list of any attributes that can be specified with the command. (An index of all Command Attributes can be found here.) The help text refers you to the man pages and publications for examples and additional information.
The intent of a command's help text is to remind you what the parameters and attribute names are for the command. As such, it is not intended to give detailed information for the first-time user. First-time users should go to the man pages or publications for detailed information about commands.
To display help text, all HMC commands support the --help parameter. In addition, the help text is displayed for a command when a command is entered without any parameters.
When the --help parameter is included with a command, any other parameters entered with the command are ignored, and the help text for the command is displayed.
Command Conventions
The following UNIX conventions are used for command names:
· mk is used for create/make actions.
· ls is used for list/query actions.
· ch is used for change/modify actions.
· rm is used for remove/delete actions.
Commands are of the form: verb followed by an abbreviated name of the object on which the command will be performed. For example, lssyscfg is the command to list system configuration, lshmcusr is the command to list HMC users, etc.
Commands must always have a return value. A return code of 0 is returned if the command was successful, and a non-zero return code is returned if the command failed.
If a command fails, an appropriate error message is printed. All command error messages are printed to stderr. All other command output are printed to stdout.
In general, commands should not print warning messages, and should not require interactive input from users. Since many users will write scripts to issue HMC commands, warning messages and interactive input would not be useful.
Whenever parameter data consists of non-alphanumeric characters, the data must be enclosed in double quotes.
All parameters that are a single character must be preceded with a single dash. All parameters longer than a single character must be preceded with a double dash.
Non-numerical parameter and attribute values should be meaningful. Meaningful string values are preferred over arbitrary numerical values.
Attribute names should be consistent across all commands. The same is true for parameter names, parameter values, filter names, and attribute values. Words that are abbreviated should always be abbreviated in the same way. Common abbreviations should be used to reduce the number of characters the user needs to type.
The names of attributes and filters that accept lists should be plural.
All commands must have man pages.
All commands must support the --help parameter.
All list commands must support the -F parameter. This facilitates tokenizing the output. List commands should also print a well-formatted report if the -F parameter is not specified.
Note: throughout this course, command elements that are representative examples are enclosed in "arrow" brackets. Here is an example:
lssyscfg -r sys -m
In this example,
A value for
A value for
Setting the Power Off Policy
The default power off policy for a managed system is that the system powers itself down when the last partition has been powered down. It is recommended that the managed system's power off policy be set to 1, so that the managed system continues to run after the last partition has been powered off.
To do this, type the following command:
chsyscfg -r sys -m
Powering Off the Manufacturing Installed Partition
The preconfigured manufacturing partition with an ID of 1 has been assigned all of the system's resources. You will need some free resources when you create partitions. Therefore, it is recommended that you power off the manufacturing installed partition before creating partitions.
To do this, type the following command:
chsysstate -r lpar -m
Commands by Task:
Activate CoD Advanced Functions - chvet
Activate On/Off CoD resources - chcod
Activate partition - chsysstate
Activate system profile - chsysstate
Add memory to a partition - chhwres
Add processors to a partition - chhwres
Change the number of Utility CoD processors - chcod
Create LPAR - mksyscfg
Create LPAR profile - mksyscfg
Create system profile - mksyscfg
Deactivate all On/Off CoD processors - chcod
Deactivate all On/Off CoD resources - chcod
Delete LPAR - rmsyscfg
Delete LPAR profile - rmsyscfg
Delete system profile - rmsyscfg
Display activation code generation information - lsvet
Display activation history log - lsvet
Enter a Capacity on Demand (CoD) code - chcod
Fast power off the managed system - chsysstate
Get LPAR state - lssyscfg
Hard partition reset - chsysstate
List all partitions in a managed system - lssyscfg
List all systems managed by the HMC - lssyscfg
List CoD capacity information - lscod
List CoD code generation information - lscod
List CoD history log - lscod
List HMC remote access settings - lshmc
List HMC network settings - lshmc
List HMC VPD information - lshmc
List HMC version - lshmc
List I/O resources for a managed system - lshwres
List Licensed Internal Code levels - lslic
List LPAR profile properties - lssyscfg
List LPAR properties - lssyscfg
List managed system properties - lssyscfg
List memory resources - lshwres
List On/Off CoD billing information - lscod
List processor resources - lshwres
List reference code entries - lsrefcode
List system profile properties - lssyscfg
List virtual I/O resources for a managed system - lshwres
Modify LPAR profile properties - chsyscfg
Modify LPAR properties - chsyscfg
Modify managed system properties - chsyscfg
Modify system profile properties - chsyscfg
Move a physical I/O slot from one partition to another - chhwres
Move memory from one partition to another - chhwres
Move processors from one partition to another - chhwres
Power off the managed system - chsysstate
Power on the managed system - chsysstate
Re-IPL the managed system - chsysstate
Remove a physical I/O slot from a partition - chhwres
Remove memory from a partition - chhwres
Remove processors from a partition - chhwres
Set a Utility CoD processor minute usage limit - chcod
Soft partition reset - chsysstate
Update Licensed Internal Code - updlic
Validate a system profile - chsysstate
Commands by Name:
asmmenu - launch the ASM interfacebkconsdata - back up critical HMC databkprofdata - back up profile data for the managed-systemchaccfg - change access control configuration
chcod - perform Capacity on Demand (CoD) operations
enter a CoD code
activate an amount of CoD resources
change the number of Utility CoD processors
deactivate all On/Off CoD processors
deactivate all On/Off CoD resources
set a Utility CoD processor minute usage limit
chhmc - change HMC configuration informationchhmcusr - change HMC user attributechhwres - change system memory and processor resources
add memory to a partition
add processors to a partition
move memory from one partition to another
move processors from one partition to another
remove memory from a partition
remove processors from a partition
chkmedia - check media readinesschled - change LEDchlparutil - change utilization data collection settingschsacfg - change Service Agent configurationchsvcevent - update serviceable events on the HMCchsyscfg - change system configuration
modify LPAR properties
modify LPAR profile properties
modify managed system properties
modify system profile properties
chsyspwd - change system passwordchsysstate - change system state
activate partition
activate system profile
fast power off the managed system
hard partition reset
power off the managed system
power on the managed system
re-IPL the managed system
soft partition reset
chvet - activate Capacity on Demand advanced funtions
enter an activation code
cpdump - copy dumpscpsysplan - copy system plandefsysplanres - define system plan resourcedeploysysplan - deploy system plandump - perform dump operationgetdump - get dumpgetupgfiles - get upgrade fileshmcshutdown - shut down the HMChmcwin - proide screen capture on the HMCinstallios - install the Virtual I/O Serverlogssh - log ssh command usagelpar_netboot - retrieve MAC address and physical location code from network adapters for a partition or instruct a partition to network bootlpcfgop - perform a partition configuration image operationlsaccfg - list access control configuration informationlscod - list Capacity on Demand resources for a managed system
list CoD capacity information
list CoD code generation information
list CoD history log
list On/Off CoD billing information
lsdump - lists dump informationlshmc - List HMC Configuration Information
list HMC remote access settings
list HMC network settings
list HMC VPD information
list HMC version
lshmcusr - list HMC user informationlshwinfo - list environmental informationlshwres - list the hardware resources of a managed system
determine DRC indexes for physical I/O slots
determine memory region size
list I/O resources for a managed system
list memory resources
list processor resources
list virtual I/O resources for a managed system
lsled - list LEDslslic - list Licensed Internal Code (LIC) levels
list LIC levels active on a managed system
list LIC levels available in a repository
lslock - list lock informationlslparutil - list utilization datalsmediadev - list storage media deviceslsrefcode - list reference code entries for partitions or managed systems
list reference code entries for all partitions
list reference code entries for a managed system
lssacfg - list Service Agent configuration informationlssvcevents - list console or serviceable eventslssyscfg - list system configuration information
get LPAR state
list all partitions in a managed system
list all systems managed by the HMC
list LPAR profile properties
list LPAR properties
list managed system properties
list system profile properties
lssysconn - list system connectionslssysplan - list system planslssysplanres - list system plan resources
lvet - list Capacity on Demand advanced functions
display activation code generation information
display activation history log
migrcfg - migrate configurationmkaccfg - create access control objectmahmcusr - create an HMC usermksyscfg - create system configuration
create LPAR profile
create system profile
mksysconn - create system connectionmksysplan - make system plan filemkvterm - open a virtual terminal sessionmonhmc - monitor HMC subsystems and system resourcespedbg - Product Engineering debug toolspesh - provide PE Shell accessrmaccfg - remove access control objectrmhmcusr - remove an HMC userrmlock - remove lockrmlparutil - remove utilization datarmprofdata - remove profile datarmsyscfg - remove system configuration
delete LPAR
delete LPAR profile
delete system profile
rmsysconn - remove system connectionrmsysplan - remove system planrmsysplanres - remove system plan resourcermvterm - close a vertual terminal sessionrsthwres - restore hardware resourcesrstprofdata - restore profile datarstupgdata - restore upgrade datasaveupgdata - save upgrade datasendfile - transfer file from the HMC to a remote systemstartdump - start dumpupdhmc - update code on the HMCupdlic- update Licensed Internal Code (LIC)
retrieve, install, activate updates
retrieve and install updates
remove the last update
change LIC update control to HMC
change LIC update control to operating system
viosvrcmd - issue virtual I/O server command
Powering On the Managed System
Use the chsysstate command to power on the managed system. This power on option is similar to a "White Button" power on. Enter the following:chsysstate -r sys -m
Powering Off the Managed System
Use the chsysstate command to power off the managed system. This can be done in two ways.
To power off a managed system normally, type the following:
chsysstate -r sys -m
You can also perform a fast power off (operator panel function 8) of a managed system. To do this, type the following command:
chsysstate -r sys -m
Updating Licensed Internal Code
Use the updlic command to retrieve, install, and activate Licensed Internal Code on a managed system. Use the -q parameter to determine if the update is disruptive.
To determine if the latest CPC update from IBM Retain is disruptive:
updlic -m
To change LIC update control on the managed system from HMC to operating system:
updlic -m
Listing HMC Current Configuration
Use the lshmc command to list the current remote access settings, network settings, version, and Vital Product Data (VPD) information for the HMC.
To list the remote access settings for ssh, websm, and http:
lshmc -r
To list the HMC hostname and network IP address:
lshmc -n -F hostname,ipaddr
To list the HMC Vital Product Data (VPD) information:
lshmc -v
Display the HMC version information:
lshmc -V
Listing all Systems Managed by the HMC
Use the lssyscfg command to list system configuration and managed system MTMS information. To list the properties of all systems managed by this HMC, enter the following:
lssyscfg -r sys
To list only the user-defined names, model types, serial numbers, and states for all of the systems managed by this HMC, enter:
lssyscfg -r sys -F name,type_model,serial_num,state --header
Note that after executing this command,
Listing a Managed System's Properties
To list a specific managed system's properties, enter:
lssyscfg -r sys -m
Modifying the Managed System Properties
Use the chsyscfg command to change the properties of a managed system. The following example shows how to change the managed system's user-defined name and power off policy:
chsyscfg -r sys -m
Valid attributes, specified with the –i flag, include:
new_name
power_on_side
power_off_policy
power_on_speed
service_lpar_id
power_on_speed_override
service_lpar_name
Instead of entering configuration information on the command line with the -i flag, the information can be placed in a file and the filename specified with the -f flag.
For more information about the valid attributes listed in this command example, refer to the Command Attributes table.
Listing Reference Codes for a Managed System or Partition
Use the lsrefcode command to list SRC entries for a managed system or partition. Entries may be filtered by lpar name or lpar id.
To list the last 10 SRC entries for the managed system:
lsrefcode -m
To list the current SRC entry for each partition on the managed system:
lsrefcode -m
lsrefcode -m
Restarting the Managed System
To restart the managed system, enter:
chsysstate -r sys -m
Listing Licensed Internal Code Levels for a Managed System
Use the lslic command to list the LIC levels (cpc or power) on a partition or managed system that have been installed, activated, and accepted. You may also list available levels in a repository.
To list current CPC LIC levels on a managed system:
lslic -m
To list available POWER LIC levels in a repository:
lslic -m
Listing Capacity on Demand Information for a Managed System
Use the lscod command to list memory and processor Capacity on Demand information for a managed system, including capacity, code generation, and CoD history logs for Capacity Upgrade on Demand (CUoD) and On/Off Capacity on Demand (OOCoD). More CoD operations are covered in 10.0 CLI: Performing Capacity on Demand (CoD) Operations.
To list On/Off CoD processor capacity information:
lscod -m
To list CUoD memory activation code generation information:
lscod -m
To list the Capacity on Demand history log:
lscod -m
To Display On/Off Capacity on Demand memory billing information:
lscod -m
Creating LPARs
Use the mksyscfg command to create a partition.
The following is an example of how to create an AIX/Linux partition:
mksyscfg -r lpar -m
The following is an example of how to create an i5/OS (OS/400) partition:
mksyscfg -r lpar -m
Valid attributes, specified with the –i flag, include:
name
desired_proc_units
min_proc_units
lpar_id
max_proc_units
ecs_slot
profile_name
lpar_io_pool_ids
sni_windows
lpar_type
io_slots
alt_console_slot
cluster_id
boot_mode
sni_device_ids
sharing_mode
max_virtual_slots
console_slot
desired_procs
auto_start
sni_config_mode
min_procs
power_ctrl_lpar_ids
alt_load_source_slot
max_procs
virtual_opti_pool_id
virtual_serial_adapters
desired_mem
hsl_opti_pool_id
load_source_slot
min_mem
min_interactive
virtual_scsi_adapters
max_mem
desired_interactive
uncap_weight
proc_type
max_interactive
virtual_eth_adapters
lnstead of entering configuration information on the command line with the -i flag, the information can instead be placed in a file, and the filename specified with the -f flag.
For more information about the valid attributes listed in this command example, refer to the Command Attributes table.
Listing All Partitions in a Managed System
Use the lssyscfg command to list all partitions in a managed system. To do this, enter:
lssyscfg -r lpar -m
To list only the names, IDs, and states of all partitions in a managed system, enter:
lssyscfg -r lpar -m
Listing LPAR Properties
Use the lssyscfg command to list the properties of a specific partition. Type the following:
lssyscfg -r lpar -m
Note that the partition name can be specified instead of the partition ID by using the lpar_names filter in place of the lpar_ids filter. Also, more than one partition may be specified in the filter list.
For information on using the lshwres command to list a partition's I/O, virtual I/O, processor, and memory resources, see Listing Hardware Resources.
Getting the LPAR State
Use the lssyscfg command to display the state of a partition. Type the following:
lssyscfg -r lpar -m
Note that the partition ID can be specified instead of the partition name by using the lpar_ids filter in placeof the lpar_names filter. Also, more than one partition may be specified in the filter list.
Listing All Partitions in a Managed System
Use the lssyscfg command to list all partitions in a managed system. To do this, enter:
lssyscfg -r lpar -m
To list only the names, IDs, and states of all partitions in a managed system, enter:
lssyscfg -r lpar -m
Listing LPAR Properties
Use the lssyscfg command to list the properties of a specific partition. Type the following:
lssyscfg -r lpar -m
Note that the partition name can be specified instead of the partition ID by using the lpar_names filter in place of the lpar_ids filter. Also, more than one partition may be specified in the filter list.
For information on using the lshwres command to list a partition's I/O, virtual I/O, processor, and memory resources, see Listing Hardware Resources.
Getting the LPAR State
Use the lssyscfg command to display the state of a partition. Type the following:
lssyscfg -r lpar -m
Note that the partition ID can be specified instead of the partition name by using the lpar_ids filter in placeof the lpar_names filter. Also, more than one partition may be specified in the filter list.
Using a Soft Partition Reset
Use the chsysstate command to perform a soft reset of a partition. Type the following:
chsysstate -r lpar -m
The partition ID can be specified instead of the partition name by using the --id parameter instead of the -n parameter.
Using a Hard Partition Reset
Use the chsysstate command to perform a hard reset of a partition. Type the following:
chsysstate -r lpar -m
The partition name can be specified instead of the partition ID by using the -n parameter instead of the --id parameter.
Deleting an LPAR
Use the rmsyscfg command to remove a partition. Type the following:rmsyscfg -r lpar -m
This command removes the specified partition and all of its associated partition profiles from the specified managed system. The partition’s profiles are also removed from any system profiles that contain them.
The partition ID can be specified instead of the partition name by using the --id parameter instead of the -n parameter
Use the chhwres command to to perform dynamic logical partitioning (DLPAR) operations on running partitions. DLPAR operations can be performed for memory, physical I/O slots, and processor resources.
Memory
Memory can be dynamically added to a partition, removed from a partition, or moved from one partition to another. In the following commands, the quantity of memory to be added, removed, or moved must be specified with the -q flag. This quantity is in megabytes, and must be a multiple of the memory region size for the managed system.
Determining Memory Region Size
To see what the memory region size is for the managed system, enter this command:
lshwres -r mem -m
The value returned is the memory region size in megabytes.
Adding Memory to a Partition
To add memory to a partition, enter this command:
chhwres -r mem -m
Removing Memory from a Partition
To remove memory from a partition, enter this command:
chhwres -r mem -m
Moving Memory from One Partition to Another
To move memory from one partition to another partition, enter this command:
chhwres -r mem -m
No comments:
Post a Comment