How To
Summary
Configuring vNIC using HMC GUI that too having multiple channels of failover paths is time consuming and tedious. Here explains a way to configure vNIC clients having 2 channels in failover mode using HMC commands so that, it can be configured in a faster way from HMC command line. Once understand this, you can configure vNICs with any number of channels.
Steps
Hereby explain both methods to achieve our goals ie. configure vNIC clients in LPARs having 2 channels in failover mode.
Let’s first explain the way to configure vNIC in DLPAR mode and we know, we do have a method to sync the DLPAR change with the current running profile by setting sync_curr_profile to 1.
To configure vNIC on a SR-IOV adapter, first the adapter should be in shared mode. We can switch a SR-IOV adapter to shared mode using the below hmc command:
chhwres -m <managed-system> -r sriov --rsubtype adapter -o a -a "slot_id=<drc_index-of adapter>"
Here the drc_index of the SRIOV adapter can be found using below command: (This command display all the IO adapters on the managed system. Choose the drc_index of the SR-IOV adapter using for vNIC configuration)
lshwres -r io --rsubtype slot -m <managed-system>
Once moved the SR_IOV adapter to the shared mode, below command (which list all the SR-IOV adapters on the managed system) will show the attribute ‘config_state’ of the SR-IOV adapter as ‘sriov’, otherwise it will be shows as ‘dedicated’.
lshwres -m <managed-system> -r sriov --rsubtype adapter
Please note that the adapter should be in shared mode to create VF and/or vNICs on them.
Below hmc command can be used to create a nVIC and add it to the running profile.
chhwres -r virtualio -m <managed-system> -o a -p <partition-name> --rsubtype vnic -a "backing_devices=value "
Here the ‘partition-name’ is the vNIC client partition name on which we are creating the vNIV.
Let’s elaborate the format of ‘value‘ for the attribute ‘backing_device’ in detail. Below is its format:
sriov/vios-lpar-name/vios-lpar-ID/sriov-adapter-ID/sriov-physical-port-ID/
[capacity][/[failover-priority][/ [max-capacity]]]
sriov – it is always ‘sriov’ to mention vNIC creating out of a VF from a SR-IOV adapter.
vios-lpar-name - Name of the VIOS partition which serves the vNIC client. Here is where the VF from SR-IOV assigned to.
vios-lpar-ID – The partition ID of the VIOS partition which serves the vNIC client.
Note: either vios-lpar-name or vios-lpar-ID is optional, but the ‘/’ must be present.
sriov-adapter-ID – The adapter_id of the SR-IOV adapter using to create VF for vNIC
sriov-physical-port-ID – The physical port ID of the above adapter on which we are creating VF for vNIC.
Note: sriov-adapter-ID and sriov-physical-port-ID can be seen using any of the below commands, based on the SR-IOV adapter type:
For RoCE adapter:
lshwres -m <managed-system> -r sriov --rsubtype physport --level roce
For converged ethernet adapter:
lshwres -m managed-system> -r sriov --rsubtype physport --level ethc
For ethernet adapter:
lshwres -m <managed-system> -r sriov --rsubtype physport --level eth
[capacity] – It is an optional value (default is 2). Here we can specify the percentage of the physical port capacity to be assigned to the VF and hence to the vNIC.
[max-capacity] – It is an optional value (default is given capacity). Here we can specify the maximum percentage of the physical port capacity that can be assigned to the VF/vNIC.
[failover-priority] – This value specifies the priority of the backing_device (VF) and has meaning when there are more than one baking_devices to the vNIC. It is an optional value and if omitted the default value 50 is taken. The range of values are from 1 to 100, 1 being the highest priority and 100 the lowest.
If need more than one backing devices to a vNIC (which is needed in the case of vNIC failover setup), a comma separated list of ‘values’ in the above format should be given, in that case the attribute name/value pair must be enclosed in double quotes.
Let’s create a vNIC failover setup as shows in the below diagram. Here we create a vNIC on the LPAR named ‘LPAR1’ having 2 different backing devices. Each backing device is served by separate VIOSes named ‘VIOS1’ and ‘VIOS2’. And each VIOS using separate SR-IOV adapters having 2 physical port.
Here the channel with green colour is the primary/active channel (so given high failover_priority value 50 to it) and the channel in red colour is inactive. The inactive channel will be active only when the primary channel fail.
Consider the adapter ID of the adapter in VIOS1 is 1 and its port 0 having ID 0 is using. Similarly, consider the adapter ID of the adapter in VIOS2 is 2 and its port 1 having ID 1 is using. Then the following command can be used to create this vNIC:
chhwres -r virtualio -m <managed-system> -o a -p LPAR1 --rsubtype vnic -a "\"backing_devices=sriov/VIOS1//1/0//50,sriov/VIOS2//2/1//60\""
Please note here the nested double quote characters need to be preceded by an escape character in this shell. Also, we omitted the optional values vios-lpar-ID, capacity and max-capacity.
After this running ‘cfgmgr’ on LPAR1 will show up the vNIC adapter on them like below:
ent1 Available Virtual NIC Client Adapter (vnic)

chhwres -m <managed-system> -r virtualio --rsubtype vnic --id <lpar_id> -s <slot_num> -o r
Here the lpar_id is the vNIC client LPAR ID and the slot_num is the virtual-slot-number of the created vNIC adapter. These values can be seen on HMC using the below command:
lshwres -r virtualio -m <managed-system> --rsubtype vnic
Now we learned dynamically adding and removing vNIC to a running profile of a LPAR. Please note that, if sync_curr_profile is not set in the LPAR, then after reboot of the LPAR the added vNiCs will be disappeared. Below HMC command can be used to check and set the sync_curr_profile.
To check:
lssyscfg -r lpar -m <managed-system> --filter "lpar_ids=<lpar id>" -F sync_curr_profile
Valid values are:
0 - disable synchronization
1 - enable synchronization
2 - suspend synchronization until the next
To set:
chsyscfg -r lpar -m <managed-system> -i "name=<lpar-name>,sync_curr_profile=1"
If anyone doesn’t want to follow the DLPAR way of adding a vNIC but wanted to create it directly into any profile of the LPAR, the below method cab be used. Here we are showing the way to create the same, 2 channel vNIC failover configuration shown in the above diagram.
chsyscfg -r prof -m <managed-system> -i "name=<profile-name>,lpar_name=<lpar-name>,\"vnic_adapters+=\"\"slot_num=<virtual-slot-number>:backing_devices=sriov/VIOS1//1/0//50,sriov/VIOS2//2/1//60\"\"\""
Here the attribute slot_num is must and should be given an unused slot number. Below command can be used to display all the used virtual io slot numbers of the lpar.
lshwres -r virtualio --rsubtype slot -m <managed-system> --level slot --filter "lpar_ids=<lpar-id>"
Below command can be used remove the above created vNIC from the LPAR profile.
chsyscfg -r prof -m <managed-system> -i "name=<profile-name>,lpar_name=<lpar-name>,\"vnic_adapters-=\"\"slot_num=<virtual-slot-number>:backing_devices=sriov/VIOS1//1/0//50,sriov/VIOS2//2/1//60\"\"\""
Author: Prajith P Kumaran
Operating System: AIX, IBMi, PowerLinux and VIOS
Hardware: Power
Feedback: aix_feedback@wwpdl.vnet.ibm.com, prajithpk@in.ibm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
21 July 2020
UID
ibm16210334