Saturday, 16 August 2014

ESDL- Creating Virtual Switches in the Hypervisor - Part-1

Dear All,

Here one of the important task that need to be covered.
Before actual implementation we need to get some concepts about virtual switches and many more.

Definition - What does Virtual Switch (VSwitch) mean?

A virtual switch (vSwitch) is a software application that allows communication between virtual machines. A vSwitch does more than just forward data packets, it intelligently directs the communication on a network by checking data packets before moving them to a destination. 

Virtual switches are usually embedded into installed software, but they may also be included in a server’s hardware as part of its firmware. A virtual switch is completely virtual and can connect to a network interface card (NIC). The vSwitch merges physical switches into a single logical switch. This helps to increase bandwidth and create an active mesh between server and switches.

Techopedia explains Virtual Switch (VSwitch)

A virtual switch is meant to provide a mechanism to reduce the complexity of network configuration. This is achieved by reducing the number of switches that need to be managed after taking the network size, data packets and architecture into account. Because a virtual switch is intelligent, it can also ensure the integrity of the virtual machine's profile, which includes network and security settings. This proves a big help to network administrators as moving virtual machines across physical hosts can be time-consuming and pose security risks.
A virtual switch has a few key advantages:
  • Helps in easy deployment and migration of virtual servers
  • Allows network administrators to manage virtual switch deployed through a hypervisor.
  • Compared to a physical switch, it's easy to roll out new functionality, which can be hardware or firmware related.
There are two ways are available for to create vswitches
1) In Hyper-V Windows 2008/2012 or 2) VMware ESXI- vSphere client.

We will see one by one.

Here we go through vSwitch in Hyper-V 

Quick terminology

As I discuss Client Hyper-V in this article, for simplicity I'll use the terms Host Machine and Virtual Machine. , Figure A illustrates what I mean by these terms.

Figure A

Host machine verses virtual machine.

The Virtual Switch Manager

In order for a virtual machine created with Client Hyper-V to connect to a network and to the Internet, it must have access to a virtual switch. So the first order of business is to launch the Virtual Switch Manager and create and configure how you want the virtual network connection to work. To begin, launch the Hyper-V Manager using the tile on the Start Screen, navigate to the Actions pane, and select the Virtual Switch Manager action, as shown in Figure B.

Figure B

You'll launch the Virtual Switch Manager to create a virtual network connection.
When you see the Virtual Switch Manager screen, as shown in Figure C, you'll notice that the first thing that you must do is choose what type of virtual switch you want to create. As you can see here are three options: External, Internal, and Private.

Figure C

The Virtual Switch Manager offers you three types of virtual switches to choose from.
Of course, the one you choose will depend on how you want to use your virtual machine and in most cases you'll choose the External option. However, let's take a moment to examine each of these options so that you have a good understanding of what each one does.
  • When you select an External virtual switch, your virtual machine will be able to access all resources available on your physical network including host machine and the Internet.
  • When you select an Internal virtual switch, your virtual machine will only have a network connection with the host machine. In other words, the virtual machine will not be able to access resources on your physical network nor will it have access to the Internet.
  • The only time that you would want to select the Private virtual switch, is if have more than one virtual machine running at one time and you only want a connection between your virtual machines.
Each of these types of virtual switches is illustrated in Figure D.

Figure D

Each type of virtual switch has specific uses.
Before I move on, I just want to point out that you can indeed have more than one virtual switch. For instance, you could have both an External virtual switch and an Internal virtual switch. You could then experiment with virtual machines in different types of network configurations.

Configuring an External virtual switch

As I mentioned, in most cases you'll choose to create an External virtual switch in Windows 8's Client Hyper-V. When you do, the Virtual Switch Manager will present you with the set of options shown in Figure E.

Figure E

