CLI commands examples
Common HMC command-line interface (CLI) commands are described in this appendix.
List and manage the HMC configuration
Use the commands described here to list and manage the HMC configuration.
lshmc
The lshmc command lists information related to the HMC itself, such as in these examples:
List the BIOS level of the HMC (this might not be relevant for virtual HMCs):
lshmc -b
List the network settings for the HMC:
lshmc -n
List the VPD information for the HMC:
lshmc -v
List detailed version and maintenance level of the HMC:
lshmc -V
List the state of the HMC Network Time Protocol (NTP) client, and IP address of its NTP server:
lshmc -r -F xntp
chhmc
Use the chhmc command to change the HMC configuration, as shown in these examples:
Change the HMC host name:
chhmc -c network -s modify -h newhostname
Set the IP address and network mask for network interface eth0:
chhmc -c network -s modify -i eth0 -a 10.10.10.1 -nm 255.255.255.0
Change the HMC date, time, and time zone:
chhmc -c date -s modify --datetime 110920262015
--clock local --timezone 'America/New_York'
Activate the NTP client, then add an NTP server and allow the firewall rule on eth1:
chhmc -c xntp -s enable
chhmc -c xntp -s add -h 172.16.20.1 -i eth1
hmcshutdown
Use the hmcshutdown to halt or reboot the HMC, as shown in these examples:
Reboot the HMC after 3 minutes:
hmcshutdown -t 3 -r
Halt the HMC immediately:
hmcshutdown -t now
Manage users on the HMC
Use the commands described here to manage users on the HMC.
lshmcusr
List HMC user information with the lshmc command, as shown in these examples:
List all HMC users:
lshmcusr
List only user names and managed resource roles for all HMC users, and separate the output values with a colon:
lshmcusr -F name:resourcerole
List the HMC users hscroot and user1:
lshmcusr --filter "names=hscroot,hscpe"
List all user with hmcpe task roles:
lshmcusr --filter taskroles=hmcpe -F name
mkhmcusr
Create HMC user information with the mkhmcusr command, as shown in these examples:
Create the user myhmcuser (the user’s password must be entered when prompted); use either of the following commands:
mkhmcusr -u myhmcuser -a hmcviewer
mkhmcusr -i "name=myhmcuser,taskrole=hmcviewer"
Create user hscpe, with the hmcpe task role and a seven-character password:
mkhmcusr -u hscpe -a hmcpe -d pe --passwd abc1234
chhmcusr
Use the chhmcusr command to change HMC user information, as shown in these examples:
Change the password for the user tester (the new password must be entered when prompted):
chhmcusr -u tester -t passwd
rmhmcusr
Use the rmhmcusr command to remove HMC user information, as in this example:
Remove the user tester:
rmhmcusr -u tester
Manage systems configuration
The commands described here are for managing systems configuration.
lssyscfg
The lssyscfg command lists system resources, as shown in these examples:
List all systems that are managed by this HMC with their current state, with a header:
lssyscfg -r sys -F name,state --header
List all partitions in the managed system, and display their name, operating system environment type, operating system version, ID, and current state, using a colon as a separator:
lssyscfg -r lpar -m 740-2 -F name:lpar_env:os_version:lpar_id:state
List all partitions in the managed system, and display their name, Resource Monitoring and Control (RMC) state, and RMC IP address:
lssyscfg -r lpar -m 740-2 -F name,rmc_state,rmc_ipaddr
mksyscfg
The mksyscfg command creates resources, as shown in these examples:
Create an AIX or Linux partition:
mksyscfg -r lpar -m 740-2 -i name=itsolpar,profile_name=prof1,lpar_env=aixlinux,min_mem=256,desired_mem=1024,max_mem=1024,proc_mode=ded,min_procs=1,desired_procs=1,max_procs=2,sharing_mode=share_idle_procs,auto_start=1,boot_mode=norm,lpar_io_pool_ids=3,"io_slots=21010003/3/1,21030003//0"
Create partition profiles by using the configuration data in the /tmp/profcfg file:
mksyscfg -r prof -m 740-2 -f /tmp/profcfg
Create a partition profile by saving the current configuration of a partition:
mksyscfg -r prof -m 740-2 -o save -p p1 -n newProfile
chsyscfg
The chsyscfg command changes system resources, as shown in this example:
Change a partition profile’s memory amounts (reduce the profile’s current memory amounts each by 256 MB), and number of processors you want:
chsyscfg -r prof -m 740-2 -i name=prof1,lpar_name=itsolpar,min_mem=256,desired_mem=256,max_mem=256,desired_procs=2
rmsyscfg
Use the rmsyscfg command to remove a system resource, as shown in these examples:
Remove the partition lpar1:
rmsyscfg -r lpar -m 740-2 -n lpar1
Remove the partition profile test_profile for partition lpar1:
rmsyscfg -r prof -m 740-2 -n test_profile -p lpar1
Manage hardware resources
The commands described here are for managing hardware resources.
lshwres
List hardware resources with the lshwres command, as show in these examples:
List all system level memory information:
lshwres -r mem -m 740-2 --level sys
List all virtual slots for partition lpar1:
lshwres -r virtualio --rsubtype slot -m 740-2 --level slot --filter “lpar_names=lpar1”
chhwres
Use the chhwres command to change hardware resources, as shown in these examples:
Move 0.5 processing units from the partition with ID 3 to the partition with ID 5 (both partitions are using shared processors):
chhwres -r proc -m 750-1 -o m --id 3 --tid 5 --procunits 0.1
Add 1 GB of memory to the partition named p750_aix2, and time out after 10 minutes:
chhwres -r mem -m 750-1 -o a -p p750_aix2 -q 1024 -w 10
Move the partition sharedlpar1 to shared processor pool pool1:
chhwres -r procpool -m 740-2 -o s -p sharedlpar1 -a "shared_proc_pool_name=pool1"
Add a virtual Ethernet adapter to the partition p750_aix3, in slot 9, with PVID 4 and VLANs 105 and 106:
chhwres -r virtualio -m 750-1 -o a -p p750_aix3 --rsubtype eth -s 9 -a ieee_virtual_eth=1,port_vlan_id=4,"addl_vlan_ids=105,106"
Commands to manage system connection
Use the commands described here to manage system connection.
lssysconn
The lssysconn command displays the systems and frames connected to the HMC, as shown in this example:
List connection information for all systems and frames that are managed by this HMC:
lssysconn -r all
mksysconn
Use the mksysconn command to create a system connection, as shown in these examples:
Connect to and add the system with the IP address 9.3.152.145 (the HMC Access password for the system must be entered when prompted):
mksysconn --ip 9.3.152.145
Enable all systems and frames to be automatically discovered by the HMC when using DHCP:
mksysconn -o auto
rmsysconn
Remove system connection with the rmsysconn command, as shown in this example:
Disconnect from the managed system sytem1, and remove it from the HMC:
rmsysconn -o remove -m 740-2
Manage Capacity on Demand (CoD) resources
Use the commands described here to manage CoD resources.
lscod
Use the lscod command to list CoD information, as shown in these examples:
Display CUoD processor capacity information:
lscod -m 740-2 -t cap -r proc -c cuod
Display CUoD processor activation code generation information:
lscod -m system1 -t code -r proc -c cuod
Display the CoD history log:
lscod -m 740-2 -t hist
chcod
Use the chcod command to change CoD resources, as shown in these examples:
Enter a CoD code:
chcod -m 740-2 -o e -k code
Activate 2 GB of On/Off CoD memory for 10 days:
chcod -m 740-2 -o a -c onoff -r mem -q 2048 -d 10
Deactivate all On/Off CoD processors:
chcod -m 740-2 -o d -c onoff -r proc
Use VM virtual terminals
The commands in this section describe are for using VM virtual terminals.
mkvterm
Open a virtual terminal session for a Linux, AIX, or Virtual I/O Server partition with the mkvterm command, as shown in this example:
Open a virtual terminal session for partition lpar1:
mkvterm -m 740-2 -p p740_2_vio2
rmvterm
Use the rmvterm command to close a virtual terminal session, as shown is this example:
Close a virtual terminal session for partition lpar1
rmvterm -m 740-2 -p p740_2_vio2
vtmenu
Use the vtmenu command for an interactive session where you can select a logical partition to connect to with a virtual terminal session, as shown in Example B-1.
Example: B-1 vtmenu selection
----------------------------------------------------------
Partitions On Managed System: 750-1
OS/400 Partitions not listed
----------------------------------------------------------
1) LPAR1 Running
2) p750_1_vio1 Running
3) p750_1_vio2 Running
4) p750_aix1 Not Activated
5) p750_aix3 Running
 
 
Enter Number of Running Partition (q to quit):
 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset