Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Integrity Virtual Machines Version 4.0 Installation, Configuration, and Administration > Chapter 8 Creating Virtual Networks

Creating and Managing vswitches

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The following sections describe how to create, modify, delete, and manage vswitches.

Creating vswitches

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 command. If you do not include the -n option, a local vswitch is created, as described in Section .

The hpvmnet command also allows you to display and manage the vswitches on the VM Host. Table 8-1 describes the options to the hpvmnet command.

Table 8-1 Options to the hpvmnet Command

OptionDescription
-bBoots a vswitch. The vswitch must be booted before it can accept network traffic. All vswitches are booted automatically when Integrity VM is started.
-cCreates a new vswitch.
-hHalts one or all vswitches. You are asked to confirm this action.
-dDeletes a virtual switch. You are asked to confirm this action.
-n nic-idSpecifies 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 nSpecifies the port number. To display information about all ports, enter —p all.
-QSpecifies the command function should proceed without asking for confirmation. By default, the command requires confirmation, and does not proceed without it.
-sRetrieves statistics.
-S vswitch_nameSpecifies 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 Section : “Configuring VLANs” for more information.
-VEnables verbose mode, displaying information detailed information about one or all vswitches.
-vDisplays the version number of the hpvmnet command in addition to the vswitch information.
-CChanges the specified vswitch. If used with the -N option, the changes are made to the cloned vswitch. You must include either the -S or -s option.
-N new-vswitch-nameCreates a new vswitch based on the existing vswitch. For new_vswitch_name, specify the unique name of the new virtual switch. The name of the vswitch is limited to eight characters. You must include either the -S or -s option.

 

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 -n 1 # 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 boot a vswitch, enter the hpvmnet command with the -b option. For example, to boot 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 is not the MAC address of any virtual machine connected to this vswitch).

For information about connecting vswitches to guests, see Chapter 3. For information about modifying virtual networks, see Section : “Configuring Guest Virtual Networks”.

