PowerVM and Virtual Networks (Part 1)

Today’s network environments typically use a variety of Virtual Local Area Networks (VLANs). The use of 12-bit VLAN IDs allows more than 4000 virtual networks in a physical network. Network administrators often give names to the various VLANs to make the purpose of a VLAN easier to understand. The network name Mgmt-AIX can easily be recognized as a management network for AIX systems. From the associated VLAN ID 815 the purpose is not recognizable.

The HMC offers the possibility to assign a symbolic name for each VLAN on a managed system. In the HMC GUI you can find the virtual networks after selecting the managed system under “Power VM“. On the command line of the HMC, the virtual networks are called vnetwork and you can administer them with the commands “lshwres -r virtualio –rsubtype vnetwork” and “chhwres -r virtualio –rsubtype vnetwork“. Examples follow. For users of the LPAR tool, there are the commands “ms addvnetwork“, “ms chvnetwork“, “ms lsvnetwork” and “ms rmvnetwork“.

First, let’s show all virtual networks of the managed system ms09:

$ ms lsvnetwork ms09
NAME  VNETWORK            VSWITCH    TAGGED  VLAN_ID
ms09  VLAN725-ETHPROD     ETHPROD    1       725
ms09  VLAN1410-ETHPROD    ETHPROD    1       1410
ms09  VLAN1411-ETHPROD    ETHPROD    1       1411
ms09  VLAN16-ETHPROD      ETHPROD    0       16
ms09  VLAN15-ETHERNET0    ETHERNET0  0       15
ms09  VLAN14-ETHERNET0    ETHERNET0  0       14
ms09  VLAN1406-ETHERNET0  ETHERNET0  1       1406
ms09  VLAN815-ETHERNET0   ETHERNET0  0       815
$

(The corresponding command on the HMC is: lshwres -r virtualio –rsubtype vnetwork -m ms09)

By default, a vnetwork uses the prefix VLAN, followed by the VLAN ID, a minus sign, followed by the name of the virtual Ethernet switch. The TAGGED column indicates whether VLAN tagging is used or the network is used as a port VLAN ID.

The last line of the output contains the mentioned management network for AIX with the VLAN ID 815 at the default switch ETHERNET0. This shall now be renamed Mgmt-AIX:

$ ms chvnetwork ms09 VLAN815-ETHERNET0 new_name=Mgmt-AIX
$

(The corresponding HMC command is: chhwres -r virtualio –rsubtype vnetwork -m ms09 -o s –vnetwork VLAN815-ETHERNET0 -a ’new_name=Mgmt-AIX‘)

A quick review shows that the virtual network was really renamed:

$ ms lsvnetwork ms09
NAME  VNETWORK           VSWITCH    TAGGED  VLAN_ID
ms09 VLAN725-ETHPROD     ETHPROD    1       725
ms09 VLAN1410-ETHPROD    ETHPROD    1       1410
ms09 VLAN1411-ETHPROD    ETHPROD    1       1411
ms09 VLAN16-ETHPROD      ETHPROD    0       16
ms09 VLAN15-ETHERNET0    ETHERNET0  0       15
ms09 VLAN14-ETHERNET0    ETHERNET0  0       14
ms09 VLAN1406-ETHERNET0  ETHERNET0  1       1406
ms09 Mgmt-AIX            ETHERNET0  0       815
$

Unfortunately, the virtual network has the new name only on the managed system ms09. We would also need to rename the virtual network on the other managed systems on which VLAN 815 exists. For each managed system (possibly different HMCs), it would be necessary to check with lshwres, whether there is the corresponding VLAN. That might be quite expensive, but it can certainly be handled with one or more for-loops.

This is a bit easier for users of the LPAR tool. We simply list all virtual networks and select only the entries for VLAN ID 815 andvirtual switch ETHERNET0:

$ ms lsvnetwork -s vswitch=ETHERNET0,vlan_id=815
NAME    VNETWORK           VSWITCH    TAGGED  VLAN_ID
ms05    VLAN815-ETHERNET0  ETHERNET0  1       815
ms06    VLAN815-ETHERNET0  ETHERNET0  1       815
ms07    VLAN815-ETHERNET0  ETHERNET0  1       815
ms08    VLAN815-ETHERNET0  ETHERNET0  1       815
ms09    Mgmt-AIX           ETHERNET0  1       815
ms11    VLAN815-ETHERNET0  ETHERNET0  1       815
…
$

We only need the first column (name of the managed system), but without ms09 (the new name has already been set there):

$ ms lsvnetwork -s vswitch=ETHERNET0,vlan_id=815 -F name | grep -v ms09
ms05
ms06
ms07
ms08
ms11
...
$

If we pack this into a for-loop, then the virtual network can be renamed on all managed systems. Since we are careful, we first add an echo before the “ms chvnetwork” command:

$ for ms in $( ms lsvnetwork -s vswitch=ETHERNET0,vlan_id=815 -F name | grep -v ms09 )
> do
> echo ms chvnetwork $ms VLAN815-ETHERNET0 new_name=Mgmt-AIX
> done
ms chvnetwork ms05 VLAN815-ETHERNET0 new_name=Mgmt-AIX
ms chvnetwork ms06 VLAN815-ETHERNET0 new_name=Mgmt-AIX
ms chvnetwork ms07 VLAN815-ETHERNET0 new_name=Mgmt-AIX
ms chvnetwork ms08 VLAN815-ETHERNET0 new_name=Mgmt-AIX
ms chvnetwork ms11 VLAN815-ETHERNET0 new_name=Mgmt-AIX
...
$

The commands match and we omit the echo command and do the renaming.

$ for ms in $( ms lsvnetwork -s vswitch=ETHERNET0,vlan_id=815 -F name | grep -v ms09 )
> do
> ms chvnetwork $ms VLAN815-ETHERNET0 new_name=Mgmt-AIX
> done
$

A quick check shows that the networks have been renamed.

$ ms lsvnetwork -s vswitch=ETHERNET0,vlan_id=815
NAME    VNETWORK  VSWITCH    TAGGED  VLAN_ID
ms05    Mgmt-AIX  ETHERNET0  1       815
ms06    Mgmt-AIX  ETHERNET0  1       815
ms07    Mgmt-AIX  ETHERNET0  1       815
ms08    Mgmt-AIX  ETHERNET0  1       815
ms09    Mgmt-AIX  ETHERNET0  1       815
ms11    Mgmt-AIX  ETHERNET0  1       815
…
$

Of course you can also specify the vnetwork in the search:

$ ms lsvnetwork -s vnetwork=Mgmt-AIX
NAME    VNETWORK  VSWITCH    TAGGED  VLAN_ID
ms05    Mgmt-AIX  ETHERNET0  1       815
ms06    Mgmt-AIX  ETHERNET0  1       815
ms07    Mgmt-AIX  ETHERNET0  1       815
ms08    Mgmt-AIX  ETHERNET0  1       815
ms09    Mgmt-AIX  ETHERNET0  1       815
ms11    Mgmt-AIX  ETHERNET0  1       815
…
$

The result is identical as expected.

The use of network names identical to the names of the network colleagues, should also make communication easier. You really talk about the same thing.

One last note: The for-loop method is of course relatively cumbersome if you want to update many network names on all managed systems. We have a simple script for this purpose, which we can provide.

The second part covers the creation and deletion of virtual networks: PowerVM and Virtual Networks (Part 2)

Back to LPAR tool