7.2. Virtual Serial Adapter

After creation, each LPAR automatically has 2 virtual serial adapters in virtual slots 0 and 1. The existing virtual serial adapters can either be displayed with the command “lpar lsvslot”, together with all other virtual adapters, or with the command “lpar lsserial“ (list serial adapters), which only lists virtual serial adapters:

$ lpar lsserial aix22
                                                                  REMOTE        
LPAR_NAME  SLOT  REQ  STATE  TYPE    STATUS       HMC  LPAR_NAME  LPAR_ID  SLOT
aix22   0     Yes  1      server  unavailable  Yes  -          any      any
aix22  1     Yes  1      server  unavailable  Yes  -          any      any
$

Both adapters are server adapters, not client adapters! The LPAR offers access by the serial adapters as a service. The column HMC in the output with the value “Yes” indicates that access from the HMC to the two serial adapters is supported. This allows a console connection from the HMC to the LPAR and is likely to be the most common use of the virtual serial adapter.

Access to the console of an LPAR is very easy using the command “lpar console“:

$ lpar console aix22
 
Open in progress 

  Open Completed.
  
 
 
 
 
 
 
AIX Version 7
Copyright IBM Corporation, 1982, 2020.
Console 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 System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************
 
aix22:/root>
aix22:/root>

If the console connection is to be terminated, one should first log out of the LPAR (exit) and then terminate the connection with “~.” (This is the same combination as with OpenSSH).

A maximum of one console connection to an LPAR can exist at any given time. Attempting to open a second console for an LPAR will result in an error message:

$ lpar console aix22
 
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.
$

An existing console connection can be terminated with the command “lpar rmconsole” (remove console). It doesn’t matter who owns the console, the connection is terminated immediately:

$ lpar rmconsole aix22
$

The following message is shown in the existing console session:

Connection has closed 
 
 
This session is no longer connected. Please close this window.

 Another possibility is to use the “-f” (force) option, when opening the console. Any existing console session is automatically terminated!

$ lpar console -f aix22
 
Open in progress 

  Open Completed.
  
 
 
 
 
 
 
AIX Version 7
Copyright IBM Corporation, 1982, 2020.
Console login:

Which functions are supported by PowerVM in connection with virtual serial adapters, can be listed using the online help of the LPAR tool:

$ lpar help serial
USAGE: lpar [<option> ...] <keyword> [<option> ...] [<argument> ...]
 
Recognized keywords for topic 'serial' are:
   [-h <hmc>] [-m <ms>] [-p <profile>] addserial [-c] [-d] [-f] [-l <detail_level>] [-w <wait_time>] [-v] <lpar> <slot> [<remote_lpar_name> <remote_slot_num>]
   [-h <hmc>] [-m <ms>] [-p <profile>] chserial [-r] [-R] [-v] <lpar> <slot> [<attributes> ...]
 [-h <hmc>] [-m <ms>] console [-f] [-v] <lpar>
   [-h <hmc>] [-m <ms>] [-p <profile>] lsserial [{-o <format>|-f|-j|-y}] [-F <fields>] [-s <selections>] [-v] [<lpar> ...]
   [-h <hmc>] [-m <ms>] [-p <profile>] lsvslot [{-o <format>|-f|-j|-y}] [-t <type>] [-F <fields>] [-s <selections>] [-v] <lpar>
   [-h <hmc>] [-m <ms>] rmconsole [-v] <lpar>
   [-h <hmc>] [-m <ms>] [-p <profile>] rmserial [-d] [-f] [-l <detail_level>] [-w <wait_time>] [-v] <lpar> <slot>
$

In addition to listing serial adapters and using the console, other virtual serial adapters can also be created, changed and removed.