Section 5.2. Virtual Switches


5.2. Virtual Switches

Like a physical switch or hub, a virtual switch has a certain number of ports into which you can plug the virtual NIC of your virtual machines. A virtual switch has 32 logical ports; thus, it can support a maximum of 32 virtual machines per switch.

5.2.1. VMnets

You may set up a virtual switch called a VMnet exclusively for routing high-speed network traffic between virtual machines on the same ESX Server (see Figure 5.1). VMnets can provide added security and isolation of network traffic and provide a more flexible and cost-effective network topology. VMnets can be used for advanced configurations such as parallelization (NLB) or redundant (MSCS) cluster solutions, as well as interesting firewall possibilities. Creating a VMnet is quite simple. Just follow these steps:

  1. Open the MUI.

  2. Click the Options tab.

  3. Click Network Connections…

  4. In the Overview section, click Add.

    Figure 5-1. Configuring a VMnet

  5. In the Network Label property (see the details later in this section), type in a label such as VMnet0 or something more descriptive (perhaps heartbeat if this VMnet will be used for the heartbeat traffic of a cluster).

  6. Do not check any of the network adapters to bind to this virtual switch. Click Create Switch.

  7. Find the newly created virtual switch. It should look something like the image in Figure 5.2

    Figure 5-2. A Virtual Switch

  8. Notice the text: No outbound adapters. Traffic will be routed locally. Virtual machines connecting to this VMnet virtual switch will be able to route network traffic only within the ESX Server itself to those virtual machines that connect to it.

If you were to look at the configuration file of a virtual machine that was connected to a VMnet, the Ethernet section would look like the screenshot in Figure 5.3

Figure 5-3. The Configuration File Information of a Virtual Machine


Notice in Figure 5.3 Ethernet1.devName ="vmnet_0," which is the VMnet. Since a VMnet is a virtual switch, it can be attached to by 32 guests on the same physical host for fast network traffic routing.


Note: If you attempt to delete a VMnet virtual switch that has virtual machines associated to it, you will receive an error message like the one in Figure 5.4

Figure 5-4. Attempting to Delete a VMnet Virtual Switch That Has Virtual Machines Bound to It


5.2.2. VMnics

For external access (to your production network, other virtual machines or the Internet), your virtual switch can be bound to one or more of the physical NICs on your Host. You can bind multiple physical NICs to a virtual switch. for redundancy or load balancing purposes. Redundant physical NICs can be used in case one of the physical NICs fails or loses network connectivity. These physical NICs can also be combined, creating a bond, for load balancing or fault tolerance between the physical NICs.

Each virtual machine's virtual NIC logically plugs into a port in the virtual switch. Traffic from your virtual machine is passed out the physical NIC(s) that are associated with the virtual switch. See Figure 5.5

Figure 5-5. Passing Traffic through the Physical NICs on a Virtual Machine


Figure 5.5 depicts a simple virtual switch configuration. ESX Server 1 has one virtual machine called Database Server with an IP address of 192.168.0.15. The Database Server virtual machine's NIC is plugged into the virtual switch labeled Network0, which is bound to the ESX Server's physical NIC. ESX Server 1's physical NIC is plugged into the Production Switch, which has access to the 192.168.0.x subnet. This is the simplest of configurations, but understanding the concepts presented in the figure is essential.

5.2.2.1. Network Labels

In ESX Server, you can label your virtual switches. This label is important because it can serve as a "functional descriptor" for the switch. What this means is that you can label your virtual switch something like 192.168.0.x to indicate that all connections to this switch will be on this subnet. You can also label the virtual switch something like ESX Internal to represent that this particular switch is only for ESX internal networking between virtual machines (a VMnet) with no physical NICs of your ESX Server bound to it. Figure 5.6 depicts an ESX Server with two virtual switches.

Figure 5-6. An ESX Server with Two Virtual Switches


Figure 5.6 shows an ESX Server with two virtual switches and two virtual machines. One virtual switch is labeled 192.168.0.x and is bound to the ESX Server's physical NIC. The other virtual switch, a VMnet, is labeled ESX Internal. This VMnet virtual switch is not bound to any physical NIC and thus provides high-speed routing of network traffic only within the ESX Server itself. The virtual machine called Web Front End has two virtual NICs: one going into the production network via the virtual switch labeled 192.169.0.x and another virtual NIC talking to the Database Server via the ESX Internal VMnet virtual switch.


Note: It is important to note that you can only change the label of a virtual switch if no virtual machines are associated with it or the virtual machines associated with it are turned off.
5.2.2.2. Creating Virtual Switches

It is a fairly easy task to create a virtual switch. Just follow these steps.

  1. Log in to the MUI as root. If it is your first time logging in to the MUI since you loaded ESX, you'll see a window that looks like the one in Figure 5.7 You will immediately notice that virtual Ethernet switches have been configured.

    Figure 5-7. Logging In to the MUI

  2. Click the Reconfigure link. You'll see a window like the one in Figure 5.8

    Figure 5-8. Adding a Virtual Switch

  3. A window like the one in Figure 5.9 appears.

    Figure 5-9. Virtual Switch Window

  4. Read the contents of this window. It introduces virtual switches, NIC teaming, and port groups (all of which are discussed in greater detail in this chapter).

  5. Click the Create link in the top paragraph. This takes you to the Create Virtual switch window (see Figure 5.10).

    Figure 5-10. Creating a Virtual Switch

  6. By default, the first Network Label is Network0. You can leave this or give it a better functional description, such as a subnet it represents or whether it's an internal or external connection.

  7. Under the Bind Network Adapters heading, check which physical adapters you want to bind to this virtual switch.

  8. Click Create Switch. The window shown in Figure 5.11 appears.

Figure 5-11. Virtual Switch Added


This is the Edit page for Virtual switch Network0. It is here where you can add or remove physical NICs from the virtual switch. Remember that if a virtual switch has VMs running and plugged into it, you won't be able to edit these settings until the VMs are shut down.




Virtualization With VMware ESX Server
Configuring VMware ESX Server 2.5 (Vol 1)
ISBN: 1597490199
EAN: 2147483647
Year: 2005
Pages: 173

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net