PowerVM NovaLink command-line interface

The PowerVM® NovaLink command-line interface (CLI) is a Python-based CLI for administrative functions on a system that is managed through PowerVM NovaLink.

Chlickey command

When PowerVM NovaLink is at version 1.0.0.16 or later, you can specify the license key of IBM® i logical partitions by entering the following command:
/usr/bin/chlickey -p <system name> -o a --lickey "<license key>"
Comma-separated list of license keys and input file (--lickey file) options are available for PowerVM NovaLink version 1.0.0.16, or later.
chlickey -p lpar | --id id -o a (--lickey <comma separated list of licensekey.> | --lickeyfile <input file> )
Where
  • -p <system name> indicates the logical partition or the server.
  • -o indicates the type of the operation to be performed.
  • a indicates that the license information must be added to the license repository.
  • --lickey <license key> specifies a single key or comma-separated list of license keys that are 101 bytes long, which is applicable for an IBM i virtual machine.
  • --lickey <inputfile> specifies the file that contains the license keys for an IBM i virtual machine. The license keys are listed as comma-separated list of keys, which are 101 bytes long.

Format for building the 101-byte long license key

The following example shows the format of a 101-byte long license key and an example license key:
Format for 101 byte key:
keyFileTimeStamp(13) + systemName(8) + productId + licenseTerm + feature + serial + processorGroup + usageLimit + expirationDate + vendorData + licenseKey + keyGenTimeStamp(13)
If any value unknown, default must be used as :
keyFileTimeStamp = "0000000000000";
systemName = "        ";
serial = "  *LOCAL";
processorGroup = "999";
expirationDate = "9999999";
vendorData = "        ";
keyGenTimeStamp = "0000000000000";
More details on default and fillers as below:
Valid attribute names:( From HMC usage)
prdid
lictrm
Specify in Vx, VxRy, or VxRyMz format, where x and y can be a number from 0 through 9, and z can be a
number from 0 through 9 or a letter from A through Z
feature
[serial]
Defaults to *LOCAL
[prcgrp]
Specify in Pxx format where xx is a number from 00 to
99
Defaults to 999
usglmt
Specify *NOMAX for no limit
[expdate]
Specify in 1YYMMDD format
Defaults to 9999999 which correlates to *NONE
[vnddta]
Defaults to blank which correlates to *NONE
lickey
An example license key is as follows:
1210222210611RCHASC025770SS1V7R4M05117 7800050999  -11220223   DD0829B7E5E2A6B5011210222210611

Pvmctl command

The command-line interface uses the pvmctl command for most operations. The command can be entered at the command-line of the PowerVM NovaLink partition.

Run the pvmctl command only if you are in the pvm_admin group. To add a user to the pvm_admin group, enter the following command:
sudo useradd -G pvm_admin -m -p `openssl passwd -1 neo123`  neo

The admin user for the PowerVM NovaLink partition is added to the pvm_admin group automatically when PowerVM NovaLink is installed.

Health monitor system

If you are using PowerVM NovaLink version 2.2.0, or later, use the health monitor system (hms) option in the pvmctl command to check the health of the PowerVM NovaLink system. The hms option displays the following information:
  • MEMORY CONSUMPTION: The PowerVM NovaLink system uses memory to ensure that sufficient memory is available for PowerVM NovaLink operations.
  • To view whether sufficient file handles are available for PowerVM NovaLink operations, provide the following details:
    • FILES OPENED: The file handles that are open.
    • SSH FILES OPENED: The file handles that are open due to the Secure Shell Protocol (SSH) process.
    • PIPE FILES OPENED: The file handles that are open due to the pipe operation created in PowerVM NovaLink system.
  • Status of the connection between pvm-rest and pypowervm subsystems, which provides the REST APIs that are compatible with OpenStack APIs.
To check the health of PowerVM NovaLink system, enter the pvmctl hms list command or pvmctl healthmonitor list command.
$ pvmctl hms list
Health Monitor
+--------------------+--------------+------------------+-------------------+-------------+
| MEMORY CONSUMPTION | FILES OPENED | SSH FILES OPENED | PIPE FILES OPENED | REST STATUS |
+--------------------+--------------+------------------+-------------------+-------------+
| 135.0270980983228  |   85.9375    |       0.0        |        0.0        |    Passed   |
+--------------------+--------------+------------------+-------------------+-------------+
$
To display the help menu of the health monitor system (hms), enter the help command as follows:
$ pvmctl hms --help
usage: pvmctl hms [help | --help] 
positional arguments:
  {list}
optional arguments:
 {--verbose}
help arguments:
  help    show this help message and exit
$
When you run the --verbose command, you can view detailed information of the following resources:

KVM capability

Enable the Kernel-based Virtual Machine (KVM) capability to run in a PowerVM logical partition (LPAR). KVM is a virtualization technology from Linux® operating system.

IBM i network installation

Use the PowerVM NovaLink version 2.2.0, or later, to activate an IBM i network installation. The supported adapters are as follows:
  • POWER8 processor-based servers, or later, that support Network File System (NFS)-based installation.
  • POWER9 processor-based servers, or later, that support Internet Small Computer Serial Interface (iSCSI)-based installation.
To initiate the IBM i network installation, enter the following command:
pvmctl vm network-install --help
usage: pvmctl [help | --help] LogicalPartition network-install {--object-id | -i} <LogicalPartition field>=value {args}
The following table lists the required arguments for the IBM i network installation:
Required argument Description
--type {nfs,iscsi} Specifies the network installation type.
--ip IP Specifies the IP address of the client partition.
--gateway GATEWAY Specifies the gateway address of the client partition.
--netmask NETMASK Specifies the netmask address of the client partition. If the IP address format is mentioned as IPV6, this argument is not allowed.
--serverip SERVERIP Specifies the IP address of the NFS server when nfs is the network installation type.
--serverdir SERVERDIR Specifies the image path on the NFS server when nfs is the network installation type.
--targetip TARGETIP Specifies the IP address of the iSCSI target when iscsi is the network installation type.
--targetname TARGETNAME Specifies the iSCSI target name when iscsi is the network installation type.
The following table lists the optional arguments for the IBM i network installation:
Optional argument Description
--duplex {auto,half,full} Specifies the duplex for the network interface.
--mtu {1500,9000} Specifies the maximum transmission unit for the network interface.
--speed {auto,1,10,100,1000} Specifies the speed settings for the network interface.
--vlan VLAN Specifies the VLAN ID.
--initiatorname INITIATORNAME Specifies the iSCSI initiator name when iscsi is the network installation type.
--chapname CHAPNAME Specifies the Challenge-Handshake Authentication Protocol (CHAP) name when iscsi is the network installation type.
--chapsecret CHAPSECRET Specifies the CHAP secret when iscsi is the network installation type.
--targetport TARGETPORT Specifies the iSCSI target port.

To view the help message and exit, use the --help argument.

To query for an object type, use the --object-id id=value, -i id=value identifier argument and specify the object type as a name=value pair. For example,
--object-id name=value

Displaying version information

To display version information for the PowerVM NovaLink software, enter the command pvmctl --version.

Command help

The pvmctl command includes help information that lists the operations that are used by the command. To view the help information, enter one of the following commands.

To view a list of objects on which you can perform actions, enter the command pvmctl help or pvmctl --help.

To view a list of operations for a specific object type, enter the command pvmctl object_type help or pvmctl object_type --help.

To view information about the arguments for a specific object type and operation, enter the command pvmctl object_type operation help or pvmctl object_type operation --help.

Supported object types

The PowerVM NovaLink CLI supports the following object types. You can use either the full object type or the indicated short names for each object type.
  • Cluster
  • IOSlot (io)
  • LogicalPartition (lpar or vm)
  • LogicalUnit (lu)
  • LogicalVolume (lv)
  • ManagedSystem (sys)
  • LogicalPartition (lpar or vm)
  • NetworkBridge (nbr, bridge, sea, sharedethernetadapter)
  • PhysicalVolume (pv)
  • SharedProcessorPoool(sharedprocpool, spp)
  • VirtualIOServer (vios)
  • SharedStoragePool (ssp)
  • SRIOVadapter (sriov)
  • sriovethernetlogicalport (ethlogicalport, ethlp)
  • SharedEthernetAdapter (sea)
  • VirtualEthernetAdapter (vea or eth)
  • VirtualFibreChannelMapping (vfc or vfcmapping)
  • VirtualMediaRepository (vmr or repo)
  • VirtualNICdedicated (vnic)
  • VirtualNetwork (vnet or net)
  • VirtualOpticalMedia (vom or media)
  • VirtualSCSIMapping (scsi or scsimapping)
  • VirtualSwitch (vswitch or vsw)
  • Volumegroup (vg)
  • virtualserialnumber (vsn)
  • persistentmemorydevice (pmemd)
  • persistentmemoryvolume (pmemv)

From PowerVM NovaLink Version 2.2.0 or later, the PowerVM NovaLink CLI supports the healthmonitor (hms) option.

