An often used feature of the LPAR tool is the ability to start a console for an LPAR at any time:
$ lpar console lpar1 Open in progress Open completed. PowerPC Firmware Version AL720_121 SMS 1.7 © Copyright IBM Corp. 2000,2008 All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Main Menu 1. Select Language 2. Setup Remote IPL (Initial Program Load) 3. Change SCSI Settings 4. Select Console 5. Select Boot Options …
The associated HMC need not be specified. As long as the LPAR name is unique, the LPAR tool automatically finds the associated HMC.
Of course, for one LPAR, only one console can be open at one time. If a console is already open, you will get the following error message:
$ lpar console lpar1 A terminal session is already open for this partition. Only one open session is allowed for a partition. Exiting…. Received end of file, Exiting. Shared connection to hmc01 closed. $
Using the option “-f” (force), a console can be forced, the already open console is terminated:
$ lpar console -f lpar1 Open in progress Open completed. …
If the console is to be closed, then the escape sequence “~.” must be used:
… ~. Terminate session? [y/n] y Shared connection to hmc01 closed. $
If a hanging console session is to be terminated, this can be done with the command “lpar rmconsole“:
$ lpar rmconsole lpar3 /bin/stty: standard input: Inappropriate ioctl for device $
In the console session that terminates, the following message appears:
Connection has closed This session is no longer connected. Please close this window.
Whether there are open console sessions, can be checked indirectly. For this you can use the command “hmc lslogon” to list the running sessions on the connected HMCs:
$ hmc lslogon hmc01 USER_NAME TTY_ID LOGON_TIME ACCESS_LOCATION TASK_NAME TTY_ID START_TIME USER_NAME PID - - - - - - - - - $ $ hmc lslogon hmc02 USER_NAME TTY_ID LOGON_TIME ACCESS_LOCATION TASK_NAME TTY_ID START_TIME USER_NAME PID user01 pts/1 2018-10-10 09:38 172.20.132.167 mkvterm pts/1 Oct 10 09:38:18 2018 root 24583 $
A console session can be recognized by the task name mkvterm.