Tuesday, May 8, 2012

HMC Commands update

hmc Commands :

1. List all Managed systems
lssyscfg -r sys -F name
2. List all managed systems and their states
lssyscfg -r sys -F name,state
3. List all LPARs on a managed system
lssyscfg -r lpar -m "<managed system name>" -F name
4. List all LPARs on a managed system AND the default startup profile
lssyscfg -r lpar -m "<managed system name>" -F name,default_profile
5. Open a vterm for an LPAR
mkvterm -m "<managed system name>" -p "<partition name>"
6. Close a vterm session for an LPAR
rmvterm -m "<managed system name>" -p "<partition name>"
7. Shutdown a LPAR (Gracefully, the equiv of shutdown -h in AIX)
chsysstate -o osshutdown -r lpar -m "<managed system name>" -n "<partition name>"
8. Shutdown a LPAR (Not gracefully, the equiv of pushing the power button)
chsysstate -o shutdown --immed -r lpar -m "<managed system name>" -n "<partition name>"
9. Startup an LPAR
chsysstate -o on -r lpar -m "<managed system name>" -n "<partition name>" -f "<profile name>"
10. Startup an LPAR to SMS (Useful for booting into maintenance mode)
chsysstate -o on -b sms -r lpar -m "<managed system name>" -n "<partition name>" -f "<profile name>"
11. Power off a managed system (Normal)

chsysstate -o off -r sys -m "<managed system name>"
11. Power off a managed system (Fast)
chsysstate -o off --immed -r sys -m "<managed system name>"
12. Power on a managed system to standby

chsysstate -o onstandby -r sys -m "<managed system name>"
13. View current operator panel code for an LPAR
lsrefcode -r lpar -m "<managed system name>" --filter "lpar_names=<lpar name>" -F refcode
14. HMC version and applied patches
lshmc -V
15. HMC VPD (Serial # is field SE)
lshmc -v
16. Reboot HMC
hmcshutdown -r -t now
17. Shutdown HMC
hmcshutdown -t now

HMC Commands

1. To enable ssh in a hmc :

# chhmc -c ssh -s enable
You can disable it by replacing the word 'enable' with 'disable'

2. To enable xntp in a hmc :

# chhmc -c xntp -s enable
You can disable it by replacing the word 'enable' with 'disable'

3. To add an entry in the syslog config file :

# chhmc -c syslog -s add -a IP_Addr ( or '-h host_name' )
You can remove an entry by replacing the word 'add' with 'remove'

4. To add an entry in the ntp config file :

# chhmc -c xntp -s add -a IP_Addr ( or 'h host_name' )
You can remove an entry by replacing the word 'add' with 'remove'

5. To configure the network as a startup device :

# chhmc -c netboot -s enable
You can disable it by replacing the word 'enable' with 'disable'

6. To permit IP addresses from utilizing HMC services :

# chhmc -s ssh ( or any_service) -s add -a IP_Addr
You can remove an entry by replacing the word 'add' with 'remove'

7. To add a DNC_server or domain_suffix :

chhmc -c network -s add [-ns DNS_Server] [-ds domain_suffix ]
You can remove an entry by replacing the word 'add' with 'remove'

8. To change network settings for a specific network interface :

# chhmc -c network -s modify -i interface_name [-a IP_Addr] [-nm network_mask] [ --lparcomm on|off]

Note: Network settings for the s10 interface cannot be changed.

9. To change other network settings :

# chhmc -c network -s modify [-h hostname] [-d network-domain-name][-g gateway]

10. To change the locale for the HMC :

# chhmc -c locale -s modify -l locale

11. To change the HMC date and time, time zone :

# chhmc -c date -s modify[ --datetime ][ --clock {local | utc} ] [ --timezone {time-zone | none} ]