Using VMware: Understanding the Virtual Switch
In this article we will explore the VMware ‘Virtual Switch’. The Virtual Switch is nothing more than a logical switching fabric built into your VMware infrastructure (ESX) so that you can network your Virtual Machines (VMs) however you need them. In the following sections we will cover the basics of the Virtual Switch, terminology used, its use, configuration and management. To view the Virtual Switch, you will need to be using VMware, the VIC and have access to VirtualCenter.
Understanding the Virtual Switch
VMware infrastructure networking components are not easy to comprehend without a little background information and understanding of ‘networking’ in general. First, networking is the connection to and from shared resources, systems and services anywhere you can gain permitted access. In a ‘logical’ or ‘virtual’ environment, this theory is identical with one exception – you must know the difference between a physical and logical adapter and how they all link together through the virtual (logical) switching fabric hosted by VMware. Figure 1 shows the basics of VMware virtual connectivity.
Figure 1: Viewing the Virtual Infrastructure
The VMware Infrastructure complies with a modular design so that all resources can be shared and assigned as needed. Virtual and physical networking components are designed identically the same way. If you need to share some of your physical or logical resources, you simply need to have them available and then configure them for use. This helps to create the most flexibility and if done correctly, the most efficiency. Here in Figure 1 you can see that VMs can be connected to each other through a virtual switch component, and then to physical NICs as needed. In Figure 1 you will also find that the management network is separate (and isolated) from the rest of the network thus increasing security for the management of your infrastructure.
The essential virtual networking components provided by ESX are virtual Ethernet adapters, used by individual virtual machines (VMs) and virtual switches that are used to connect each VM to either each other or to the ESX service console. To configure this functionality, you need to first log into VMware VirtualCenter and browse to the server you want to configure. Once selected, you can choose the configuration tab as seen in Figure 2.
Figure 2: Viewing the Configuration tab in VirtualCenter
In Figure 3 we see that you can when you select Network Adapters from the Hardware menu, you can see the devices present, the speed in which they run at as well as for which switch they are connected to.
Figure 3: Viewing the Network Adapter Properties
Once your physical NICs are in place, we only need to add virtual NICs from your VMs to your Virtual Switch.
Configuring the Virtual Switch
The Virtual Switch is not difficult to configure if you know what your options are. If you understand the concepts of logical vs. physical, now all you need to do is configure them. Obviously, if you have already deployed your ESX server, you likely have a NIC or two installed in it. These are your physical NICs. Inside the ESX environment, you can configure the properties of the logical aspects of the switch to connect your VMs to its own network as well as the outside environment which is usually your local LAN connected to your WAN or Internet. That being said, all you need to do now is configure your VMs, then the network adapters for each of them inside the Virtual Switch. Figure 4 shows the Virtual Switch properties.
Figure 4: Viewing the Virtual Switch Properties
In Figure 5 you can configure your virtual NICs properties. For example, if you needed to configure the speed and duplex of your vmnic, all you would have to so is click on Edit and then select the speed and duplex desired.
Figure 5: Setting the Speed and Duplex on the Virtual NIC
You can also configure the number of ports used in the switch. Ports enable you to create a virtual NIC based connection from a VM to a Virtual Switch. Figure 6 shows the configuration of the ports on the General tab of the Virtual Switches properties.
Figure 6: Configuring the amount of Available Ports
If you need to, you can always click on the Add… link on the Configuration tab in the service console – this way you can invoke the Add Network Wizard as seen in Figure 7. You can add either a VM connection, a new VMKernel or a Service Console connection.
Figure 7: Using the Add Network Wizard
If you choose to add a VM based network, in Figure 8 you can select which physical NIC you would like to connect to and in the preview pane you can start to see your network map being build.
Figure 8: Starting to create a Network
In this article we discussed the components of VMware based physical and logical networking. As mentioned, the Virtual Switch is not difficult to configure if you know what your options are. Make sure you explore the VirtualCenter virtual networking options and learn how to configure the virtual aspects of NICs, switches and then in future articles we will also look at Teaming.