Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Wednesday, 18 September 2013

Useful HMC commands

USEFUL HMC COMMANDS

Here are some very useful commands for the Hardware Management Console (HMC): Show vital product data, such as the serial number:
# lshmc -v
Show the release of the HMC:
# lshmc -V
Show network information of the HMC:
# lshmc -n
Reboot the HMC:
# hmcshutdown -r -t now
Show the connected managed systems:
# lssysconn -r all
Change the password of user hscpe:
# chhmcusr -u hscpe -t passwd -v abc1234
List the users of the HMC:
# lshmcusr
These are intersting log files of the HMC:
# ls -al /var/hsc/log/hmclogger.log
# ls -al /var/hsc/log/cimserver.log
Monitor the disk space:
# monhmc -r disk
This can be used to view the file systems of the HMC. Try using "proc", "mem" and "swap as well. By default this command will loop forever and update the screen every 4 seconds. You can run it only once, with the following command:
# monhmc -r disk -n 0
Zero out log files:
# chhmcfs -o f -d 0
This will delete any temporary files. Extremely useful if the HMC calls home to IBM about high usage of one of its file systems. Open a virtual console from the HMC:
# vtmenu
Exit by typing "~." (tilde dot) or "~~." (tilde tilde dot). Force the closure of a virtual terminal session:
# rmvterm -m SYSTEM-9117-570-SN10XXXXX -p name
Change the state of a partition:
# chsysstate -m SYSTEM-9131-52A-SN10XXXXX -r lpar -o on -n name
-f default_profile
# chsysstate -m SYSTEM-9131-52A-SN10XXXXX -r lpar -o shutdown 
-n name --immed
To start all partitions of one managed server:
# chsysstate -m Prd2-Server-8233-E8B-SN0XXXXXX -r lpar -o on --all
List partition profiles for a managed system:
# lssyscfg -r prof -m SYSTEM-9117-570-SN10XXXXX
List partition information:
# lspartition

HMC command line

HMC command line:
commands have --help option and man pages

lssyscfg -r sys -F name | grep aix21                          shows the full name of the managed system (what we can use in other commands)
lssyscfg -r lpar -m -F name                  shows the full name of the lpars of the managed system
lssyscfg -r sys -m -F name,state --header    shows the state of the managed system
lssyscfg -r lpar -m -F name,state --header   shows the state of the lpars of the managed system
lssyscfg -r prof -m aix10-SN0603C6H --filter "lpar_names=aix10" -F name,boot_mode   it will show the boot mode in the profile

lshwres -r mem -m --level sys                shows memory information of the managed system
lshwres -r mem -m --level lpar               shows memory information of lpars of the managed system
lshwres -r proc -m --level sys               shows processor information of the managed system
lshwres -r proc -m --level lpar              shows processor information of lpars of the manage system
lshwres -r io -m --rsubtype slot             shows IO slot information
lshwres -r proc -m --level sys -F installed_sys_proc_units:configurable_sys_proc_units

lshwres -r virtualio --rsubtype scsi -m --level lpar               lists scsi devices by LPAR
lshwres -r virtualio --rsubtype eth -m --level lpar                lists virt. eth. devices by LPAR
lshwres -r virtualio --rsubtype eth -m --level lpar -F lpar_name,port_vlan_id

chsysstate -m -o standby -r sys  
            power on a system to standby
chsysstate -r sys -m -o off                  normal power off the managed system
chsysstate -r sys -m -o off --immed          fast power off the managed system

chsysstate -m -r lpar -n -o shutdown --restart          it will reboot an lpar with dump
chsysstate -m -r lpar -n -o shutdown --immed --restart  it will reboot an lpar immediately (without dump)
chsysstate -m -r lpar -n -o shutdown --immed            it will shutdown the oprating system
chsysstate -m aix10-SN65158BE -o on -r lpar -n aix10 -f default                     it will activate an lpar

lspartition -dlpar                                            shows dlpar capable partitions
                                                              (it will show if RMC connection is OK between the HMC and LPAR)

lssysconn -r all                                              to see what IPs are assigned by the HMC
mksysconn -o auto                                             tells HMC to re-discover all servers' IP address

lssvcevents -t console -d 60                                  lists console events in the past 60 days
lssvcevents -t hardware -d 0                                  list serviceable events which occured today

lshmc -V                                                      hmc version
lshmv -v                                                      hmc model
lshmc -n                                                      lists the network settings of the hmc
hmcshutdown -t now -r                                         reboot the HMC (-t: timing in minutes, -r: reboot)

