Understanding and Configuring Hyper-V Virtual Networks

From Virtuatopia
Jump to: navigation, search
PreviousTable of ContentsNext
A Tour of the Hyper-V Manager ToolCreating Hyper-V Virtual Machines

Purchase and download the full PDF and ePub versions of this Hyper-V eBook for only $8.99  

Before creating virtual machines within the Hyper-V environment, it is worth first gaining an understanding of both the Hyper-V networking architecture and networking options that are available to guest operating systems running within virtual machines. The purpose of this chapter, therefore, is to provide a high level overview of Hyper-V networking and to cover the steps involved in configuring Hyper-V virtual networks.

The Hyper-V Virtual Network Architecture

As previously outlined in the chapter entitled An Overview of the Hyper-V Architecture, Hyper-V consists of a parent partition and multiple child partitions. These partitions are essentially virtual machines. Running in the parent partition is an instance of Windows Server 2008 which provides services to the child partitions which, in turn, contain the guest operating systems. The services provided by the parent partition include networking for the guest virtual machines. A high level view of this architecture is illustrated in the following figure:

Hyper-V Networking Architecture diagram

As outlined in the above figure, each virtual machine has one or more virtual network adapters configured. Each adapter is connected, in turn, to a virtual network switch running in the parent partition. In the above example, two virtual networks have been configured, one external and the other internal. These virtual network switches provide connectivity. Depending on the configuration of the virtual network associated with the switch, connectivity will be provided between the virtual machine and the parent partition, other virtual machines on the same virtual network or to the external network via a physical network adapter installed in the host system.

To avoid confusion, it is important to note that there is one virtual switch for each virtual network configured in the Hyper-V environment. In fact, pre-release versions of Hyper-V referred to creating Virtual Network Switches rather than Virtual Networks.

Hyper-V Virtual Network Types

Hyper-V provides the ability to create multiple virtual networks for use by virtual machines. The types of virtual networks supported by Hyper-V fall into three distinct categories, details of which are provided in the following table:



External Virtual Network

Virtual machines connected to an external virtual network are given access to the external network via a physical network adapter installed in the host system. Virtual machines are also able to communicate with both the parent partition and other virtual machines running on the same virtual network.

Internal Virtual Network

Virtual machines connected to an internal virtual network have access to both the parent partition and other virtual machines attached to the same virtual network. Hyper-V Internal Virtual Networks do not require a physical network adapter and no access to external networks is provided.

Private Virtual Network

Virtual machines connected to a private virtual network have access only to other virtual machines attached to the same virtual network. Hyper-V private virtual networks do not require a physical network adapter and no access to the parent partition or external network is provided.

Note that there is a one to one correspondence between external virtual networks and physical networks adapters. It is not, therefore, possible to bind more than one external virtual network to a physical network adapter. If multiple external virtual networks are required, a physical network adapter must be installed in the host system for each one. If the Hyper-V server is to be administered remotely, it is also necessary to dedicate a separate physical network adapter for this purpose.

Creating a New Hyper-V Virtual Network

Hyper-V virtual networks are created and managed using the Virtual Network Manager. To access this tool, begin by launching the Hyper-V Manager (Start->Administrative Tools->Hyper-V Manager). Unless the Hyper-V Manager is already connected to the required Hyper-V Server, connect to the appropriate server in the left hand panel by right clicking on Hyper-V Manager in the left hand panel and selecting Connect to Server.... Once connected, click on the Virtual Network Manager... link in the Actions panel. Once loaded, the manager dialog will appear as follows:

The Hyper-V Virtual Network Manager

The left hand pane in the Virtual Network Manager contains a list of existing virtual networks configured on the selected Hyper-V server. In the above example, two external virtual networks are configured. At the top of the list is the option to Add Virtual Network which, when selected, provides the option to add an External, Internal or Private virtual network. Once the virtual network type has been selected, the main panel will change to display the virtual network settings screen:

The Hyper-V Virtual Network Settings Screen

In the case of private and internal virtual networks, the name of the virtual network needs to be specified together with optional descriptive notes. In the case of external private networks, a physical network adapter must be selected from the drop down list. As previously mentioned, physical network adapters which are already bound to another external network, or that are used for remote administration of the Hyper-V Server cannot be used for other external virtual networks.

The Enable virtual LAN identification for parent partition option is only available for external and internal virtual networks and allows an identification number to be specified in order to isolate network traffic from the parent partition. This option requires a physical network adapter with VLAN support.

Assigning Virtual Machines to Virtual Networks

In order for a virtual machine to connect to a virtual network, the virtual machine will need a virtual network adapter. A single virtual machine can contain multiple virtual network adapters, though each virtual network adapter can be connected to only one virtual network. That said, it is possible for multiple virtual adapters to connect to the same virtual machine.

The first step in connecting a virtual machine to an existing Hyper-V virtual network is to ensure that a virtual network adapter is available. A list of a virtual machine's currently configured virtual hardware devices may be obtained from the Hyper-V Manager by right clicking the virtual machine in the list and selecting Settings.... The right hand panel of the settings dialog contains a list of hardware, including any virtual network adapters and information about the virtual networks to which they are attached. In the following example, the virtual machine contains a single virtual network adapter which is connected to an external virtual network:

The Hyper-V Manager Network Adapter Settings Screen

Clearly, the above scenario requires the creation of an additional virtual network adapter, since the only adapter currently present is already assigned to another virtual network. To add a new adapter, select Add Hardware from the top of the device list, select Network Adapter from the list in the main panel and click Add to proceed to the settings screen for the new adapter. On this screen, select the virtual network to which the device is to be attached and click Apply to commit the configuration changes.

Purchase and download the full PDF and ePub versions of this Hyper-V eBook for only $8.99