Command structure

The CLI uses the following command structure.

pvmctl [--version] [object] [operation] [arguments...] [help | --help]
For example, to list the logical partitions on the managed system, enter the following command:
pvmctl LogicalPartition list
To list all Virtual I/O Server names, IDs, states, and their associated I/O Adapter device names, use the --display-fields (or -d) argument:
pvmctl vios list -d name id state IOAdapter.dev_name
To list the names, IDs, states, and associated I/O Adapter device names of all Virtual I/O Servers that are not running, use the --where argument to add the condition to the command:
pvmctl vios list -d name id state IOAdapter.dev_name --where VirtualIOServer.state!=running
To list a network bridge with a port VLAN ID of 10, use the --object-id (or -i) argument:
pvmctl bridge list --object-id pvid=10
To update the required memory of a logical partition with name mylpar to 512 MB, use the --set-fields argument:
pvmctl lpar update -i name=mylpar --set-fields PartitionMemoryConfiguration.desired=512 
To delete a virtual Ethernet adapter, specify its parent identifier with the --parent-id (or -p) argument:
pvmctl vea delete -i pvid=1 --parent-id name=lpar_name

To create a new logical partition, view the required arguments by using the command pvmctl lpar create help.

The following command creates an AIX®/Linux logical partition that is named new_lpar with one dedicated processor and 512 MB of memory:
pvmctl lpar create --name new_lpar --proc 1 --proc-type dedicated 
--sharing-mode normal --type AIX/Linux --mem 512

Performing the Live Partition Mobility operation

You can perform the Live Partition Mobility (LPM) operation from the PowerVM NovaLink command-line interface by using the pvmctl command. LPM operation can be done between a PowerVM NovaLink partition and an HMC or between two PowerVM NovaLink partitions. If you want to perform the LPM operation from the HMC to the PowerVM NovaLink partition, you must add the wlp user in the command that is used for the migration operation.

Dynamic Platform Optimizer

POWER8 processor-based systems, or later, support the Dynamic Platform Optimizer (DPO) function. DPO is a hypervisor function that is initiated from the PowerVM NovaLink. Data Protection for Oracle rearranges logical partition processors and memory on the system to improve the affinity between processors and memory of logical partitions. When you run the DPO, mobility operations that target the system that is being optimized are blocked. Also, when the DPO is running, many virtualization features are blocked. During the DPO operation, if you want to dynamically add, remove, or move the physical memory to or from the running LPARs, either wait for the DPO operation to complete or stop the DPO operation manually.

Affinity scores for a managed system

To evaluate a DPO, you can use the PowerVM NovaLink that determines the affinity scores for the managed system and logical partitions by using the lsmemopt command. An affinity score is a measure of the processor-memory affinity on the system or for a partition. The score is a number in the range 0 - 100, where 0 represents the worst affinity and 100 represents perfect affinity. Based on the system configuration, a score of 100 might not be attainable. A partition that has no processor and memory resources does not have an affinity score and when you run the lsmemopt command, the output displays none as the score.

To list the memory optimization information for a managed system, enter the following command:
lsmemopt -m <managed system>
                [-r sys | lpar]
                [-o currscore | calcscore]
                [-p <partition names>]
                [--id <partition IDs>]
                [-x <partition names>]
                [--xid <partition IDs>]
                [--filter "<filter data>"]
                [-F [<attribute names>]]
                [--header]
                [--help]
The following table lists the flags for the lsmemopt command:
Flag Description
-m <managed system> Specifies the name of the managed system.
-r Specifies the type of resource for which the following affinity scores are displayed:
  • sys specifies the managed system.
  • lpar specifies the logical partition.
-o Specifies any one of the following operations to be performed on a managed system or a partition:
  • currscore displays the current affinity scores.
  • calcscore calculates and displays both the current and potential affinity scores.
Note: If the -o option is omitted, information about the memory optimization operation that was last performed on the managed system is displayed.
-p <partition names> or --id <partition IDs> Specifies the list of logical partitions or logical partition IDs that must be prioritized for the DPO operation.
-x <partition names> or --xid <partition IDs> Specifies the list of logical partitions or logical partition IDs that the DPO operation must avoid.
--filter "<filter data>" Filters the partition affinity scores that are listed. Use the following syntax for this flag:
"filter_name1=value,filter_name2=value,..."
or
""filter_name1=value1,value2,...",..."
where lpar_names and lpar_ids are the values for the filter name.
-F [<attribute names>] Specifies the delimiter-separated list of attribute names to be listed. If no attribute names are specified, all attribute names are listed.
--header Prints a header of the attribute names when the -F flag is also specified.
--help Prints the help information.

