Community Area

Using vSphere Distributed Virtual Switches

by
David Davis
[Published on 11 Sept. 2012 / Last Updated on 11 Sept. 2012]

In this post, we’ll take the next steps in using the new dvSwitch by adding hosts, uplinks, virtual machines, and more.

Introduction

In my last post, Getting Started with vSphere Distributed Switches, I covered what the vSphere Distributed Switch is, the benefits of using it, what’s new in version 5, and how to “install” a vSphere distributed switch. In this post, we’ll take the next steps in using this new dvSwitch by adding hosts, uplinks, virtual machines, and more. So with that, let’s get started!

Moving Uplinks from a Standard Switch to a dvSwitch

One of the problems I had when I went to add the switch was that I had a host that I wanted to add (esx1, in my case) that didn’t have any available NICs that were up and connected to the network. Of course, I could connect those NICs to solve that problem. Or, you can migrate uplinks that are in use by a standard vSwitch (you have to be careful) but I would prefer to keep my standard vSwitch when adding my dvSwitch, for the time being, until I am comfortable. So, let’s say that I have other NICs, already connected, that are part of a standard switch and acting as redundant paths. In that case, I could remove one or more of those redundant NICs from the standard vSwitch and add them to the new dvSwitch to get that host participating (while having both a vSwitch and dvSwitch).

To first free up these NICs from the standard switch, in the vSphere Client, go to the ESXi host in the hosts and cluster inventory. Click on the Configuration tab for the host and go down to Networking. Click on your vSwitch and then on Properties. Click on the Network Properties. Here you can see the adaptors assigned to this vSwitch.

Figure 1

Click on the NIC that you want to remove and land click Remove. That NIC is now available to be added as an uplink to the dvSwitch. Of course, if you did have free NICs that weren’t assigned to any vSwitch then you wouldn’t have had to remove any, as described above.

With at least one free physical NIC, go back into the networking inventory, click on the dvSwitch, and click Add Host, as you see in Figure 2, below.

Figure 2

I selected the host that I had not yet added (esx1 in my case) and the vmnic4 that I removed (and freed up) from the standard vSwitch and clicked Next.

Figure 3

Now, you’ll be given the opportunity to manage the vmkernel virtual adaptor from the standard switch to the dvSwitch. Since I will have both for some time (and I am just testing dvSwitch), I’ll opt to not migrate the virtual adaptor. A bit of caution on migrating vmkernel adaptors! Remember if you were to migrate your only vmkernel adaptor to, let’s say, a dvSwitch that had uplinks that were misconfigured (maybe on the wrong VLAN) then you could be stuck with a down host (from the point of the iSCSI / NFS storage going down and the vSphere & vCenter services no longer having network connectivity).

Figure 4

Next, you’ll be given the opportunity to migrate virtual machine NICs from the standard vSwitch to the dvSwitch. Of course, as long as the standard switch remains, you can do this later. For now, I opted not to migrate any VM networking.

Figure 5

Here’s what it looked like, just before I clicked Finish.

Figure 6

Once completed, if I look at the Ports tab on the uplink port group, you can see that I have one adaptor from each of my hosts and that both of them are showing “Link Up”.

Figure 7

With at least one uplink from each of my hosts, I can move on to two other steps:

Adding port groups

Migrating vmkernel ports

Adding virtual machines networks

Adding Port Groups to a dvSwitch

If you chose to create it when you created the dvSwitch, a default dv Port Group was created for you called, you guessed it, “dvPortGroup”. Of course, you can use this and it, by default, offers up to 128 statically bound virtual ports.

Quick side note – there are 3 types of port bindings for a port group. They are:

Static – use static binding to assign a port to a virtual machine when the virtual machine connects to the distributed port group.

Dynamic - use dynamic binding to assign a port to a virtual machine the first time the virtual machine powers on after it is connected to the distributed port group. Dynamic binding is depricated in ESXi 5.0.

When it comes to adding port groups, best practices say that you should add dv port groups based on the particular types of applications / VMs that will be in the port group. For example, let’s create a dvPortGroup for “WebServers”. To do it, right-click on the dvSwitch and click New Port Group.

Figure 9

Enter a name for the new port group, set the VLAN type, and click Next. Review what you are about to add and click Finish.

Figure 10

Here’s what it looks like when done:

Figure 11

With your new port group added (now 2 total), add virtual machines to the dvSwitch.

Adding Virtual Machines to your dvSwitch

To migrate virtual machines you could manually move a virtual machine’s network adaptor to one of the new dv port groups or, the easier route is to use the Migrate Virtual Machine Networking Wizard that you access by right-clicking on the dvSwitch.

Figure 12

The wizard asks you for the source and destination vSwitch or dvSwitch. When you are creating a new dvSwitch, it’s likely that you are going from a standard vSwitch to a dvSwitch (as you see in Figure 13, below).

Figure 13

In my case, I selected a VM called “wordpress1” to migrate to the new dvSwitch port group.

Figure 14

After clicking Finish, I verified that the VM was indeed on the dvSwitch and, in this case, it was statically assigned to port 10 on the dvPortGroup.

Figure 15

Of course, one of the greatest benefits of using dvSwitches is that you can apply policies to port groups, covering virtual machines on all ESXi hosts, in one quick configuration. There are 7+ different types of dvSwitch policies including security, traffic shaping, VLAN, teaming / failover, resource allocation, monitoring, and miscellaneous. Stay tuned to my future articles for more about configuring dvSwitch policies and other more advanced options.

What Did You Learn?

With a little effort (and great instructions, like these), learning to use vSphere distributed virtual switches isn’t hard and there are so many new features provided, with centralized control being the greatest benefit. In this follow up article to Getting Started with vSphere Distributed Switches, you learned how to remove uplinks from a standard switch, add a host and uplink to the new dvSwitch, add a new port group, and migrate virtual machine networking. For the official vSphere distributed virtual switch documentation, click here.

The Author — David Davis

David Davis is a video training author at Pluralsight.com, the global leader in video training for IT pros. He holds several certifications including VCP5, VCAP-DCA, CCIE #9369, and has been awarded the VMware vExpert award 5 years running.

Featured Links

Office 365 CON 2015

Registration is now open for Office 365 CON 2015, an annual gathering of IT Strategists, Domain Experts and Microsoft MVPs, presenting the latest technologies, challenges and solutions facing the Exchange and Office 365 community of professionals.

Join Michael Osterman from Osterman Research as he kicks-off the conference by sharing his insights into recent trends and challenges obtained through survey research within the Office 365 and Exchange user communities.

Following the kick-off presentation, you can choose from multiple breakout focus sessions, including: