Building a VMware vSphere Virtual Lab with VMware Fusion - Part 6: Create VMkernel port group for vMotion and enable DRS

This is the sixth part in a series of tutorials on how to build a VMware vSphere Virtual Lab on a Mac with VMware Fusion. In this tutorial, we'll configure vMotion and enable DRS.

Overview

In the last tutorial, we created a Ubuntu storage server and configured our ESXi hosts to communicate with it using iSCSI Multipathing. We also migrated the pfSense and vCenter VMs onto the storage. This means we can now migrate a running VM from one host to another using vMotion.

In this tutorial, we’ll create a new VMkernel port group for vMotion and enable vMotion on this port group. We’ll test vMotion works by migrating the pfSense firewall to another host, and we’ll finish by enabling vSphere DRS on our cluster.

Prerequisites

Ideally you should have read the previous tutorials in the series before following the steps in this tutorial.

After completing the steps in the previous tutorials, you will be at a point where you have:

  • Three ESXi 6.7 VMs running on VMware Fusion*.
  • The first ESXi VM contains a pfSense firewall VM with built in DNS Resolver.
  • The first ESXi VM also contains the vCenter Server Appliance.
  • A cluster with three ESXi 6.7 hosts added to it.
  • Each host is connected to a 1 TB iSCSI LUN and our VMs are located on it.

Log into vCenter and we’ll begin by creating the port group for vMotion.

Step 1: Create VMkernel Port Group for vMotion

We could enable vMotion on the management network but it’s better to create a separate network for vMotion. The reason is because vMotion can max out all the available bandwidth of an uplink. We don’t want VM migrations slowing down the management network, so we’ll create a new port group that can have traffic shaping or failover ordering enabled.

We’ll use the following IP addresses and VLAN IDs when creating the port groups.

esxi01 10.2.1.11 (VLAN 103)
esxi02 10.2.1.12 (VLAN 103)
esxi03 10.2.1.13 (VLAN 103)

OK, let’s create the first vMotion port group by following the steps below.

  1. Click on the first ESXi host.
  2. Click Configure.
  3. Click Virtual switches.
  4. Click ADD NETWORKING.

screenshot

Choose VMkernel Network Adapter then click NEXT.

screenshot

Choose the existing vSwitch0 then click NEXT.

screenshot

Give the network label a name of vMotion, assign 103 as the VLAN ID, tick the vMotion option and then click NEXT.

screenshot

Select Use static IPv4 settings, assign 10.2.1.11 for the IP address, 255.255.255.0 for the subnet mask and then click NEXT.

screenshot

Confirm the settings by clicking FINISH.

screenshot

Repeat the steps above on the remaining two ESXi hosts but use 12 and 13 for the host portion of the IP address.

screenshot

Step 2: Test Migration

Now that vMotion is enabled, we can test it by migrating the pfSense firewall (fw01) VM from esxi01 to esxi02. Follow the steps below to migrate the VM while still powered on.

Right click on the VM, then click Migrate…

screenshot

Select Change compute resource only then click NEXT.

screenshot

Since the VM is currently running on esxi01, we’ll choose esxi02 then click NEXT.

screenshot

Confirm the networks are the same then click NEXT.

screenshot

Click NEXT again.

screenshot

Click FINISH to start the migration.

screenshot

Wait for the migration status to reach 100%.

screenshot

During and after migration you should still be able to ping out to Google from any of the ESXi hosts.

[root@esxi01:~] ping google.com
PING google.com (216.58.206.142): 56 data bytes
64 bytes from 216.58.206.142: icmp_seq=0 ttl=127 time=25.861 ms
64 bytes from 216.58.206.142: icmp_seq=1 ttl=127 time=26.550 ms
64 bytes from 216.58.206.142: icmp_seq=2 ttl=127 time=26.217 ms

Once finished, you can try a migration from esxi02 to esxi03 to make sure vMotion is working on all hosts.

Step 3: Enable vSphere DRS

Now that we know vMotion is configured and working. We can enable vSphere DRS on the cluster so that VMs are automatically migrated, keeping the resources balanced.

Click on Cluster01, Configure then EDIT.

screenshot

Click the toggle button to enable vSphere DRS then click OK.

screenshot

With DRS enabled, when you put a host into maintenance mode, it will automatically migrate the VMs on that host to another host in the cluster.

Conclusion

After following the steps in this tutorial our lab now has vMotion enabled and we’re able to migrate VMs while they are still powered on. We also enabled vSphere DRS which means VMs will automatically migrate to keep the resources in the cluster balanced.

Coming next

In the next tutorial, we’ll create a distributed virtual switch and migrate our main standard vSwitch uplinks and port groups to it.

Read Next - Part 7: Creating a Distributed Switch and Migrating Port groups

Further reading

As I’m sure you’re aware, there’s only so much information that can go into a blog post, which is why you might want to check out the book titled Mastering VMware vSphere 6.7* (Marshall, Brown, Fritz, Johnson) to get a more in depth understanding of vSphere.

Written by Tony

I'm a blogger, software developer and sysadmin, with a degree in applied computing and 16+ years experience managing IT systems. Get in touch: tony@graspingtech.com

Tags: ESXi Fusion vCenter