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.
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.
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.
- Click on the first ESXi host.
- Click Configure.
- Click Virtual switches.
- Click ADD NETWORKING.
Choose VMkernel Network Adapter then click NEXT.
Choose the existing vSwitch0 then click NEXT.
Give the network label a name of vMotion, assign 103 as the VLAN ID, tick the vMotion option and then click NEXT.
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.
Confirm the settings by clicking FINISH.
Repeat the steps above on the remaining two ESXi hosts but use
13 for the host portion of the IP address.
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…
Select Change compute resource only then click NEXT.
Since the VM is currently running on esxi01, we’ll choose esxi02 then click NEXT.
Confirm the networks are the same then click NEXT.
Click NEXT again.
Click FINISH to start the migration.
Wait for the migration status to reach 100%.
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 (184.108.40.206): 56 data bytes
64 bytes from 220.127.116.11: icmp_seq=0 ttl=127 time=25.861 ms
64 bytes from 18.104.22.168: icmp_seq=1 ttl=127 time=26.550 ms
64 bytes from 22.214.171.124: 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.
Click the toggle button to enable vSphere DRS then click OK.
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.
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.
In the next tutorial, we’ll create a distributed virtual switch and migrate our main standard vSwitch uplinks and port groups to it.
Part 7: Creating a Distributed Switch and Migrating Port groups