To allow guests to access network devices, you must create vswitches
on the VM Host. This section describes how to create a vswitch and verify
that it has started.
To create vswitches, use the hpvmnet command. The
following is the basic format of the hpvmnet command to
create a vswitch:
hpvmnet -c -S vswitch-name -n nic-id |
This command format includes the following options:
-c indicates the creation
of a vswitch.
-S vswitch-name specifies
the name of the vswitch.
-n nic-id specifies
the network interface on the VM Host that the new vswitch will use. For example, —n 0 indicates lan0. Network interfaces are displayed by the lanscan(1M) command.
If you do not include the -n option, a local vswitch is created,
as described in “Local Networks”.
The hpvmnet command also allows you to display and
manage the vswitches on the VM Host. Table 7-1 describes
the options to the hpvmnet command.
Table 7-1 Options to the hpvmnet Command
| Option | Description |
|---|
| -b | Starts a vswitch. The vswitch must be started before it can accept
network traffic. All vswitches are started automatically when Integrity VM
is started. |
| -c | Creates a new vswitch. |
| -h | Halts one or all vswitches. You are asked to confirm this action. |
| -d | Deletes a virtual switch. You are asked to confirm this action. |
| -n nic-id | Specifies the network interface on the VM Host that the new vswitch
will use. For example, to associate a vswitch to lan0,
enter -n 0. |
| -p n | Specifies the port number. To display information about all ports,
enter —p all. |
| -s | Retrieves statistics. |
| -S vswitch_name | Specifies the name of the virtual switch. The vswitch name is limited
to 8 characters and must be unique on the VM Host. |
| -u portid:portnum:vlanid:[vlanid | none] | Configures the port portnum on the virtual switch
so that it is isolated to the VLAN specified by vlanid.
See “Configuring VLANs” for more
information. |
| -V | Enables verbose mode, displaying information detailed information about
one or all vswitches. |
| -v | Displays the version number of the hpvmnet command
in addition to the vswitch information. |
The following command creates a virtual switch called clan1 that
is associated with lan1. The second hpvmnet command
displays information about the clan1 vswitch.
# hpvmnet -c -S clan1 -n1
# hpvmnet
Name Number State Mode PPA MAC Address IP Address
======== ====== ======= ========= ====== ============== ===============
localnet 1 Up Shared N/A N/A
myswitch 2 Up Shared N/A N/A
clan1 5 Down Shared lan1
|
The physical point of attachment (PPA) for clan1 is 1.
Two vswitches (localnet and lan0)
communicate over the localnet.
To start a vswitch, enter the hpvmnet command with
the -b option. For example, to start the vswitch named clan1,
enter the following command:
# hpvmnet -S clan1 -b
# hpvmnet -v
Name Number State Mode PPA MAC Address IP Address
======== ====== ======= ========= ====== ============== ===============
localnet 1 Up Shared N/A N/A
myswitch 2 Up Shared N/A N/A
clan1 5 Up Shared lan1 0x00306e3977ab
|
Note that clan1 is associated with the network interface
on the VM Host that has MAC address 0x00306e3977ab (this
will not be the MAC address of any virtual machine connected to this vswitch).
For information about connecting vswitches to guests, refer to Chapter 3. For information about
modifying virtual networks, refer to “Configuring Guest Virtual Networks”.
You can create multiple vswitches associated with the same host physical
NIC. However, you cannot start (hpvmnet —b)
more than one of them at the same time.
Local Networks |
 |
Virtual network communication may be limited to virtual machines on
the VM Host system through the use of vswitches that are not connected to
a physical NIC. A virtual network such as this is called a local virtual
network or simply a local network (localnet).
To create a local network, a vswitch must first be created using hpvmnet
without the -n option so that it is not connected to the physical network.
For example, to create a local network vswitch named clan0, enter the folowing
commands:For example, to create a local network vswitch named clan0,
enter the following command:
# hpvmnet -c -S clan0
# hpvmnet -b -S clan0 |
All vNICs connected to that vswitch will then be on the same local network.
The VM Host does not communicate on local networks.
If you omit the -n option when you create a vswitch,
the default is to use localnet. The localnet vswitch
can be used as a local network and vNICs can be specified for a guest in the
usual way. For example:
# hpvmmodify -P compass1 -a network:lan::vswitch:clan0 |
This command adds a vNIC to the guest compass which
can be used to communicate with any virtual machine connected to the localnet vswitch.
Configuring Guest Virtual Networks |
 |
You can define a vNIC for a guest using the hpvmmodify command.
For example, the following command adds a vNIC to the guest named compass1.
# hpvmmodify -P compass1 -a network:lan:0,0,0x00306E39F70B:vswitch:clan1 |
The guest configuration file /var/opt/hpvm/guests/guestname/vmm_config.current contains
an entry for each guest virtual network device. When the guest is booted (through
the hpvmstart or hpvmconsole command),
the guest LAN is configured as specified in the LAN entry in the guest configuration
file. For example:
.
.
.
# Virtual Network Devices
#
lan(0,0).0x00306E39F70B = switch(clan1).4
.
.
. |
 |
 |  |
 |
 | NOTE: Never modify the guest configuration files directly. Always use the
Integrity VM commands to modify virtual devices and virtual machines. |
 |
 |  |
 |
The virtual network entry in the guest configuration file includes the
guest information on the left side of the equal sign (=), and VM Host information
on the right. The data about the guest LAN example includes the following
information:
Entering the lanscan command on the guest compass1 results
in the following:
# lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
0/0/3/0 0x00306E39F70B 0 UP lan0 snap0 1 ETHER Yes 119
0/1/2/0 0x00306E3977AB 1 UP lan1 snap1 2 ETHER Yes 119
0/4/1/0 0x00306E4CE96E 2 UP lan2 snap2 3 ETHER Yes 119
|
The hardware path from the output of lanscan on the
guest matches the path in the guest configuration file. The Station
Address in the lanscan output also matches the
guest virtual MAC address in the guest configuration file.