7.3.6. Virtual Networks

A very useful, but not very well known, feature of PowerVM, is the ability to give virtual networks a name. Each VLAN on each virtual switch is its own virtual network. The virtual networks (vnetwork) known on a managed system can be displayed using “ms lsvnetwork“:

$ ms lsvnetwork ms03
NAME  VNETWORK           VSWITCH    TAGGED  VLAN_ID
ms03  VLAN1-ETHERNET0    ETHERNET0  0       1
ms03  VLAN100-ETHERNET0  ETHERNET0  1       100
ms03  VLAN150-ETHERNET0  ETHERNET0  1       150
ms03  VLAN200-ETHERNET0  ETHERNET0  1       200
ms03  VLAN250-ETHERNET0  ETHERNET0  1       250
ms03  VLAN300-ETHERNET0  ETHERNET0  1       300
ms03  VLAN900-ETHERNET0  ETHERNET0  1       900
ms03  VLAN950-ETHERNET0  ETHERNET0  1       950
ms03  VLAN700-ETHNAS     ETHNAS    0       700
$

When creating a virtual Ethernet adapter, virtual networks are created automatically, if they are not already available. By default, the string “VLAN” is used as the name, followed by the VLAN ID, a minus sign and the name of the virtual Ethernet switch. The name of the virtual network can be changed to any character string using the command “ms chvnetwork” (change virtual network) with the attribute new_name:

$ ms chvnetwork ms03 VLAN900-ETHERNET0 new_name=ManagementNet
$

Well-chosen names for the virtual networks (which are ultimately VLANs) can significantly simplify administration:

$ ms lsvnetwork ms03
NAME  VNETWORK         VSWITCH    TAGGED  VLAN_ID
ms03  VLAN1-ETHERNET0  ETHERNET0  0       1
ms03  ProductionDB   ETHERNET0  1       100
ms03  TestDB    ETHERNET0  1       150
ms03  Websphere-Prod ETHERNET0  1       200
ms03  Websphere-Test   ETHERNET0  1       250
ms03  MQ-Network    ETHERNET0  1       300
ms03  ManagementNet    ETHERNET0  1       900
ms03  NIM-Network   ETHERNET0  1       950
ms03  Netapp-Net    ETHNAS    0       700
$

Tip: If names for the different VLANs are already used on the external switches, the same names should be used for the VLANs on the managed systems.

Another advantage of virtual networks is that the names can be specified directly when creating virtual Ethernet adapters, instead of switch names and VLAN IDs:

$ lpar addeth aix22 11 Netapp-Net
$

Additional (tagged) VLANs can also be specified using the virtual network name:

$ lpar -p standard addeth -i aix22 12 NIM-Network TestDB,Websphere-Test
$

If a virtual network is no longer in use, it is not automatically removed. To remove a virtual network which is not used any more, the command “ms rmvnetwork” (remove virtual network) can be used:

$ ms rmvnetwork ms03 MQ-Network
$

Of course, virtual networks can also be created manually, but this is usually not necessary. To create a virtual network manually with the command “ms addvnetwork” (add virtual network), the VLAN ID of the network must be specified in addition to the virtual switch:

$ ms addvnetwork ms03 testnet 999 ETHERNET0
$

The virtual network is created as a tagged network:

$ ms lsvnetwork -s vnetwork=testnet ms03
NAME  VNETWORK  VSWITCH    TAGGED  VLAN_ID
ms03  testnet   ETHERNET0  1       999
$

If the virtual network is to be created as untagged, the option “-u” (untagged) can be used.