vtmenu                                                        hmc menu options (console session can be opened as well)
logout: ~~. (2 tilde and a dot)

------------------------------------

Default root password: passw0rd (try su -)

------------------------------------

opening/closing virtual terminal from hmc:

lssyscfg -r sys -F name                         <--get br="" managed="" name="" system="">lssyscfg -r lpar -m -F name    <--get br="" lpar="" name="">
mkvterm -m -p            <--opens a="" br="" terminal="" window="">rmvterm -m -p            <--closes a="" br="" nbsp="" terminal="" window="">
~~.                                             <--logout aix="" div="" from="" leave="" necessary="" not="" session="" te="" to="">

HMC and IBM POWER7 SYSTEMS INSTALL


HMC and IBM POWER7 SYSTEMS INSTALL:

HMC network types and configuration:

HMC to managed system (private network):
This is the connection between the HMC and the service processor, which is resposible for the hardware management functions (HMC controls the Power System through the service processor of the managed system)

HMC to logical partition (open network):
This is the connection to all the LPARS and through this connection you can do dynamic LPAR operations and hardware error events can be collected from the LPARs as well.

HMC to remote users:
Remote users can access the HMC in the following ways:
- By using the Web browser to access HMC GUI
- By using SSH to access the HMC command line

HMC to service and support:
You can use this communications path to make automatic service calls. (Transmit data, such as hardware error reports, inventory data, and microcode updates, to
and from your service provider.)

--------------------------------------

Private and open networks in the HMC environment:

Private networks
The only devices on the HMC private network are the HMC itself and each of the managed systems to which that HMC is connected. The HMC is connected to each managed system's FSP (Flexible Service Processor). On most systems, the FSP provides two Ethernet ports labeled HMC1 and HMC2. This allows you to connect up to two HMCs.



This figure shows a redundant HMC environment with two managed systems. The "blue" HMC is connected to the first port on each FSP, and the "red" (redundant) HMC is connected to the second port. Each HMC is configured as a DHCP server, using a different range of IP addresses. The connections are on separate private networks. As such, it is important to ensure that no FSP port is connected to more than one HMC.

Each managed system's FSP port that is connected to an HMC requires a unique IP address. To ensure that each FSP has a unique IP address, use the HMC's built-in DHCP server capability. When the FSP detects the active network link, it issues a broadcast request to locate a DHCP server. When correctly configured, the HMC responds to that request by allocating one of a selected range of addresses.

(If you have more than one HMC, you must also connect each HMC to the logical partitions, and to each other, on the same open network.)


Open networks
The open (public) network can be connected to a firewall or router for connecting to the Internet. Connecting to the Internet allows the HMC to "call home" when there are any hardware errors that need to be reported.


This figure shows two HMCs connected to a single managed server on the private network and to three logical partitions on the public network.

If you decide to use a private network, use DHCP, and if you will use an open network to manage an FSP, you must set the FSP’s address manually through the Advanced System Management Interface menus. A private, non-routable network is recommended


--------------------------------------

INSTALLING AND CONFIGURING A NEW HMC:

If this is a new installation, ensure that the managed system is not connected to a power source. If this is a second HMC that is connected to the same managed system, the managed system can be connected to a power source.

1.  Turn on the HMC and wait for the HMC to automatically select the default language and locale preference after 30 seconds.
 
2.  Accept the Hardware Management Console license agreements and click "Log on and launch the Hardware Management Console web application."

3.  Login with hscroot und default-pw abc123
 
4.  Launch "Guided Setup Wizard"


5.  Change date/time/timezone

6.  Change default password for hscroot

7.  Configure HMC networks


    eth0 (private network):
    network type = private network
    Speed = default is "Autodetection" (if conn. to a switch, configure it manually: HMC management -> Change network sett. -> LAN Adapter)
    Enable DHCP = specify a DHCP address range
    (You can configure the HMC to be a DHCP server only on a private network)

    eth1 (public network: hmc-admin interface)
    network type = public network
    speed = default is "Autodetection" (if conn. to a switch, configure it manually: HMC management -> Change network sett. -> LAN Adapter)
    setup IP, netmask and gateway

8. Enable firewall-settings for eth1 (in the eth1 dialog-box)
    check or allow the following Services and Ports:
    ssh                         22:tcp
    secure remote web access    443:tcp,8443:tcp,9960:tcp
    RMC                         657:udp,657:tcp

9. Leave all other dialogs unchanged and finish changes made by the Wizard.

10. On the main view click on „HMC-Management“ and do the following:
    Enable „Remote Command execution“
    Enable „Remote Virtual Terminal“
    Enable „Remote Operation“

