Hardware Management Console Installation and Operations Guide


Using the Command Line

This chapter describes the remote commands that you can run to perform HMC functions.


Commands

You can perform basic HMC functions remotely by using a command line. These commands are located in the /opt/hsc/bin subdirectory. To enable or disable remote commands, see Enabling and Disabling Remote Commands.

Use the flags in the order shown in this table.

Command Flags Function
chcuod -o

Indicates the change Capacity Upgrade on Demand operation to perform.

-m

The machine type and serial number of the managed system to execute the operation. This name must be enclosed in double quotes and of the form mmm*sssss where mmm is the machine model type and sssss is the machine's serial number.

-k

The Capacity Upgrade on Demand activation key to be sent to the managed system.

Changes attributes for Capacity Upgrade on Demand
chhwres

-r "resources to change"where < resources = < [mem|cpu|slot|led]

-o "operation type"where < operation type = <[a|m|r|s]

-p"source-partition-name"

-t"target-partition-name" (for dynamic logical partitioning move only)

-i"drawer-id (for dynamic logical partitioning adapter operation only)

-s"slot-id (for dynamic logical partitioning adapter operation only)

-q"quantity (number of processors of amount of memory to add, move, or remove; should not be specified for slot resources)

-m"managed system"

-w"timeout Elapsed time in minutes after which the chhwres operation will be aborted

-d"detail-level An integer between 0 and 5 which specifies the level of detail that should be displayed upon return on chhwres operation.

-x led-index

The index number of the LED that is being set

-y led-type [sys | ident]

The type of LED; either system attention of identify

-v led-setting [on | off]

The value to set the LED to

Dynamic logical partitioning commands - can dynamically add, move, or remove processors, memory , or adapters; or turning managed system LEDs on or off.
get_cec_mode -m "managed system" Indicates whether the managed system is in full mode or partition mode
get_cec_mtms -m "managed system" Returns the machine type and serial number in the following format: machinetype_serialnumber
get_cec_state -m "managed system" Returns the current state of a managed system
get_cec_version -m "managed system" Returns the managed system's supported version.
get_op_panel -m "managed system" Displays operator panel LED contents for the specified partition

-p "partition name"
get_partiton_state -m "managed system" Returns the current state of a partition

-p "partition name"
lshwres

-r resource-type [ALL | io | cpu | mem | led]

the resources to list.

-m"managed-system

-p"partition-name

This value is specified if you want to view resources of a certain partition. If you want to view resources for the whole managed system, don't specify a partition.

-y"led-type

[sys | ident]

Type of LEDs to list

-F

format.

A list of names representing desired properties to query, delimited by colons.

Valid values are [system, name, key, state, status, id, parent, location, classcode, assign_to, index, location_code, max, min, allocated, free, lmb_size, drawer_id, slot_id, slot_type, phys_loc]

Lists hardware resources of a managed system, or of a given partition on a managed system.
power_off_cec -m "managed system" Powers off a managed system
power_on_cec -c "managed system" Powers on a managed system; -m starts it in either full or partition mode.
-m full | lpar

-b boot setting

where boot setting = norm | dd | sms | of | ds | std

Use the Standby (std) boot setting when booting to Partition (lpar) mode. Use the other five boot settings when booting to Full Machine Partition (full) mode: Normal (norm), Diagnostic Default Boot List (dd), SMS (sms), OpenFirmware OK Prompt (of), and Diagnostic Stored Boot List (ds).

query_cecs (none) Returns the user-defined names of all the systems managed by the HMC. Returns "managed system" in the following format, name_type-model (for example, server_7017-S90)
query_partition_names -m "managed system" Returns the names of all defined partitions on a managed system
query_profile_names -m "managed system"

-p "partition name "

Returns profile names for the specified partition on the managed system
rechwres

-m"managed-system

-p"partition name"

-r[ resource type]

-o[ a | r | m | ]

-u"processor id"

-i"drawer id"

-s"slot id"

-help


