Note:
- This tutorial requires access to Oracle Cloud. To sign up for a free account, see Get started with Oracle Cloud Infrastructure Free Tier.
- It uses example values for Oracle Cloud Infrastructure credentials, tenancy, and compartments. When completing your lab, substitute these values with ones specific to your cloud environment.
Migrate VMs from an On-Premises VMware Environment to OCI Compute VMs using Oracle Cloud Migrations
Introduction
The Oracle Cloud Migrations service provides an end-to-end, comprehensive, self-service experience to migrate virtual machines (VMs) from on-premises environments to Oracle Cloud Infrastructure (OCI). Oracle Cloud Migrations enables you to perform the following tasks:
-
Automatically discover virtual machines
-
Perform analysis of migration candidates
-
Replicate the data to OCI Object Storage
-
Launch the VMs as OCI Compute instances using the replicated data
The Oracle Cloud Migrations workflow is based on the following phases:
-
Discovery: In this phase an Oracle Cloud Bridge (OCB) virtual appliance, deployed in the on-premises environment performs discovery of VM assets in the source environment.
-
Inventory: The Discovery is followed by the Inventory phase, where information about the discovered Virtual Machines is extracted & stored. This includes OS, Hardware & Utilization information regarding the collected assets.
-
Assessment and Planning: Once the Inventory is available, we move to the Assessment and Planning phases to create the migration project and plan. The assets to be migrated are added to the plan in this phase.
-
Replication: Replication of the nominated assets is initiated in this step. The OCB appliance is responsible for the replication of the VMs to OCI Object Storage.
-
Execution & Migration: On successful completion of the VM replication, we migrate the assets to the target OCI environment and validate the migration assets.
-
Cut-over and Cleanup: Once the migrated assets have been verified, we mark the project as complete and proceed with deletion of the migration project plan.
Objectives
- Configure the Oracle Cloud Migrations service to migrate VMs from an on-premises VMware environment and vSphere environment to OCI Compute VMs.
Prerequisites
-
Access to an active OCI tenancy, which will be the target environment.
-
A compartment in the tenancy. This can be a new or existing compartment.
-
To manage Oracle Cloud Migrations and the necessary components within the selected compartment, it is crucial to have the appropriate policies and permissions established. For more information about the required OCI IAM policies, see Creating Pre-requisites and policies and On-prem vCenter roles and permissions.
-
Supported vSphere environment (6.5, 6.7 and 7.0). Supported vSphere versions and Operating Systems. For more information, see Supported vSphere versions and Operating systems..
-
Provide agent dependency, which is a 3rd party package required by remote agent appliance for its function. Oracle Cloud Migrations replication function running on the remote agent appliance depends on the appropriate VMware Virtual Disk Development Kit (VDDK) agent to perform the snapshot operations on the VMware VM disk. This can be downloaded from theVMware portal. For more information and download links for vSphere VDDK, see vSphere VDDK.
-
Create a private OCI Object Storage bucket in the OCI tenancy, to store the source asset snapshots.
-
Create a vault to store the credentials used by the Oracle Cloud Migrations Service.
Task 1: Configure OCI Object Storage
OCI Object Storage will be used to store the replicated VM data by Oracle Cloud Migrations service from an on-premises environment.
-
Create a private OCI Object Storage bucket in the OCI tenancy. Go to the navigation menu, Storage, Buckets, and click Create bucket.
-
Enter the following information.
- Bucket Name: Enter a bucket name.
- Default storage Tier: Select Standard.
- Encryption: Select Encrypt using Oracle managed keys.
- Click Create Bucket.
-
Upload the previously downloaded VDDK to this bucket.
Task 2: Configure OCI Vault
OCI Vault will be used to store the vSphere credentials used by Oracle Cloud Migrations service to communicate with vSphere environment.
-
Go to Identity and Security, Vault, Create Vault.
-
Select a compartment, Vault name and click Create Vault.
-
Once the vault is created click the newly created vault to create the master encryption key.
-
Click Master Encryption Keys, Create key, select the right compartment and provide the key name. Click Create key.
-
Now, create secret to store the credentials. Click Secrets and Create secrets.
-
Enter the following information for the secret.
- Create in Compartment: Select compartment.
- Name: Enter a secret name.
- Description: Enter a description.
- Encryption Key: Select the encryption key created in the previous step.
- Secret Type Template: Select Plain-text.
- Secret contents: Enter the VC username and password in this format. For example,
{"username":"VC Oracle Cloud Migrations user name","password":"password"}
.
Task 3: Set up the Oracle Cloud Migrations service in OCI
In this task, we will set up Oracle Cloud Migrations service in our tenancy to enable the migration and configure the required components.
-
Log in to the OCI Console, navigate to Migration & Disaster Recovery, Cloud Migrations and click Remote connections.
-
We need to create a source environment in the selected compartment for Oracle Cloud Migrations. We have already configured the policies as part of the Prerequisites. As the name suggests, this is needed to define the source location for the migration assets. The source environment contains the set of external resources grouped physically or logically.
Click Create Source environment, enter the Name and make sure you select the correct compartment.
-
Once the source environment is ready, click the environment name.
-
In the Source environment details page, click Download agent VM to download the OCB agent. The agent will be deployed in the on-premises vSphere environment.
-
Configure the agent dependency VDDK in source environment.
-
Click the source environment and Access Agent dependencies.
-
Click Create agent Dependency, select select from object storage and Compartment name.
-
Enter a Name for the agent dependency, Dependency type as VDDK, and select import from an object storage bucket.
-
Note the bucket where we uploaded the VDDK in Prerequisites and select the VDDK dependency from the same bucket and click create.
-
-
Deploy the OCB agent.
-
Deploy Open Virtual Appliance (OVA) in the network which has access to your vCenter network and DNS name resolution.
-
You must have two network adapters attached to the OCB agent VM.
-
One adapter should have access to the management components vCenter, ESXi host and other network adapter should have access to Internet and OCI tenancy.
Note: For more information about OCB agent connectivity, see Network connectivity in External Enviornment.
-
-
Deploy the OCB agent OVA in the source vCenter server and enter the configuration details. You assign this OVA IP manually or by DHCP As well. This OCB agent is the medium to establish the connection between Oracle Cloud Migrations service and on-premises vCenter server.
-
Once the OCB agent is deployed, make sure that its network is reachable to the OCI tenancy. For example, if the tenancy is in Frankfurt region then to verify the connectivity to this region we need to deploy a separate Linux or Windows VM in same network and use the
curl
command:curl-v https://cloudbridge.eu-frankfurt-1.oci.oraclecloud.com/
,curl -v https://cloudmigration.eu-frankfurt-1.oci.oraclecloud.com/, https://auth.eu-frankfurt-1.oraclecloud.com/
.This test will make sure that your OCB agent is having the connectivity to the OCI tenancy and region where it must be registered.
-
Let us register the OCB agent with OCI tenancy.
- Log in to the OCI tenancy.
- Go to Cloud migrations, Remote connections, Source environments and click Register agent.
- Click Register agent.
- Enter the OCB agent host name or IP address.
- Click Registration. For more information, see OCB Registration..
-
Once the OCB agent is registered with your OCI tenancy, verify the health of your OCB agent and its components.
- Navigate to Migration & Disaster Recovery, Cloud migrations and click Remote connections.
- Select the source environment created in Task 1.2.
- Verify the remote connection agents State is Active and Heartbeat is Healthy.
-
Click the remote connections agent name and verify the status of the listed Plugins Discovery, Gomon, and replication health. It should be in active state.
Task 4: Point your Oracle Cloud Migrations Service to vCenter and Fetch the On-Premises VM Details
-
To create asset source, navigate to Cloud migrations, Discovery, Asset sources and click Create Asset Source.
-
Enter the relevant information like asset source information, Name, vCenter endpoint in this format
https://vcenter-FQDN:443/sdk
. You need to make sure you use VC FQDN name instead of VC IP address otherwise migration might fail. -
In the Remote connection source environment section, enter the source and target compartment. The compartment in which virtual machine inventory will be stored.
- The target compartment details where the virtual machines will be created during the migration.
- Select the source and target compartment.
- In Discovery credentials, select Use existing secret.
- Enter vault and secret keys created in the Prerequisites section.
- This secret key and credentials will allow the Oracle Cloud Migrations service to interact with your VC.
-
Once the asset source is created, click the newly created asset source name and verify the Replication and Discovery connection state it should be in active. Click Run Discovery.
-
At this point, the OCB agent will fetch the VM information from the on-premises environment and list them under assets on the same page.
Or
You can view the list of the discovered virtual machines in Asset source details page. Navigate to Migration & Disaster Recovery, Cloud migrations, Discovery and click Asset source details.
Once the list has been verified we can confirm that the on-premises VM inventory details have been pulled by the Oracle Cloud Migrations service.
We will now proceed to create the migration project and plan.
Task 5: Create the Migration Project and Plan
In order to proceed with the migration, we first need to create the migration project and plan as per your migration strategy. For example, we will decide the order of operation as per specific application requirements. This will reflect in the migration plan.
Note: At this point, we can decide to create a simple project or create a comprehensive project and plan. For this tutorial, we will use the simple migration project and create the plan separately.
-
Go to Cloud migrations, Migrations, Create migration project and click Create a simple migration project.
-
Enter a name for your new migration project, select the required compartment and click Create.
-
In the Migration project details page, you will see your newly created project. Click the name to open the details and configuration page.
-
In the Migration plans section, click Create migration plan to proceed with details of your migration project.
-
In the Create migration plan page, enter the following information.
- Display Name: Enter a migration plan name.
- Compartment Name: Select the compartment.
- Target Compartment: In case the final placement of resources is different from source compartment.
- Strategies: Select Resource type.
- Target environment information: Select VCN and subnet.
-
Once all the information has been provided and verified, click Create migration plan.
Note: The strategies allow for selection of an as-is migration by default or you can choose if your workload is CPU intensive or memory intensive.
-
Once the migration plan is successfully created, you will see the name of the newly created plan on your screen. Click the migration plan name to add details.
-
Under the Resources section, click Migration assets and Add migration assets.
-
In the Add assets from OCM inventory page, click Add from OCM Inventory to select the discovered assets.
-
Select the virtual machines that you want to add to this migration plan. Once all required VMs are selected from the list, click Add migration assets.
-
Verify the selected list. Once the assets have been verified, click Next.
-
In the Replication location page, select the Volume availability domain, Replication compartment and Replication bucket from the Default replication location section. Once all information has been checked, click Select.
-
Click Submit to complete the wizard.
-
-
Once the assets have been added, they will appear on the migration plan window under Migration assets. At this point, we will select the VM(s) for replication. Under Migration assets, select the required virtual machines and click Actions and Replicate to initiate the replication process.
-
The replication job will start and can be tracked under Cloud migrations, Migration projects, Work Requests and Work request details.
-
In addition to checking the status of the replication in the OCI Console, we can also track the progress in vCenter server.
-
Log in to vCenter and select the source virtual machines, Monitor and Tasks.
-
We will be able observe that Oracle Cloud Migrations service has started taking snapshot for this virtual machine. This will be removed once the replication is complete.
-
-
Once the replication is complete, we can see the VM in Migration plan details and Target assets.
We will observe here that Oracle Cloud Migrations has selected recommended shapes for the VM on the basis of original configuration. For example, CPU, RAM and Storage.
Note: Task 3.10 to 3.13 are optional and should be followed in case you want to modify the target virtual machine configuration.
-
In case, there is a requirement to change the configuration of the VM in OCI, we can make the modification from the OCI Console. We can change the Availability domain, Compartment, VCN or Compute Shape for the VM.
-
Go to Migration projects, click the migration project name, Migration plan details, Target Assets and select the target assets. Click the ellipsis icon and select Configure.
-
In the Configure target asset page, enter the following configuration for the selected virtual machine and click Configure.
- Instance display name: Enter a display name.
- Compartment: Enter the compartment.
- VM Configuration: Select On-demand capacity, Preemptible capacity, Capacity reservation or Dedicated host.
- Shape type: Select Use system recommendation or Select preferred shape. For more information, see OCI Instance Capacity Types.
- Network: Enter VCN, Subnet and Public IP Address.
- Storage: Select Block Volume Size and Performance.
Task 6: Create and Run the RMS Stack
As replication has been completed, now we have the required volumes of the VM and metadata of the target in OCI Object Storage.
To create the instance from this data in OCI we need to generate the Resource Manager Stack (RMS). This will create the new instance from the replicated data of the original on-premises VM in the OCI tenancy. With the help of the RMS stack, we can provision the instances from replicated VM’s data and we can verify the costing of this instance from the same page.
-
Go to Migration projects, click the migration project name, Migration project plan, select your current migration plan and click Generate RMS Stack.
-
Once the stack is created, you are ready to deploy it. Click Deploy RMS Stack.
-
To verify the creation of the VM, go to Compute, instances and check the status of the newly created VM deployed as part of this migration.
-
Access the migrated VM from OCI Console or Cloud Shell console or you can also RDP if it is a Windows server and verify if everything is ok.
Task 7: Mark the Migration Project as Complete
Once the selected assets are migrated and validation is complete, we need to mark the project as complete. This will block the migration modules to resync again with the source environment.
-
Navigate to Migration, Cloud Migrations, Migrations, and Migration Project details.
-
Select the migration project name, select the migration plan and click Mark migration complete.
Note: To restart the same migration plan which we marked as complete above, repeat Task 5.2.
Related Links
Acknowledgments
- Author - Ravindra Kumar (Cloud VMware Solutions Specialist)
More Learning Resources
Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.
For product documentation, visit Oracle Help Center.
Migrate VMs from an On-Premises VMware Environment to OCI Compute VMs using Oracle Cloud Migrations
F79991-03
August 2024