11. Reboot the HMC (so configuration changes will be available)

12. Login with the new hscroot password

13. Plug network cables into the HMC and check if HMC is answering DHCP request by plugging the cable to your laptop.

Important:
Your Ethernet connection to the managed server must be made using the Ethernet port that is defined as eth0 on your HMC.
The HMC supports only one additional Ethernet adapter. If an additional Ethernet adapter is installed, that port is defined as eth0.
In this case, the primary integrated Ethernet port is then defined as eth1, and the secondary integrated Ethernet port ID defined as eth2.
If no adapters are installed, the primary integrated Ethernet port is defined as eth0.

--------------------------------------

Determining HMC adapter names:

If you set up a DHCP server, that server can operate only on eth0 and eth1.(You might need to determine which adapter to plug the ethernet cable into.)

To determine the name the HMC has assigned to an Ethernet adapter, do the following:
1. Open the restricted shell terminal. Select HMC Management -> Open Restricted Shell Terminal.
2. Type the following at the command line: tail -f /var/log/messages
3. Plug in your Ethernet cable. (If the cable was already plugged in, then unplug it, wait 5 seconds, and plug in the cable again.)
5. You will see a similar output on the console: Aug 28 12:41:20 termite kernel: e1000: eth0: e1000_watchdog: NIC Link is Up 100.
6. Repeat this procedure for all other Ethernet ports, and record your results.
7. Type Ctrl+C to stop thetailcommand.

--------------------------------------

Testing the connection between the HMC and the managed system:

This option enables you to verify that you are properly connected to the network:
(to test network connectivity, you must be a member of super administrator or service representative)
1. In the Navigation area, click HMC Management.
2. Click Test Network Connectivity.
3. In the Ping tab, type the host name or IP address of any system to which you want to connect. To test an open network, type the gateway.
4. Click Ping.

--------------------------------------
--------------------------------------
--------------------------------------

INSTALLING A NEW POWER SYSTEM (Logging into ASMI):

(If server is cabled with HMC and then started up (and you have waited 5 minutes), but did not show up in HMC, then in ASMI check Network config.)

Important: Do not connect an Ethernet cable to either the HMC1 port or the HMC2 port until you are directed to do so later in this procedure.
Important: If you attach an Ethernet cable to the service processor before the system reaches power off standby, the IP address shown in the Service processor network configuration table might not be valid.

1. If the server is not powered on, plug into the power source.
   (You may need to remove the power supply shipping bracket (if present))

   The system can take several minutes to apply power. When the power cable is connected, the green ac LED on the power supply is lit.
   Wait for the control panel to display 01. A series of progress codes are shown before 01 appears.

2. Select a notebook with a webbrowser, which you will use for connection to the server.

3. Connect an Ethernet cable from notebook to Ethernet port labeled HMC1 on the managed system. (If HMC1 is occupied, connect to HMC2.)

4. This table shows network configuration information for POWER7 service processor:

The Ethernet interface on the notebook needs to be configured within the same subnet mask as the service processor so that they can communicate with each other. For example, if you connected your notebook to HMC1, the IP address for your notebook could be 169.254.2.140 and the subnet mask would be 255.255.255.0. Set the gateway IP address to the same IP address as the notebook

5. To access the ASMI through a Web browser, you first need to set the IP address on your notebook, using the values from the table. 
   a. Windows -> Control Panel -> Network -> Local Area Connection (right click) -> Properties -> TCP/IP (v4) -> Properties
   b. Record the current settings before making any changes. This information is needed to restore original settings.
   c. Complete the IP address, Subnet mask, and Default gateway fields by using the values you recorded, from the above table.

6. To access the ASMI using a Web browser:
   a. Determine the IP address of the service processor Ethernet port that your PC or notebook is connected to.
   b. Type the IP address in the Web browser of your notebook: for example, if you connected your notebook to HMC1, type https://169.254.2.147

   Note: It might take up to 2 minutes for the ASMI login display to be shown in the Web browser.
   During this time, if you use control panel function 30 to view the IP addresses on the service processor, not correct data is shown.

7. When the Login display appears, enter "admin" for the user ID and for password "admin" as well.
   You can change now (or not) the default passwords:
   admin        admin
   general        general
   hmcaccess    access

8. You can check if network settings are OK (DHCP should be enabled for eth0 (private network))
   Netw. Services -> Netw. Config. -> IPv4 (continue) -> Make sure type of IP address is set to "Dynamic"

9. Save, close then exit ASMI.