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.

The pvmctl command can be run only by users who are in the pvm_admin group. To add a user to the pvm_admin group, enter the following command:
sudo adduser user_id pvm_admin
The admin user for the PowerVM NovaLink partition is added to the pvm_admin group automatically when PowerVM NovaLink is installed.

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 following object types are supported by the PowerVM NovaLink CLI. 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)
For PowerVM NovaLink Version 2.0, or later, the following object types are supported by the PowerVM NovaLink CLI.
  • persistentmemorydevice (pmemd)
  • persistentmemoryvolume (pmemv)

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 desired 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 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

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 non-volatile 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 a 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 + ].

Partition configuration backup and restore commands

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"