Examples

  1. To list the information about the DPO operation that was last run, enter the following command:
    lsmemopt -m system1
     in_progress=0,status=Finished,type=Calculate Potential System Affinity Score
    
  2. To list only the status of the DPO operation that was last run, enter the following command:
    lsmemopt -m sys -F status
           		 Finished
    
  3. To list the current affinity score of the managed system, enter the following command:
    lsmemopt -m sys -o currscore
      curr_sys_score=95
    
  4. To list the current affinity score of all partitions in the managed system, enter the following command:
    lsmemopt -m sys -o currscore -r lpar
     lpar_name=lpar1,lpar_id=1,curr_lpar_score=100
     lpar_name=lpar2,lpar_id=2,curr_lpar_score=100
     lpar_name=lpar3,lpar_id=3,curr_lpar_score=100
    
  5. To calculate and list the potential affinity score that might be attained if a DPO operation was run to optimize all partitions in the managed system, enter the following command:
    lsmemopt -m lpar-o calcscore -r lpar
    lpar_name=lpar1,lpar_id=1,curr_lpar_score=100,predicted_lpar_score=100 lpar_name=lpar2,lpar_id=2,curr_lpar_score=100, predicted_lpar_score=100
    lpar_name=lpar3,lpar_id=3,curr_lpar_score=100, predicted_lpar_score=100
    
Starting and stopping a DPO operation

You can manually run the optmem command from the PowerVM NovaLink on POWER8 processor-based systems, or later, to start a Dynamic Platform Optimizer (DPO) operation or to stop the DPO operation that is currently running.

To perform DPO operations on the managed system, enter the following command:
optmem -m <managed system>
              -o start | stop 
              [-t mirror | affinity]
              [-q <quantity>]
              [--minutes <time limit>]
              [-p <partition names>]
              [--id <partition IDs>]
              [-x <partition names>]
              [--xid <partition IDs>]
              [--optid <ID>]
              [--help]
The following table lists the flags for the optmem command:
Flag Description
-m <managed system> Specifies the name of the managed system.
-o Specifies any one of the following operations:
  • start to start a DPO operation.
  • stop to stop a DPO operation.
-t Specifies any one of the following types of memory optimization that must be performed:
  • mirror for mirrored memory defragmentation.
  • affinity for affinity optimization
-q <quantity> Specifies the quantity of additional mirrored memory in MB that is available.
--minutes <time limit> Specifies the time limit, in minutes, for the defragmentation operation of mirrored memory.
-p <partition names> or --id <partition IDs> Specifies the list of logical partitions or logical partition IDs that must be prioritized for the DPO operation.
-x <partition names> or --xid <partition IDs> Specifies the list of logical partitions or logical partition IDs that the DPO operation must avoid.
--optid <ID> Identifies the DPO operation to be canceled.
--help Prints the help information.
Examples
  1. To start the defragmentation operation of mirrored memory with no time limit and to make an extra 256 MB of mirrored memory available, enter the following command:
    optmem -m system1 -o start -t mirror -q 256
  2. To start the defragmentation operation of mirrored memory with a time limit of one hour to make maximum mirrored memory available as possible, enter the following command:
    optmem -m 8233-E8B*1234321 -o start -t mirror --minutes 60
  3. To stop the defragmentation operation of mirrored memory that is in progress, enter the following command:
    optmem -m system1 -o stop
  4. To start a DPO operation to optimize all partitions in the managed system, enter the following command:
    optmem -m sys -o start -t affinity
  5. To start a DPO operation that prioritizes lp1 and lp3 partitions for optimization, enter the following command:
    optmem -m sys -o start -t affinity -p lp1,lp3
  6. To start a DPO operation that prioritizes the partitions IDs 2, 4, 6 through 9, and 11, for optimization, and excludes the partition ID 1, enter the following command:
    optmem -m sys -o start -t affinity --id 2,4,6-9,11 --xid 1

Virtual serial number

When you are using IBM Power servers at firmware level FW950, or later and PowerVM NovaLink software version 2.1.0, or later, you can assign a virtual serial number (VSN) to the logical partition. The virtual serial number has seven digits and it is a unique string. When the logical partition is in the Running state, you cannot change the virtual serial number.

A list of virtual serial numbers is activated in the Power Hypervisor by using a Capacity on Demand (CoD) code that is provided by IBM. The virtual serial number is used to license and track the usage of the logical partition.

