Open a HMC LPAR console from the AIX command line using dconsole!So you want to open a text console session on an LPAR on one of your Power Servers? You could log on to the HMC and run vtmenu from the HMC command line. This works but if you’re looking for a more efficient way, you might want to consider using the dconsole command on AIX. If, like many, you have a central or main NIM server from which you manage your AIX environment, then the dconsole command is probably a logical choice of tools to add your AIX admin bag of tricks.
Dconsole is included with the dsm.core fileset.
# whence dconsole /usr/bin/dconsole
# lslpp -w /usr/bin/dconsole File ---- /usr
# lslpp -l dsm.core File ---- Path: /usr/lib/objrepos dsm.
Here’s how to configure dconsole so you can access the HMC console on an AIX LPAR.
First, find the managed system name and serial number of the system where the LPAR resides. In this case, I’m interested in the managed system named stg_750.
hscroot@hsc02:~> lssyscfg -r sys -F name stg_ 824, stg_
Find the LPAR id (number) of the LPAR you wish to access. I want LPAR number 4 (750lpar11).
hscroot@hsc02:~> lssyscfg -r lpar -m stg_750 -F name,lpar_id 750lpar4,6 750lpar2,5 750lpar11,4 750lpar1,2 750vio1,1
Find the LPAR id (number) of the LPAR you wish to access. I want LPAR number 4 (750lpar11). Run the dpasswd command to store the HMC username and password on the NIM master. Generate and exchange the NIM master SSH key with the HMC using the dkeyexch command.
# dpasswd -f /etc
# dkeyexch -f /etc
Create (or edit) the /etc
# cat /etc 750l 750l
With the nodeinfo file configured and in place, I can now run the dconsole command to open a console session on the desired AIX LPAR (750lpar11).
# dconsole -n 750lpar11 -t -l Starting console daemon [read-write session] mkvterm -m 8233-E8B*1003CDP -p 750lpar11
Open in progress
Open Completed.
AIX Version 7 Copyright IBM Corporation, 1982, 2015. Console login:
Issuing Ctrl-x within the text console window closes the console session. I specified several options to dconsole. These are explained below.
-t text mode. Opens console in the current session or window.
-l Enable console logging (no logging if omitted). By default the console logs are written to the /var
-n node_identifer. Specifies the target node and console access point. This can be a comma separated list of nodes……
By specifying the –l option, all of my dconsole sessions are logged to the /var
# cd /var # ls -ltr total 80 -rw-r--r-- 1 root system 2551 May 30 2013 dkeyexch.log.150 -rw-r--r-- 1 root system 1433 Oct 14 13:38 dgetmacs.log.3 -rw-r--r--
1 root
system 76
Oct 14 13:43 dget -rw-r--r-- 1 root system 1431 Oct 14 13:44 dgetmacs.log.2 -rw-r--r-- 1 root system 1650 Oct 14 13:45 dgetmacs.log.1 -rw-r--r--
1 root
system 471 Oct 14
13:51 hmc_ -rw-r--r-- 1 root system 5507 Oct 14 14:19 dkeyexch.log.287 -rw-r--r-- 1 root system 1650 Oct 14 14:21 dgetmacs.log -rw-r--r-- 1 root system 0 Oct 14 14:21 dconsoled.stdout -rw-r--r-- 1 root system 0 Oct 14 14:21 dconsoled.stderr drwxr-xr-x 2 root system 256 Oct 14 14:22 console -rw-r--r--
1 root
system 583 Oct 14
14:22 hmc_
# cat hmc_ 14:21:53: Wed Oct 14 2015 14:21:53: Process id is 17498196 14:21:54: HMCIPAddr: 10.1.50.30 14:21:54: UserId: hscroot 14:21:54: PswdFile: /var 14:21:54: ManagedSystem: 8233-E8B*1003CDP 14:21:54: Target: 4 14:21:54: ssh_connect: 10.1.50.30 received command line prompt. Returning! 14:21:54: hmc_get_lparname: 10.1.50.30 command prompt > received
# cd /var # ls -ltr total 24 -rw-r--r-- 1 root system 114 Oct 14 13:50 750lpar4.0 -rw-r--r-- 1 root system 5087 Oct 14 14:22 750lpar11.0
# cat 750lpar11.0 [October 14, 2015 16:08:32 GMT - console logging started] mkvterm -m 8233-E8B*1003CDP -p 750lpar11
Open in progress
Open Completed.
AIX Version 7 Copyright IBM Corporation, 1982, 2015. Console login: root root's Password: 3004-007 You entered an invalid login name or password. login: root root's Password: **** * * * Welcome to AIX Version 7.1! * * * Please see the README file in /usr/lpp/bos for information pertinent to * * this release of the AIX Operating Syst * * **** 1 unsuccessful login attempt since last login. Last unsuccessful login: Wed Oct 14 16:08:38 2015 on /dev/vty0 Last login: Wed Oct 14 14:53:26 2015 on /dev/pts/0 from 750lpar4
[root@750lpar11]/ # uname -L 4 750lpar11 [root@750lpar11]/ #
AIX Version 7 Copyright IBM Corporation, 1982, 2015. Console login: [October 14, 2015 16:08:49 GMT - console logging ended]
My NIM master was running AIX 7.1 TL3 SP5. I recommend you do the same. If you are not at this level, please ensure you’ve installed the fix for this dconsole problem…..
IV63880: DCONSOLE MAY FAIL TO CLOSE EXISTING TERMINAL SESSION APPLIES TO AIX 7100-03 http
|
Thank you BR Sebastian for taking the time to read what I post. I appreciate it. Have a great Christmas.
You're
right Chris, it never hurts to know different approaches to get to the
same destination. Just yesterday I rediscovered the mighty (mostly
unknown) chsec command to add /usr/bin/false as valid shell to the
system.
Your blog posts are always a delight for an passionate AIX admin like me.
Have a nice day and I wish you a happy and joyful christmas.
Thanks for the comment, frenger. If nothing else, at least you're now aware of this capability, even if you'll never use it. The fileset only needs to be installed on the NIM master (or mgmt server).
Hi Chris,
it seems a bit complicated to set up, we have on our NIM master a passwordless connection (ssh key) to the HMC.
so do a console session like this:
ssh hscroot@hmc1
source ezh #Brian's ezh HMC commandline tools ->http://ezh.sourceforge.net/
lparconsole <lparname> #or just lparconsole to get an ascii menu for all available lpars
that's
it. I'm not sure that your way is more comfortable. Ctrl-x is a nice
way to end as I end with "~." This closes my ssh session to the hmc.
Creating /etc/ibm/sysmgt/dsm/nodeinfo for every LPAR I want to access
seems a huge initial task before I can use it and this info isn't
maintain itself after a LPM operation I assume. Compared with my
setup.... would I get any benefit of using it?
I cannot follow your
steps completely... Am I right that you only install dconsole only on
your NIM master and through the NIM master you can access any LPAR's
console you want? Or is dconsole fileset required on every LPAR you try
to connect?
BR Sebastian