You can create multiple vswitches associated with the same host physical NIC. However, you cannot boot (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 following commands:

# 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. 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. Failure to follow this procedure can result in unexpected problems when guests are started.

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:

lan(0,0)Bus 0 and device number 0 indicate the guest LAN hardware path.
0x00306E39F70BGuest virtual MAC address.
switch(clan1)The vswitch name is clan1.
4The VLAN port number is 4.

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.

Changing vswitches

You can use the -C option to change the physical network interface card (pNIC) the guest has in use. For example, enter the lanscan command, as follows:

# 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 0x00306E4A93E6 0 UP lan0 snap0 1 ETHER Yes 119 0/1/2/0 0x00306E4A92EF 1 UP lan1 snap1 2 ETHER Yes 119 # hpvmnet Name Number State Mode NamePPA MAC Address IP Address ======== ====== ======= ========= ======== ============== =============== localnet 1 Up Shared N/A N/A hostnet 296 Up Shared lan0 0x00306e4a93e6

If lan0 goes down, enter the following command to swap to use lan1:

# hpvmnet -C -S hostnet -n 1 # hpvmnet Name Number State Mode NamePPA MAC Address IP Address ======== ====== ======= ========= ======== ============== =============== localnet 1 Up Shared N/A N/A hostnet 296 Up Shared lan1 0x00306E4A92EF

Cloning vswitches

Using the -N option with the -C option creates a new vswitch based on the changed vswitch information. For example, the following command sequence displays the current vswitch (vmvlan), modifies the vswitch to specify connection to lan1, and creates a new vswitch named clnvlan. The final command displays information about the new vswitch.

# hpvmnet -S vmvlan Name Number State Mode NamePPA MAC Address IP Address ======== ====== ======= ========= ======== ============== =============== vmvlan 13 Up Shared lan900 0x00306e4bc7bf [Port Configuration Details] Port Port Untagged Number of Active VM Number state VLANID Reserved VMs ======= ============ ======== ============ ============ 1 Reserved none 1 2 Reserved 20 1 3 Reserved none 1 # hpvmnet -C -S vmvlan -n 1 -N clnvlan # hpvmnet -S clnvlan Name Number State Mode NamePPA MAC Address IP Address ======== ====== ======= ========= ======== ============== =============== clnvlan 320 Down Shared lan1 [Port Configuration Details] Port Port Untagged Number of Active VM Number state VLANID Reserved VMs ======= ============ ======== ============ ============ 2 Available 20 0

Note that only the configured VLAN port identification data is copied to the new vswitch. Use this hpvmnet command option when you have a vswitch with numerous VLAN ports. This process makes it unnecessary to reenter all the port data for each new vswitch.

Deleting vswitches

To delete a vswitch, first stop the vswitch using the —h option to the hpvmnet command. Then delete the vswitch using the -d option to the hpvmnet command. For example, the following command shows the error that prevents you from deleting an active vswitch (clan1):

# hpvmnet -S clan1 -d hpvmnet: The vswitch is currently active hpvmnet: Unable to continue

The following example uses the hpvmnet command to halt the vswitch and then to delete it. Both commands require you to confirm the action. The third command displays the current vswitches (without clan1).

# hpvmnet -S clan1 -h hpvmnet: Halt the vswitch 'clan1'? [n/y]: y # hpvmnet -S clan1 -d hpvmnet: Remove the vswitch 'clan1'? [n/y] y # 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

The default command function (if you press Enter) is to not perform the function of the command. To perform the command function, enter y.

In the case of commands where a confirmation is required, such as the hpvmnet -h command, you can include the —Q option to override the confirmation process. This is useful in scripts and processes that are not interactive. For example, to stop a vswitch (clan1) without requiring confirmation from the user, enter the following commands:

# hpvmnet Name Number State Mode NamePPA MAC Address IP Address ======== ====== ======= ========= ======== ============== =============== localnet 1 Up Shared N/A N/A clan1 2 Up Shared lan0 0x00306e39f70b # hpvmnet -S clan1 -h -Q # hpvmnet Name Number State Mode NamePPA MAC Address IP Address ======== ====== ======= ========= ======== ============== =============== localnet 1 Up Shared N/A N/A clan1 2 Down Shared lan0

When an active vswitch is deleted, the VM Host automatically determines that the vswitch is gone. When the vswitch is recreated, the guest network automatically becomes functional again.

Recreating vswitches

To change the vswitch to use another pNIC on the VM Host (for example, to change from lan0 to lan1), follow this procedure:

  1. Delete the vswitch that was associated with lan0. For example:

    # hpvmnet -S myswitch -d
  2. Create a new vswitch associated with lan1. For example:

    # hpvmnet -S myswitch -c -n 1
  3. Add a new vNIC to your guest using the new vswitch. For example:

    # hpvmmodify -P guestname -a network:lan:,,:vswitch:myswitch

Starting vswitches

Virtual switches (vswitches) start automatically when the VM Host system is started. You can start the vswitch manually using the —b option to the hpvmnet command. For example, the following command boots the vswitch named clan1:

# hpvmnet -S clan1 -b

You must restart a vswitch after the following events:

  • The MAC address corresponding to the LAN number being used by the virtual switch is changed on the VM Host (either by swapping the network adapter associated with the vswitch or associating the vswitch with a different network adapter).

  • The way the network adapter accepts and passes on packets to the next network layer is changed. This can occur as a result of the using the ifconfig or lanadmin command to set CKO/NOCKO on or off.

  • If you use the hpvmmodify command to change the adapter type for a virtual NIC (vswitch port).

Halting vswitches

Use the hpvmnet -h command to halt a vswitch. For example:

# hpvmnet -S clan1 -h hpvmnet: Halt the vswitch 'clan1'? [n]: y

Auto Port Aggregation (APA) can be configured on the VM Host to provide a highly available LAN for the vswitch (APA in active/passive mode) or to increase the bandwidth of the vswitch LAN (APA active/active mode). Before you stop APA, halt the vswitches associated with it. If you do not bring down the vswitch first, the hpvmnet command reports an incorrect MAC address for the vswitch.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.