In PowerVM NovaLink software version 2.1.0, or later, the PowerVM NovaLink CLI supports virtualserialnumber (vsn) object type.

To display the help menu of the VSN, enter the following command:
[neo@MyCec ~]$ pvmctl vsn
usage: pvmctl virtualserialnumber [help] <operation> [help] [<args>]
Supported operations:
list     List information about Virtual Serial Numbers.
delete   Delete VSN from the system.
transfer Transfer VSN to other managed system.
Object type aliases:
virtualserialnumber
vsn
To list the virtual serial number on the managed system, enter the following command:
[neo@MyCec ~]$ pvmctl vsn list
Virtual Serial Numbers
+---------+---------+-------------+
|   VSN   | LPAR ID | AUTO ASSIGN |
+---------+---------+-------------+
| VSHJKSZ |    -    |     True    |
| VSHJKZY |    22   |    False    |
+---------+---------+-------------+
To delete the VSN from managed systems, enter the following command:
pvmctl vsn delete -i name=<virtual serial number>
To transfer the VSN to other managed systems, enter the following command:
pvmctl vsn  transfer --mgmt-svr <server ip>  -i id=<virtual serial number> --mgmt-usr <userid> --sys <target sys name>

Platform keystore

When you are using IBM Power servers at firmware level FW950, or later and the PowerVM NovaLink software is at version 2.1.1, or later, the Platform keystore (PKS) feature in PowerVM NovaLink creates an encrypted nonvolatile store. This keystore provides logical partitions with additional capabilities to store and protect sensitive information. PowerVM provides an isolated PKS storage allocation for each partition with individually managed access controls. The total partition size that can be allocated to a logical partition by the PKS feature is in the range 4 KB - 64 KB.

To list the trusted system key information for a managed system, enter the following command:
# lstskey
key_length=32,key_status=default_key
#
To view the help information for changing the trusted system key information for a managed system, enter the following command:
# chtskey
Usage: chtskey -m <managed system>
               -o change | restore
               --newkey <key file>
               [--oldkey <key file>]
               [--force]
               [--help]
Changes the trusted system key for a managed system.
    -m <managed system> - the managed system's name
    -o                  - the operation to perform:
                            change  - set the key and re-encrpyt virtual
                                      Trusted Platform Module (vTPM) data
                            restore - set the key without re-encrpyting vTPM
                                      data
    --newkey <key file> - binary file that contains the new key
    --oldkey <key file> - binary file that contains the current key
    --force             - force a change when previous change operation is
                          still re-encrypting vTPM data
    --help              - prints this help.
#

Managing the persistent memory volume

When the firmware is at level FW940, or later and PowerVM NovaLink is at Version 2.0.0.0, or later, you can view and manage the persistent memory volume that is assigned to a logical partition. You can manage the persistent memory volume only when the logical partition is in the Not activated state. You cannot add virtual Persistent Memory (PMEM) volumes to a logical partition in which the Simplified Remote Restart (SRR) capability is enabled.

You can perform the following operations on your logical partition:

To list the persistent memory devices that are associated with a logical partition, enter the following command:
 pvmctl pmemd list
To list the persistent memory volumes that are assigned to a logical partition, enter the following command:
pvmctl pmemv list
To create a persistent memory volume, enter the following command:
Note: The volume size of the persistent memory volume must be a multiple of the device block size, which can be queried by listing the device.
 pvmctl pmemv create --name volume_name --size volume_size --lpar_id associated_lpar_id
To delete a persistent memory volume, enter the following command:
pvmctl pmemv delete -i name=volume_name

Virtual terminal command

Enter the mkvterm command to open a virtual terminal connection to an AIX or Linux logical partition.

For example, to open a virtual terminal connection to a partition with partition ID 3, enter the following command:
mkvterm --id 3

To exit the virtual terminal, press Control + ].

Commands to backup and restore partition configuration data

Enter the bkprofdata and rstprofdata commands to back up and restore the partition configuration data of a managed system. These commands back up and restore only the partition configuration data in the hypervisor.

For example, to backup the partition configuration to the /tmp/mybackup.bak file, enter the following command:
bkprofdata -o backup -f /tmp/mybackup.bak
To restore the partition configuration data from the /tmp/mybackup.bak file by using phase 2 restoration, enter the following command:
rstprofdata -l 2 -f /tmp/mybackup.bak

Virtual I/O Server command

Use the viosvrcmd command to run commands on an instance of the Virtual I/O Server.

For example, to run the lsmap -all command on the Virtual I/O Server with partition ID 2, enter the following command:
viosvrcmd --id 2 -c "lsmap -all"