4.1. What LPARs are out there?

A list of all LPARs in a PowerVM environment can be printed with the “lpar show” command:

$ lpar show
NAME   ID  SERIAL   LPAR_ENV  MS    HMCS
aix01  3   12AF033  aixlinux  ms03  hmc01,hmc02
aix02  3   12BF033  aixlinux  ms04  hmc01,hmc02
aix03  11  12AF03B  aixlinux  ms03  hmc01,hmc02
aix04  19  12BF03J  aixlinux  ms04  hmc01,hmc02
aix05  4   7830W44  aixlinux  ms07  hmc03

$

General information such as name, LPAR ID, serial number, type of LPAR, associated managed system and the associated HMC(s) are displayed for each LPAR. This information is saved locally in a cache by the LPAR tool (default: ~/lpar.list). The cache can be updated with the help of the command “hmc rescan“. All known HMCs are queried and a list of all managed systems and LPARs is created and saved locally.

$ hmc rescan
hmc01:
   ms03
    > aix01
    > aix03
    > lpar17
    > ms03-vio2
    > ms03-vio1
   ms04
    > aix02
    > aix04
    > lpar18

$

Depending on the size of the environment, this can take a few seconds because a large number of commands have to be issued on the HMCs.

If you only need information about certain LPARs, the LPARs of interest can be given as arguments:

$ lpar show aix01 aix05
NAME   ID  SERIAL   LPAR_ENV  MS    HMCS
aix01  3   12AF033  aixlinux  ms03  hmc01,hmc02
aix05  4   7830W44  aixlinux  ms07  hmc03
$

The possibility of using wildcards is very useful, for example, it is easy to list all LPARs whose names begin with “aix“:

$ lpar show „aix*“
NAME   ID  SERIAL   LPAR_ENV  MS    HMCS
aix01  3   12AF033  aixlinux  ms03  hmc01,hmc02
aix02  3   12BF033  aixlinux  ms04  hmc01,hmc02
aix03  11  12AF03B  aixlinux  ms03  hmc01,hmc02
aix04  19  12BF03J  aixlinux  ms04  hmc01,hmc02
aix05  4   7830W44  aixlinux  ms07  hmc03

$

(The quotation marks can also be omitted if there are no files in the current directory that match the wildcard. Without quotation marks, a wildcard is interpreted by the shell and replaced by the result of the matching.)

Often only the LPARs on a certain managed system are of interest, for this purpose the “lpar show” command offers the option of specifying the managed system of interest with the “-m” option:

$ lpar show -m ms04
NAME    ID  SERIAL   LPAR_ENV  MS    HMCS
aix02  3   12BF033  aixlinux  ms04  hmc01,hmc02
aix04  19  12BF03J  aixlinux  ms04  hmc01,hmc02
ms04-vio1  1  12BF031  vioserver  ms04  hmc01,hmc02
ms04-vio2  2  12BF032  vioserver  ms04  hmc01,hmc02
$