Module 2 - HCX for VM Migration
Module 2: Deploy HCX for VM Migration
Introduction to VMware HCX
VMware HCX™ is an application mobility platform designed for simplifying application migration, workload rebalancing and business continuity across data centers and clouds. HCX supports the following types of migrations:
- Cold Migration - Offline migration of VMs.
- Bulk Migration - scheduled bulk VM (vSphere, KVM, Hyper-V) migrations with reboot – low downtime.
- HCX vMotion - Zero-downtime live migration of VMs – limited scale.
- Cloud to Cloud Migrations – direct migrations between VMware Cloud SDDCs moving workloads from region to region or between cloud providers.
- OS Assisted Migration – bulk migration of KVM and Hyper-V workloads to vSphere (HCX Enterprise feature).
- Replication Assisted vMotion - Bulk live migrations with zero downtime combining HCX vMotion and Bulk migration capabilities (HCX Enterprise feature).
In this module, we will go through the steps to Install HCX, configure and migrate a test VM to Azure VMware Solution (AVS).
For more information on HCX, please visit VMware’s HCX Documentation.
HCX Setup for Azure VMware Solution (AVS)
![](Mod2MainPic1.png)
Prerequisites
- Ensure that Module 1 has been completed successfully as this will be required to connect HCX from AVS to the On-Premises Lab.
- Ability to reach out to vCenter portal from Jumpbox VM:
- AVS vCenter: Get IP from Azure Portal - AVS blade
- On-premises vCenter: 10.X.Y.2
Remember that X is your group number and Y your participant number.
1 - Module 2 Task 1
Task 1 : Install VMware HCX on AVS Private Cloud
Exercise 1: Enable HCX on AVS Private Cloud
In the following task, we will be installing HCX on your AVS Private Cloud. This is a simple process from the Add-ons section in the Azure Portal, or via Bicep/ARM/PowerShell.
NOTE: This task may or may not have been completed for you in your AVS environment. Only one participant per group can enable HCX in the SDDC so if you’re not the first participant in the group to enable HCX, just use these instructions for reference.
Step 1: Navigate to your SDDC
![Navigate to your SDDC in Azure portal](Mod2Task1Pic1.png)
- Navigate to the Azure Portal, search for Azure VMware Solution in the search bar.
- Click on Azure VMware Solution.
Step 2: Locate your AVS SDDC
![Locate your AVS SDDC in Azure portal](Mod2Task1Pic2.png)
- Select the private cloud assigned to you or your group.
Step 3: Enable HCX on your AVS Private Cloud
![Enable HCX on your AVS Private Cloud](Mod2Task1Pic3.png)
- From your Private Cloud blade, click on + Add-ons.
- Click Migration using HCX.
- Select the checkbox to agree with terms and conditions.
- Click Enable and deploy.
HCX will start getting deployed in your AVS Private Cloud and it should take about 10-20 minutes to complete.
2 - Module 2 Task 2
Task 2: Download the HCX OVA to On-Premises vCenter
You will perform the instructions below from AVS VMware Environment
Exercise 1: Download HCX OVA for Deployment of HCX on-premises
The next step is to download HCX onto our On-Premises VMware environment, this will allow us to setup the connectivity to AVS and allow us to migrate. The HCX appliance is provided by VMware and has to be requested from within the AVS HCX Manager.
![Locate AVS SDDC Identity Information](Mod2Task2Pic1.png)
- Obtain the AVS vCenter credentials by going to your AVS Private Cloud blade in the Azure portal, select VMware credentials.
- cloudadmin@vsphere.local is the local vCenter user for AVS, keep this handy.
- You can copy the Admin password to your clipboard and keep it handy as well.
Step 3: Locate HCX Cloud Manager IP
![Locate HCX Cloud Manager IP](Mod2Task2Pic3.png)
- In your AVS Private Cloud blade, click + Add-ons.
- Click Migration using HCX.
- Copy the HCX Cloud Manager IP URL, open a new browser tab and paste it, and enter the cloudadmin credentials obtained above.
Step 4: Request HCX OVA Download Link
The screenshot below is from AVS VMware Environment
The Request Download Link button will be grayed out initially but will be live after a minute or two. Do not navigate away from this page. Once available, you will have an option to Download the OVA or Copy a Link.
This link is valid for 1 week.
![](Mod2Task2Pic4.png)
3 - Module 2 Task 3
Task 3: Import the OVA file to the On-Premises vCenter
Import the OVA file to the On-Premises vCenter
In this step we will import the HCX appliance into the on premises vCenter.
You can choose to do this Task in 2 different ways:
Step 1: Obtain your AVS vCenter Server credentials
![Obtain your AVS vCenter Server credentials](Mod2Task3Pic1.png)
- In your AVS Private Cloud blade click Identity.
- Locate and save both vCenter admin username cloudadmin@vsphere.local and password.
Step 2: Locate HCX Cloud Manager IP
![Locate HCX Cloud Manager IP](Mod2Task3Pic2.png)
- Click on + Add-ons.
- Copy the HCX Cloud Manager IP.
Step 3: Log in to HCX Cloud Manager IP
You will perform the instructions below from AVS VMware Environment
![Log in to HCX Cloud Manager IP](Mod2Task3Pic3.png)
Open a browser tab and paste the HCX Cloud Manager IP and enter the credentials obtained in the previous step.
Step 4: Request Download Link for HCX OVA
- In the left pane click System Updates.
![Request Download Link for HCX OVA](Mod2Task3Pic4.png)
- Click REQUEST DOWNLOAD LINK, please keep in mind that the button might take a couple of minutes to become enabled.
![HCX download links](Mod2Task3Pic5.png)
Option 1: Download and deploy HCX OVA to on-premises vCenter
- Click VMWARE HCX to download the HCX OVA localy.
Option 2: Deploy HCX from a vCenter Content Library
- Click COPY LINK if you will install HCX with this method.
You will perform the instructions below from the On-premises VMware Environment
Step 1: Access Content Libraries from on-premises vCenter
Browse to the on-premises vCenter URL, See Getting Started section for more information and login details.
![Access Content Libraries from on-premises vCenter](Mod2Task3Pic6.png)
- From your on-premises vCenter click Menu.
- Click Content Libraries.
Step 2: Create a new Content Library
![Create a new Content Library](Mod2Task3Pic7.png)
Create a new local content library if one doesn’t exist by clicking the + sign.
Step 3: Import Item to Content Library
![Import Item to Content Library](Mod2Task3Pic8.png)
- Click ACTIONS.
- Click Import Item.
![Enter the HCX URL copied in a step 1](Mod2Task3Pic9.png)
- Enter the HCX URL copied in a previous step.
- Click IMPORT.
Accept any prompts and actions and proceed. The HCX OVA will download to the library in the background.
4 - Module 2 Task 4
Task 4: Deploy the HCX OVA to On-Premises vCenter
Deploy HCX OVA
In this step, we will deploy the HCX VM with the configuration from the On-Premises VMware Lab Environment section.
You will perform the instructions below from the On-premises VMware Environment
Step 1: Deploy HCX connector VM
If Option 1: Deploy OVA from download.
![Deploy OVF Template from download](Mod2Task4Pic1.png)
- Right-click Cluster-1.
- Click Deploy OVF Template.
![Select the OVA Template](Mod2Task4Pic2.png)
- Click the button to point to the location of the downloaded OVA for HCX.
- Click NEXT.
If Option 2: Deploy HCX from Content Library
![Create new VM from Template](Mod2Task4Pic6.png)
- Once the import is completed from the previous task, click Templates.
- Right Click the imported HCX template.
- Click New VM from This Template.
![Select a Name and Folder](Mod2Task4Pic7.png)
- Give your HCX Connector a name: HCX-OnPrem-X-Y, where X is your group number and Y is your participant number.
- Click NEXT.
Step 2: Name the HCX Connector VM
![Name the HCX Connector VM](Mod2Task4Pic3.png)
- Give your HCX Connector a name: HCX-OnPrem-X-Y, where X is your group number and Y is your participant number.
- Click NEXT.
Step 3: Assign the network to your HCX Connector VM
![Assign the network to your HCX Connector VM](Mod2Task4Pic4.png)
Keep the defaults for:
- Compute Resource
- Review details
- License agreements (Accept)
- Storage (LabDatastore)
- Click to select management network.
- Click NEXT.
Step 4: Customize template
![Customize template](Mod2Task4Pic5.png)
Property | Value |
---|
Hostname | Suggestion: HCX-OnPrem-X-Y) Note: Do not leave a space in the name as this causes the webserver to fail) |
CLI “admin” User Password/root Password | MSFTavs1! |
Network 1 IPv4 Address | 10.X.Y.9 |
Network 1 IPv4 Prefix Length | 27 |
Default IPv4 Gateway | 10.X.Y.1 |
DNS Server list | 1.1.1.1 |
Step 5: Validate deployment
Once done, navigate to Menu > VM’s and Templates > Power on the newly created HCX Manager VM.
The boot process may take 10-15 minutes to complete.
5 - Module 2 Task 5
Task 5: Obtain HCX License Key
Obtain HCX License Key
While the HCX installation runs, we will need to obtain a license key to activate HCX. This is available from the AVS blade in the Azure Portal.
Step 1: Create HCX Key from Azure Portal
![Create HCX Key from Azure Portal](Mod2Task5Pic1.png)
- Click + Add-ons.
- Click + Add.
- Give your HCX Key a name: HCX-OnPrem-X-Y, where X is your group number and Y your participant number.
- Click Yes.
Save the key, you will need it to activate it in your on-premises setup.
6 - Module 2 Task 6
Task 6: Activate VMware HCX
You will perform the instructions below from the On-premises VMware Environment
Activate VMware HCX
In this task, we will activate the On-Premises HCX appliance that we just deployed in Task 4.
Step 1: Log in to HCX Appliance Management Interface
![Log in to HCX Appliance Management Interface](Mod2Task6Pic1.png)
- Browse to the On-Premises HCX Manager IP specified in Task 4 on port 9443 IP and login (Make sure you use https:// in the address bar in the browser).
- Login using the HCX Credentials specified in Task 4.
- Username:
admin
- Password:
MSFTavs1!
(Specified earlier in Task 4).
Step 2: Enter HCX Key
![Enter HCX Key](Mod2Task6Pic2.png)
Once logged in, follow the steps below.
- Don’t change the HCX Activation Server field. Please keep as is.
- In HCX License Key field, please enter your key for HCX Activation Key that you obtains from AVS blade in Azure Portal.
- Lastly, select Activate. Please keep in mind that this process can take several minutes.
Step 3: Enter Datacenter Location, System Name
![Enter Datacenter Location, System Name](Mod2Task6Pic3.png)
In Datacenter Location, provide the nearest biggest city to your location for installing the VMware HCX Manager On-Premises. Then select Continue. In System Name, modify the name to HCX-OnPrem-X-Y and click Continue.
Note: The city location does not matter in this lab. It’s just a named location for visualization purposes.
Step 4: Continue to complete configuration
![Continue to complete configuration](Mod2Task6Pic4.png)
Click “YES, CONTINUE” for completing next task. After a few minutes HCX should be successfully activated.
7 - Module 2 Task 7
Task 7: Configure HCX and connect to vCenter
You will perform the instructions below from the On-premises VMware Environment
In this section, we will integrate and configure HCX Manager with the On-Premises vCenter Server.
Step 1: Connect vCenter Server
![Connect your vCenter Server](Mod2Task7Pic1.png)
- In Connect your vCenter, provide the FQDN or IP address of on-premises vCenter server and the appropriate credentials.
- Click CONTINUE.
![Configure SSO/PSC](Mod2Task7Pic2.png)
- In Configure SSO/PSC, provide the same vCenter IP address: https://10.X.Y.2
- Click CONTINUE.
Step 3: Restart HCX Appliance
![Restart HCX appliance to save changes](Mod2Task7Pic3.png)
Verify that the information entered is correct and select RESTART.
The Reboot process might take up to 15 minutes
The reboot process might take between 10 to 15 minutes. Keep checking every 3-4 minutes to ensure you can get to HCX Manager.![HCX configuration dashboard after restart](Mod2Task7Pic4.png)
- After the services restart, you’ll see vCenter showing as Green on the screen that appears. Both vCenter and SSO must have the appropriate configuration parameters, which should be the same as the previous screen.
- Next, click on Configuration to complete the HCX configuration.
![Edit the HCX Administrator role mapping configuration](Mod2Task7Pic5.png)
- Click Configuration.
- Click HCX Role Mapping.
- Click Edit.
- Change User Groups value to match lab SSO configuration:
avs.lab\Administrators
- Save changes.
Please note that by default HCX assigns the HCX administrator role to “vsphere.local\Administrators”. In real life, customers will have a different SSO domain than vsphere.local and needs to be changed. This is the case for this lab and this needs to be changed to avs.lab.
It may take an additional 5-10 minutes for the HCX plugins to be installed in vCenter, log back out and log back in if it does not show up automatically.
8 - Module 2 Task 8
Task 8: Create Site Pairing from On-premises HCX to AVS HCX
You will perform the instructions below from the On-premises VMware Environment
HCX Site Pairing
In this task, we will be creating the Site Pairing to connect the On-Premises HCX appliance to the AVS HCX appliance.
Step 1: Access On-Premises HCX
![Refrehs On-Premises vCenter UI to load HCX plugin](Mod2Task8Pic1.png)
There are 2 ways to access HCX:
- Through the vCenter server plug-in. Click Menu -> HCX.
- Through the stand-alone UI. Open a browser tab and go to your local HCX Connector IP: https://10.X.Y.9
In either case, log in with your vCenter credentials:
- Username:
administrator@avs.lab
- Password:
MSFTavs1!
NOTE: If working through vCenter Server, you may see a banner item to Refresh the browser, this will load the newly installed HCX modules. If you do not see this, log out and log back into vCenter.
Step 2: Connect to Remote Site
![Connect to remote site](Mod2Task8Pic2.png)
- Click Site Pairing in the left pane.
- Click CONNECT TO REMOTE SITE.
![Remote site configuration wizard](Mod2Task8Pic3.png)
- Enter credentials for your AVS vCenter found in the Azure Portal. The Remote HCX URL is found under the Add-ons blade and it is NOT the vCenter URL.
- Click CONNECT.
- Accept certificate warning and Import
NOTE: Ideally the identity provided in this step should be an AD based credential with delegation instead of the cloudadmin account.
![Established site pairing](Mod2Task8Pic4.png)
Connection to the remote site will be established.
9 - Module 2 Task 9
Task 9: Create network profiles
You will perform the instructions below from the On-premises VMware Environment
HCX Network Profiles
A Network Profile is an abstraction of a Distributed Port Group, Standard Port Group, or NSX Logical Switch, and the Layer 3 properties of that network. A Network Profile is a sub-component of a complete Compute Profile.
Customer’s environments may vary and may not have separate networks.
In this Task you will create a Network Profile for each network intended to be used with HCX services. More information can be found in VMware’s Official Documentation, Creating a Network Profile.
- Management Network - The HCX Interconnect Appliance uses this network to communicate with management systems like the HCX Manager, vCenter Server, ESXi Management, NSX Manager, DNS, NTP.
- vMotion Network - The HCX Interconnect Appliance uses this network for the traffic exclusive to vMotion protocol operations.
- vSphere Replication Network - The HCX Interconnect Appliance uses this network for the traffic exclusive to vSphere Replication.
- Uplink Network - The HCX Interconnect appliance uses this network for WAN communications, like TX/RX of transport packets.
These networks have been defined for you, please see below section.
In a real customer environment, these will have been planned and identified previously, see here for the planning
phase.
Step 1: Create 4 Network Profiles
![Create Network Profile](Mod2Task9Pic1.png)
- Click Interconnect.
- Click Network Profiles.
- Click CREATE NETWORK PROFILE.
In this lab, these are in the Network Profile Information section.
We will create 4 separate network profiles:
![Enter information for each Network Profile](Mod2Task9Pic2.png)
- Select Distributed Port Groups.
- Select Management Network.
- Enter the Management Network IP range from the table below. Remeber to replace X with your group number and Y with your participant number. Repeat the same steps for Replication, vMotion and Uplink Network profiles.
- Ensure the select the appropriate checkboxes depending on type of Network Profile you’re creating.
You should create a total of 4 Network Profiles.
Management Network Profile
Property | Value |
---|
Management Network IP | 10.X.Y.10-10.X.Y.16 |
Prefix Length | 27 |
Management Network Gateway | 10.X.Y.1 |
Uplink Network Profile
Property | Value |
---|
Uplink Network IP | 10.X.Y.34-10.X.Y.40 |
Prefix Length | 28 |
Uplink Network Gateway | 10.X.Y.33 |
DNS | 1.1.1.1 |
vMotion Network Profile
Property | Value |
---|
vMotion Network IP | 10.X.Y.74-10.X.Y.77 |
Prefix Length | 27 |
vMotion Network Gateway | 10.X.Y.65 |
DNS | 1.1.1.1 |
Replication Network Profile
Property | Value |
---|
Replication IP | 10.X.Y.106-10.X.Y.109 |
Prefix Length | 27 |
Replication Network Gateway | 10.X.Y.97 |
DNS | 1.1.1.1 |
10 - Module 2 Task 10
Task 10: Create compute profiles
You will perform the instructions below from the On-premises VMware Environment
HCX Compute Profile
A compute profile contains the compute, storage, and network settings that HCX uses on this site to deploy the interconnected dedicated virtual appliances when service mesh is added. For more information on compute profile and its creation please refer to VMware documentation.
Step 1: Compute Profile Creation
![Compute Profile Creation](Mod2Task10Pic1.png)
- In your on-premises HCX installation, click Interconnect.
- Click Compute Profiles.
- Click CREATE COMPUTE PROFILE.
Step 2: Name Compute Profile
![Name Compute Profile](Mod2Task10Pic2.png)
- Give your Compute Profile a Name. Suggestion: OnPrem-CP-X-Y, where X is your group number and Y is your participant number.
- Click CONTINUE.
Step 3: Select Services for Compute Profile
![Select Services for Compute Profile](Mod2Task10Pic3.png)
- Review the selected services. By default all the above services are selected. In a real world scenario, if a customer let’s say doesn’t need Network Extension, you would unselect that service here. Leave all defaults for the purpose of this workshop.
- Click CONTINUE.
Step 4: Select Service Resources
![Select Service Resources](Mod2Task10Pic4.png)
- Click the arrow next to Select Resource(s).
- In this on-premises simulation, you only have one Cluster called OnPrem-SDDC-Datacenter-X-Y. In a real world scenario, it’s likely your customer may have more than one Cluster. HCX Service Resources are resources from where you’d like HCX to either migrate or protect VMs from. Select the top level OnPrem-SDDC-Datacenter-X-Y.
- Click OK.
- Click CONTINUE.
Step 5: Select Deployment Resources
![Select Deployment Resources](Mod2Task10Pic5.png)
- Click the arrow next to Select Resource(s). Here you will be selecting the Deployment Resource, which is where the additional HCX appliances needing to be installed will be placed in the on-premises environment. Select OnPrem-SDDC-Cluster-X-Y.
- For Select Datastore click and select the LabDatastore that exists in your simulated on-premises environment. This will be the on-premises Datastore the additional HCX appliances will be placed in.
- (Optional) click to Select Folder in the on-premises vCenter Server where to place the HCX appliances. You can select vm for example.
- Interconnect Appliance Reservation Settings, here you would set CPU/Memory Reservations for these appliances in your on-premises vCenter Server.
- Leave the default 0% value.
- Click CONTINUE.
Step 6: Select Management Network Profile
![Select Management Network Profile](Mod2Task10Pic6.png)
- Select the Management Network Profile you created in a previous step.
- Click CONTINUE.
Step 7: Select Uplink Network Profile
Warning
Due to the current lab setup, please select network OnPrem-management-x-y. However, in typical production scenarios it is more likely to be the Uplink Network Profile.![Select Uplink Network Profile](Mod2Task10Pic7.png)
- Select the Management Network Profile you created in a previous step. DO NOT select the uplink network profile, this network profile was created to simulate what an on-premises environment might look like, but the only functional uplink network for this lab is the Management Network.
- Click CONTINUE.
Step 8: Select vMotion Network Profile
![Select vMotion Network Profile](Mod2Task10Pic8.png)
- Select the vMotion Network Profile you created in a previous step.
- Click CONTINUE.
Step 9: Select vSphere Replication Network Profile
![Select vSphere Replication Network Profile](Mod2Task10Pic9.png)
- Select the vSphere Replication Network Profile you created in a previous step.
- Click CONTINUE.
Step 10: Select Network Containers
![Select Network Containers](Mod2Task10Pic10.png)
- Click the arrow next to Select Network Containers.
- Select the virtual distributed switch you’d like to make eligible for Network Extension.
- Click CLOSE.
- Click CONTINUE.
Step 11: Review Connection Rules
![Review Connection Rules](Mod2Task10Pic11.png)
- Review the connection rules.
- Click CONTINUE.
Step 12: Finish creation of Compute Profile
![Finish creation of Compute Profile](Mod2Task10Pic12.png)
Click FINISH to create the compute profile.
![Compute Profile is created successfully](Mod2Task10Pic13.png)
Your Compute Profile is created successfully.
11 - Module 2 Task 11
Task 11: Create a service mesh
You will perform the instructions below from the On-premises VMware Environment
HCX Service Mesh Creation
An HCX Service Mesh is the effective HCX services configuration for a source and destination site. A Service Mesh can be added to a connected Site Pair that has a valid Compute Profile create on both of the sites.
Adding a Service Mesh initiates the deployment of HCX Interconnect virtual appliances on both sites. An interconnect Service Mesh is always created at the source site.
More information can be found inf VMware’s Official Documentation, Creating a Service Mesh.
Step 1: Create Service Mesh
![Create Service Mesh](Mod2Task11Pic1.png)
- Click Interconnect.
- Click Service Mesh.
- Click CREATE SERVICE MESH.
Step 2: Select Sites
![Select Sites](Mod2Task11Pic2.png)
- Select the source site (on-premises).
- Select the destination site (AVS).
- Click CONTINUE.
Step 3: Select Compute Profiles
![Select Compute Profiles](Mod2Task11Pic3.png)
- Click to select Source Compute Profile which you recently created, click CLOSE.
- Click to select Remote Compute Profile from AVS side, click CLOSE.
- Click CONTINUE.
Step 4: Select Services to be Activated
![Select Services to be Activated](Mod2Task11Pic4.png)
Leave the Default Services and click CONTINUE.
Step 5: Advanced Configuration - Override Uplink Network Profiles
Warning
Due to the current lab setup, please select network OnPrem-management-x-y. However, in typical production scenarios it is more likely to be the Uplink Network Profile.![Advanced Configuration - Override Uplink Network Profiles](Mod2Task11Pic5.png)
- Click to select the previously created Source Management Network Profile, click CLOSE. Even though you created an Uplink Network Profile, for the purpose of this lab, the management network is used for uplink.
- Click to select the Destination Uplink Network Profile (usually TNTXX-HCX-UPLINK), click CLOSE.
- Click CONTINUE.
Step 6: Advanced Configuration: Network Extension Appliance Scale Out
![Advanced Configuration: Network Extension Appliance Scale Out](Mod2Task11Pic6.png)
In Advanced Configuration – Network Extension Appliance Scale Out, keep the defaults and then click CONTINUE.
Step 7: Advanced Configuration - Traffic Engineering
![Advanced Configuration - Traffic Engineering](Mod2Task11Pic7.png)
In Advanced Configuration – Traffic Engineering, review, leave the defaults and click CONTINUE.
Step 8: Review Topology Preview
![Review Topology Preview](Mod2Task11Pic8.png)
Review the topology preview and click CONTINUE.
Step 9: Ready to Complete
![Ready to Complete](Mod2Task11Pic9.png)
- Enter a name for your Service Mesh (SUGGESTION: HCX-OnPrem-X-Y, where X is your group number, Y your participant number).
- Click FINISH.
Note: the appliance names are derived from service mesh name (it’s the appliance prefix, essentially).
Step 10: Confirm Successful Deployment
![Confirm Successful Deployment](Mod2Task11Pic10.png)
The Service Mesh deployment will take 5-10 minutes to complete. Once successful, you will see the services as green. Click on VIEW APPLIANCES.
![Confirm Successful Deployment - finished](Mod2Task11Pic11.png)
- You can also navigate by clicking Interconnect - Service Mesh.
- Click Appliances.
- Check for Tunnel Status = UP.
You’re ready to migrate and protect on-premises VMs to Azure VMware Solution using VMware HCX. Azure VMware Solution supports workload migrations (with or without a network extension). So you can still migrate workloads in your vSphere environment, along with On-Premises creation of networks and deployment of VMs onto those networks.
For more information, see the VMware HCX Documentation.
12 - Module 2 Task 12
Task 12: Network Extension
You will perform the instructions below from the On-premises VMware Environment
HCX Network Extension
You can extend networks between and HCX-activated on-premises environment and Azure VMware Solution (AVS) with HCX Network Extension.
With VMware HCX Network Extension (HCX-NE), you can extend a VM’s network to a VMware HCX remote site like AVS. VMs that are migrated, or created on the extended network at the remote site, behave as if they exist on the same L2 network segement a VMs in the source (on-premises) environment. With Network Extension from HCX, the default gateway for an extended network is only connected at the source site. Traffic from VMs in remote sites must be routed to a different L3 network will flow through the source site gateway.
With VMware HCX Network Extension you can:
- Retain the IP and MAC addresses of the VMs and honor existing network policies.
- Extend VLAN-tagged networks from a VMware vSphere Distributed Switch.
- Extend NSX segments.
For more information please visit VMware’s documentation for Extending Networks with VMware HCX.
Once the Service Mesh appliances have been deployed, the next important step is to extend the on-premises network(s) to AVS, so that any migrated VM’s will be able to retain their existing IP address.
Step 1: Network Extension Creation
![Start Network Extension creation wizard](Mod2Task12Pic1.png)
- Click Network Extension.
- Click CREATE A NETWORK EXTENSION.
Step 2: Select Source Networks to Extend
![Select Source Networks to Extend](Mod2Task12Pic2.png)
- Select Service Mesh - Ensure you select your own Service Mesh you created in an earlier step.
- Select OnPrem-workload-X-Y network.
- Click NEXT.
![Configure Network Extension settings](Mod2Task12Pic3.png)
- Destination First Hop Router
- If applicable, ensure your own NSX-T T1 router you created earlier is selected.
- Otherwise, select the TNT**-T1 router.
- Enter the Gateway IP Address / Prefix Length for the OnPrem-workload-X-Y network. You can find this information in the On-Premises Lab Environment section.
- Example: 10.X.1Y.129/25, where X is your group number and Y is your participant number.
- Ensure your own Extension Appliance is selected.
- Confirm your own T1 is selected under Destination First Hop Router.
- Click SUBMIT.
It might take 5-10 minutes for the Network Extension to complete.
Step 4: Confirm Status of Network Extension
![Confirm Status of Network Extension](Mod2Task12Pic4.png)
Confirm the status of the Network Extension as Extension complete.
13 - Module 2 Task 13
Task 13: Migrate a VM using HCX vMotion
You will perform the instructions below from the On-premises VMware Environment
(Optional) Confirm HCX Health
You may perform some VMware HCX appliance basic health checks using HCX Central CLI (CCLI) commands before initiating migrations. The HCX Manager Central CLI is used for diagnostic information collection and secure connections to the Service Mesh. You may refer to these articles for additional information:
Troubleshooting VMware HCX and
Getting started with the HCX CCLI.
Migrate a VM using HCX vMotion
Now that your Service Mesh has deployed the additional appliances HCX will utilize successfully, you can now migrate VMs from your on-premises environment to AVS. In this module, you will migrate a test VM called Workload-X-Y-1 that has been pre-created for you in your simulated on-premises environment using HCX vMotion.
Exercise 1: Migrate VM to AVS
Step 1: Examine VM to be migrated
![Examine VM to be migrated](Mod2Task13Pic1.png)
- Click the VMs and Templates icon in your on-premises vCenter Server.
- You will find the VM named Workload-X-Y-1, select it.
- Notice the IP address assigned to the VM, this should be consistent with the network you stretched using HCX in a previous exercise.
- Notice the name of the Network this VM is connected to: OnPrem-workload-X-Y.
- (Optional) You can start a ping sequence to check the connectivity from your workstation to the VM’s IP address.
Step 2: Access HCX Interface
![Access HCX Interface](Mod2Task13Pic2.png)
- From the vCenter Server interface, click Menu.
- Click HCX.
You can also access the HCX interface by using its standalone interface (outside vCenter Server interface) by opening a browser tab to: https://10.X.Y.9, where X is your group number and Y is your participant number.
Step 3: Initiate VM Migration
![Initiate VM Migration](Mod2Task13Pic3.png)
- From the HCX interface click Migration in the left pane.
- Click MIGRATE.
Step 4: Select VMs for Migration
![Select VMs for Migration](Mod2Task13Pic4.png)
- Search for the location of your VM.
- Click the checkbox to select your VM named Workload-X-Y-1.
- Click ADD.
Step 5: Transfer and Placement of VM on Destination Site
![Transfer and Placement of VM on Destination Site](Mod2Task13Pic5.png)
Transfer and Placement options can be entered in 2 different ways:
- If you’ve selected multiple VMs to be migrated and all VMs will be placed/migrated with the same options, setting the options in the area with the green background will set the options for all VMs.
- To set the options individually per VM can be set and they can be different from each other.
- Click either GO or VALIDATE button. Clicking VALIDATE will validate that the VM can be migrated (This will not migrate the VM). Clicking GO will both validate and migrate the VM.
Use the following values for these options:
Option | Value |
---|
Compute Container | Cluster-1 |
Destination Folder | Discovered virtual machine |
Storage | vsanDatastore |
Format | Same format as source |
Migration Profile | vMotion |
Switchover Schedule | N/A |
Step 6: Monitor VM Migration
![Monitor VM Migration](Mod2Task13Pic6.png)
As you monitor the migration of your VM, keep an eye on the following areas:
- Percentage status of VM migration.
- Sequence of events as the migration occurs.
- Cancel Migration button (do not use).
Step 7: Verify Completion of VM Migration
![Verify Completion of VM Migration](Mod2Task13Pic7.png)
Ensure your VM was successfully migrated. You can also check for the VM in your AVS vCenter to Ensure it was migrated.
Exercice 2: Migration rollback
Step 1: Reverse Migration
![Reverse Migration](Mod2Task13Pic8.png)
VMware HCX also supports Reverse Migration, migrating from AVS back to on-premises.
Important
All migrations, including reverse migrations must be initiated from the on-premises site.- Click Reverse Migration checkbox.
- Select the Discovered virtual machine folder.
- Select your same virtual machine to migrate back to on-premises.
- Click ADD.
Use the following values for these options:
Option | Value |
---|
Compute Container | OnPrem-SDDC-Cluster-X-Y |
Destination Folder | OnPrem-SDDC-Datacenter-X-Y |
Storage | LabDatastore |
Format | Same format as source |
Migration Profile | vMotion |
Switchover Schedule | N/A |
The rest of the steps are similar to what you did on Step 5.
Step 2: Verify Completion of VM Migration
Verify that the VM is back running on the On-Premises vCenter.
14 - Module 2 Task 14
Task 14: Migrate a VM using HCX Replication Assisted vMotion
You will perform the instructions below from the On-premises VMware Environment
HCX Replication Assisted vMotion (RAV) uses the HCX along with replication and vMotion technologies to provide large scale, parallel migrations with zero downtime.
HCX RAV provides the following benefits:
- Large-scale live mobility: Administrators can submit large sets of VMs for a live migration.
- Switchover window: With RAV, administrators can specify a switchover window.
- Continuous replication: Once a set of VMs is selected for migration, RAV does the initial syncing, and continues to replicate the delta changes until the switchover window is reached.
- Concurrency: With RAV, multiple VMs are replicated simultaneously. When the replication phase reaches the switchover window, a delta vMotion cycle is initiated to do a quick, live switchover. Live switchover happens serially.
- Resiliency: RAV migrations are resilient to latency and varied network and service conditions during the initial sync and continuous replication sync.
- Switchover larger sets of VMs with a smaller maintenance window: Large chunks of data synchronization by way of replication allow for smaller delta vMotion cycles, paving way for large numbers of VMs switching over in a maintenance window.
HCX RAV Documentation
Migrate a VM using HCX vMotion
As you are more comfortable now with HCX components, some steps will be less documented to provide you with the opportunity to discover new side of this tool by yourself.
Prerequisites
First thing, we need to check that Replication Assisted vMotion Migration feature is enabled on each of the following:
- AVS HCX Manager Compute Profile
- On premises Compute Profile
- On premises Service Mesh
For example:
![Enable Replication Assisted vMotion Migration on Compute Profiles and Service Mesh](Mod2Task14Pic1.png)
If not enabled on one of the previous items, you need to:
- Edit the component
- Enable the Replication Assisted vMotion Migration capability
- Continue the wizard up to the Finish button (no other change is required)
- Click on Finish button to validate.
Note: Changes to the service mesh will require a few minutes to complete. You can look at Tasks tab to monitor the progress.
Exercise 1: Migrate VMs to AVS
Step 1: Initiate VMs migration
![Initiate VMs migration](Mod2Task14Pic2.png)
- From the HCX interface click Migration in the left pane.
- Click MIGRATE.
Step 2: Select VMs for Migration
- Search for the location of your VM.
- Click the checkbox to select your VM named Workload-X-Y-1 and Workload-X-Y-2.
- Click ADD.
Step 3: Transfer and Placement of VM on Destination Site
![Transfer and Placement of VM on Destination Site](Mod2Task14Pic3.png)
Use the following values for these options:
Option | Value |
---|
Compute Container | Cluster-1 |
Destination Folder | Discovered virtual machine |
Storage | vsanDatastore |
Format | Same format as source |
Migration Profile | Replication-assisted vMotion |
Switchover Schedule | N/A |
Click either GO or VALIDATE button. Clicking VALIDATE will validate that the VM can be migrated (This will not migrate the VM). Clicking GO will both validate and migrate the VM.
Step 4: Monitor VM Migration
As you monitor the migration of your VM, keep an eye on the following areas:
- Percentage status of VM migration.
- Sequence of events as the migration occurs.
- Cancel Migration button (do not use).
Step 5: Verify completion of VM Migration
![Verify Completion of VM Migration](Mod2Task14Pic4.png)
Ensure your VM was successfully migrated. You can also check for the VM in your AVS vCenter to Ensure it was migrated.
Exercice 2: Migration rollback
Step 1: Reverse Migration with switchover scheduling
VMware HCX also supports Reverse Migration, migrating from AVS back to on-premises.
Important
All migrations, including reverse migrations must be initiated from the on-premises site.- Click Reverse Migration checkbox.
- Select the Discovered virtual machine folder.
- Select your same virtual machines to migrate back to on-premises.
- Click ADD.
Use the following values for these options:
Option | Value |
---|
Compute Container | OnPrem-SDDC-Cluster-X-Y |
Destination Folder | OnPrem-SDDC-Datacenter-X-Y |
Storage | LabDatastore |
Format | Same format as source |
Migration Profile | Replication-assisted vMotion |
Switchover Schedule | Specify a 1hr maintenance window timeframe starting at least 15 minutes from now. |
![Reverse Migration with switchover scheduling](Mod2Task14Pic5.png)
The rest of the steps are similar to what you did on Step 5.
Step 2: Monitor a scheduled VM migration
After few minutes, Replication-assisted vMotion will start replicating virtual disks of the virtual machines to the destination.
When ready, the switchover will not happen before entering the maintenance window timeframe provided in the migration wizard. VM is still running on the source side. In the interval, replication will continue to synchronize disk changes to the target side.
![On going VM replication](Mod2Task14Pic6.png)
When the switchover scheduling is reached, the VM computation runtime, storage and network attachments will switch to the destination and the migration will complete with no downtime for the VM.
![VM switchover](Mod2Task14Pic7.png)
Note: The switchover may not happen as soon as we reach the maintenance window timeframe: it may take a few minutes to start.
After the switchover is completed, VM should be running in the destination.
![Completed switchover](Mod2Task14Pic8.png)
15 - Module 2 Task 15
Task 14: Observe the effects of extended L2 networks with and without MON
You will perform the instructions below from the On-premises VMware Environment
HCX L2 extended networks are virtual networks that span across different sites, allowing VMs to keep their IP addresses and network configuration when migrated or failed over.
HCX provides:
- HCX Network Extension: This service creates an overlay tunnel between the sites and bridges the L2 domains, enabling seamless communication and mobility of VMs.
- HCX Mobility Optimized Networking (MON): Improves network performance and reduces latency for virtual machines that have been migrated to the cloud on an extended L2 segment. MON provides these improvements by allowing more granular control of routing to and from those virtual machines in the cloud.
Observe the effects of extended L2 networks with and without MON
Prerequisites
Please migrate one of the workload VM to AVS side. You can select the migration method of your choice.
The VM needs to be migrated and powered-on to continue the Lab Task.
Assess the current routing path
From workstation, run a traceroute to get a view on current routing path.
From a windows command line, run: tracert IP_OF_MIGRATED_VM
Last network hop before the VM should be the On Prem routing device: 10.X.1Y.8.
Tracing route to 10.1.11.130 over a maximum of 30 hops
1 23 ms 23 ms 22 ms 10.100.199.5
2 * * * Request timed out.
3 23 ms 23 ms 23 ms 10.100.100.65
4 * * * Request timed out.
5 * * * Request timed out.
6 * * * 10.1.1.8 # <------- On Premises router
7 25 ms 24 ms 24 ms 10.1.11.130 # <------- Migrated VM
Step 1: Enable Mobility Optimized Networking on existing network extension
From HCX console, select the Network Extension menu and expand the existing extended network.
Then activate the Mobility Optimized Networking button.
![Enable Mobility Optimized Networking on existing network extension](Mod2Task15Pic1.png)
Accept the change by clicking on Enable when prompted for.
The change will take a few minutes to complete.
Step 4: Assess the current routing path after MON enablement
You can re-run a traceroute from jump server but no change to the routing path should be effective yet.
Step 5: Enable MON for the migrated VM
MON is effective at VM level, and so should be activated per VM (in an extended network where MON is already setup).
- From the Network Extension, and the expanded MON-enabled network, select the migrated VM.
- Select AVS side router location.
- Click on Submit.
![Enable MON for the migrated VM](Mod2Task15Pic2.png)
By default, MON redirect all the flow from the migrated VM to On Prem if they are matching RFC1918 subnets.
- In the Lab setup, this is also a reason for the migrated VM to be unreachable at this stage if we do not customize Policy Routes.
- In a real world scenario, not configuring Policy Routes, is often a reason of asymmetric traffic as incoming and outgoing traffic for/from the migrated VM could be not using the same path.
We will customize the Policy Routes to ensure that traffic for 10.0.0.0/8
will use the AVS side router location.
From the HCX console:
- Select the Network Extension menu, then the Advanced menu and the Policy Routes item.
- In the popup, remove the
10.0.0.0/8
network and validate the change. - Wait a minute for the change to propagate.
Step 7: Assess the current routing path after MON enablement at VM level
You can re-run a traceroute from workstation and analyze the result:
Tracing route to 10.1.11.130 over a maximum of 30 hops
1 23 ms 23 ms 22 ms 10.100.199.5
2 * * * Request timed out.
3 23 ms 23 ms 23 ms 10.100.100.65
4 * * * Request timed out.
5 * * * Request timed out.
6 24 ms 23 ms 23 ms 10.1.11.130 # <------- Migrated VM
There should be no 10.X.1Y.8
(as last hop) anymore as flow is directly routed by NSX to the target AVS VM with the help of a /32
static route set by HCX at the NSX-T T1 GW level.
16 - Module 2 Task 16
Task 15: Achieving a migration project milestone by cutting-over network extension
You will perform the instructions below from the On-premises VMware Environment
In a migration strategy, HCX L2 extended networks can be used to facilitate the transition of workloads from one site to another without changing their IP addresses or disrupting their connectivity. This can reduce the complexity and risks associated with reconfiguring applications, firewalls, DNS, and other network-dependent components.
Once a subnet is free from other resources On Premises, this is important to consider the last phase of the migration project: the network extension cutover.
This operation will provide a direct AVS connectivity for migrated workload, only relying on NSX-T components, and not anymore on the combination of HCX and On Premises network components.
In a large migration project, the cutover can be done network by network, based on the rhythm of workload migrations. When a subnet is free from On Premises resources, and firewall policies effective on AVS side, the cutover operation can be proceeded.
Achieving a migration project milestone by cutting-over network extension
Step 1: Migrate remaining workload to AVS
Ensure that all the On Premises workload attached to the extended network are migrated on AVS, except the router VM and the HCX-OnPrem-X-Y-NE-I1 appliance(s).
If not: migrate the VM to AVS.
Note: You can keep or remove MON on the extended network for the current exercice. It should not affect the end result.
Step 2: Start the network extension removal process
From HCX console, select the Network Extension menu. Select the Extended network and click on Unextend network.
![Start the network extension removal process](Mod2Task16Pic1.png)
In the next wizard, ensure that the Cloud Edge Gateway will be connected at the end of removal operation. Then submit.
![Cloud Edge Gateway will be connected](Mod2Task16Pic2.png)
You can proceed to the next step while the current operation is running.
Step 3: Shutdown On Premises network connectivity to the subnet
For the current lab setup, the On Premises connectivity to the migrated subnet is handled by a Static Route set on an NSX-T T1 gateway. We will remove this rule to simulate the end of BGP route advertising from On Premises.
On a real-world scenario, the change could be to shutdown a virtual interface on a router or a Firewall device to achieve the end of BGP route advertising for the subnet.
- Connect to NSX-T Manager console by using credentials from AVS SDDC Azure UI.
- Click on Networking tab, then Tier-1 Gateways section.
- Select the TNTXX-T1 gateway and start the edition of the component.
![Edit Tier-1 Static Routes](Mod2Task16Pic3.png)
- From the edit pane, click on the Static Routes link to edit this section (the number will vary depending on the number of effectives routes).
- Remove the route associated with your Lab based on its name and the target network.
![Remove Static Route for your lab](Mod2Task16Pic4.png)
- Validate the change.
- Monitor the process of the network extension removal on HCX.
Step 5: Network connectivity checks
When operation is ended, check the network connectivity to one of the migrated VM on the subnet.
You can use a ping from your workstation up to the VM IP address.
The connectivity should be ok.
Exercice 2: Rollback if needed!
Note: The following content is only there to provide guidance in case you need or choose to roll back the network setup to its previous configuration.
Step 1: Roll back changes
Running this step is not part of the Lab, except if you are facing issues.
If needed, network extension can be recreated, with same settings (especially the network prefix), and the route recreated to roll back a change.
To recreate the network extension, refer to the settings of Task 12.
If you need to recreate the static route on NSX-T, specify the following settings:
Option | Value |
---|
Name | Nested-SDDC-Lab-X-Y |
Network | 10.X.1Y.128/27 |
Next hop / IP address | 10.X.Y.8 |
Next hop / Admin Distance | 1 |
Next hop / Scope | Leave empty |
After the route re-creation, the connectivity via On Premises routing device should be restored to reach your workloads on the extended segment. You can roll back VM to On Premises too if needed.