You'll use the Virtual Switch Manager to set up your External virtual switch.
Starting from the top, you can assign your virtual switch a name and provide a description in the Notes section. As you can see, I have provided both a name and notes for my example virtual switch.
Moving down to the Connection type section, you'll notice that while the connection type that you selected previously is selected here, in this case External, you could change your mind and select one of the other two types of network switches.
When the Connection type is set to External network, you'll see that your system's network card is shown in the drop down text box and that the Allow management operating system to share this network adapter check box is selected. To simplify what this check box selection means, think of it as sayingAllow host machine and virtual machine to use the same network card. In order for both machines to use the same network card to access the physical network, the Virtual Switch Manager actually creates two virtual network cards, one for the host machine and one for the virtual machine, and then connects these to the virtual switch. The virtual switch is then connected to the physical network card which is already connected to the physical network. This configuration is illustrated in Figure F.

Figure F

The host machine is actually connected to a virtual network card.
In most cases, you'll leave the default selections for the External network just as they are. However, let's examine how these options work. Let's suppose that your system has two network cards in it: an Ethernet card called NC1 and Wireless card called NC2. If so, you could separate the network connections of your virtual machine and your host machine such that each would use a separate network card. To do so, you would select the network card that you wanted to use for the External network, say NC2, and then clear the Allow management operating system to share this network adapter check box. Then, the host machine would use NC1 to connect to the physical network and the virtual machine would use NC2 to connect to the physical network.
As you can see, by default the Enable virtual LAN identification for management operating system in the VLAN ID section is not selected. Chances are that you won't use this feature in a typical Client Hyper-V configuration. If you had a VLAN, or Virtual Local Area Network, you could use this option to specify an identification number that could be used to isolate network traffic from the host machine.

Other options

There are a two other sets of options that you can configure from within the Virtual Switch Manager and these appear in the left panel. The first one is called Extensions and it appears under your virtual switch. The second one is called MAC Address Range and appears under Global Network Settings. Again, both of these are advanced features and chances are that you won't use them in a typical Client Hyper-V configuration, but they are worth taking a look at, just so you know what they are all about.
Virtual Switch Extensions settings, shown in Figure G, provide you with a way to enable and add third-party extensible plug-ins to the virtual switch. These plug-ins can add enhanced networking and security features to a virtual network switch.
There are two options in the Switch extensions list: Microsoft NDIS Capture and Microsoft Windows Filtering Platform. As you can see, by default the Microsoft Windows Filtering Platform check box is selected while the Microsoft NDIS Capture check box is not. Without getting too technical, Capturing extensions are used to capture and monitor packet traffic while Filtering extensions are used to inspect, drop, or exclude packets. You can learn more about Virtual Switch Extensionshere.

Figure G

Virtual Switch Extensions can add enhanced networking and security features to the virtual switch.
As I said, these types of Virtual Switch Extensions won't generally be used in a typical Client Hyper-V configuration, so just leave the default settings as they are.
MAC Address Settings, shown in Figure H, displays the range of MAC addresses that are available to be assigned to the virtual network cards that the Virtual Switch Manager can create. Under normal circumstances, the default range of MAC addresses is sufficient for Client Hyper-V and you won't need to alter it.

Figure H

MAC Address Settings displays the range of MAC addresses that are available to be assigned to virtual network cards.

Completing the configuration

When you are done configuring your External virtual switch, click OK. When you do, you'll see a warning message indicating that during the virtual network connection procedure, the network connection for the host machine may temporarily go offline. When you click Yes, the changes will be applied and you'll see a progress bar. These steps are illustrated in Figure I.

Figure I

When you are done configuring your External virtual switch, click OK.

Checking the connection

Many of the folks that I have spoken to about setting up an External switch find it surprising that the host machine is actually connected to a virtual network card after you set up a virtual switch for your virtual machine. But its true and you can see for yourself by investigating the Network Connections tool or even on the command line with IPConfig.
Figures J and K show before and after screenshots of the Network Connections tool and the results from running the IPConfig command on the host machine.

Figure J

Running the Network Connections tool on the host machine.

Figure K

Running the IPConfig command on the host machine.


No comments:

Post a Comment