reset_partition -m "managed system" Performs a hard or soft reset of the operating system loaded on a partition

-p "partition name"

-t < reset type > where < reset type > = < hard | soft >
start_partition -p "partition name" Starts a partition with a given profile
-f "profile name"

-m "managed system"


Examples of Command Line Scripts

You can run the HMC's high-level commands that reside on the server from any client PC. The following examples use the ssh and rexec clients available with the OpenSSH protocol network connectivity suite:

For the examples, assume the following:

Example 1

[user@myclient user]$ ssh -l hmcuser hmc.mydomain.com /opt/hsc/bin/query_cecs 
hmcuser@hmc.mydomain.com's password:   
Property File Name : null 
Using default configuration settings. 
Managed Systems : 
----------------- 
Managed System 1  
 
 

Example 2

[user@myclient user]$ rexec -l hmcuser -p mypassword hmc.mydomain.com /opt/hsc/bin/query_cecs   
Property File Name : null  
Using default configuration settings.  
Managed Systems : 
-----------------  
Managed System 1

In the preceding examples, the ssh method is recommended over the rexec method, because the ssh method transports a secure cleartext copy of hmcuser's password across the network.


Setting up Secure Script Execution Between SSH Clients and the HMC

To enable unattended script execution between an ssh client and an HMC, do the following:

Note:
These steps assume that the SSH protocol is already installed on the system.

The following steps are examples from an ssh client running AIX:

  1. Enable the SSH protocol on the HMC. In the Navigation area, select HMC Maintenance.
  2. In the Navigation area, select System Configuration.
  3. In the Contents area, select Enable/Disable Remote Command Execution.
  4. When the window opens, select the box to enable ssh.
  5. Create an HMC user with one of the following roles:
  6. On the AIX system, run the the SSH protocol key generator. To run the SSH protocol key generator, do the following:
    1. To store the keys, create a directory named $HOME/.ssh (either RSA or DSA keys can be used).
    2. To generate public and private keys, run the following command:
      ssh-keygen -t  rsa
      

      Then, the following files are created in the $HOME/.ssh directory:

      private key: id_rsa 
      public  key: id_rsa.pub
      

      The write bits for both group and other are turned off. Ensure that the private key has a permission of 600.

  7. Create a .ssh directory on HMC by running the following command:
    ssh userid@host name "mkdir /home/userid/.ssh"
    

    where userid is the user ID you created and host name is the HMC host name.

  8. On the AIX system, use the scp (secure copy) command to move id_rsa.pub to a temporary file on the HMC by using the following command:
    scp   $HOME/.ssh/id_rsa.pub userid@host name: "/home/userid/.ssh/myid_rsa.pub"
    
  9. On the AIX system, use the ssh command to concatenate a temporary file onto the /home/hmcmanager/.ssh/autorized_keys2 directory by running the following command:
    ssh userid@host name "cat/home/userid/.ssh/myid_rsa.pub > /home/hmcmanager/.ssh/authorized_keys2"
    
  10. Use the ssh command to remove the temporary file on HMC by running the following command:
    ssh userid@host name "rm /home/userid/.ssh/myid_rsa.pub"
    

Deleting the Key from the HMC

To delete the key from the HMC, do the following:

  1. On AIX partition, use the scp command to copy the authorized_keys2 file from the HMC to the AIX partition.
    scp userid@host name :.ssh/authorized_keys2 /tmp/mykeyfile"
    
  2. Edit the /tmp/mykeyfile file and remove the line containing the key and host name that you want to disable password prompting when remotely executing HMC command with ssh.
  3. On an AIX partition, use the scp command to copy the new file over to the HMC by using the following command:
    scp /tmp/mykeyfile userid@host name ".ssh/authorized_keys2"
    
  4. If you want to enable password prompting for all hosts accessing the HMC via ssh, use the following ssh command to remove the key file from the HMC:
    ssh userid@host name "rm ./ssh/authorized_keys2"
    


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]