Chapter 8. Migrating virtual machines from OpenStack 8.1. Adding an OpenStack source provider You can add an OpenStack source provider by using the Red Hat OpenShift web console. Important When you migrate an image-based VM from an OpenStack provider, a snapshot is created for the image that is attached to the source VM and the data from the snapshot is copied over to the target VM. This means that the target VM will have the same state as that of the source VM at the time the snapshot was created. Procedure In the Red Hat OpenShift web console, click Migration Providers for virtualization . Click Create Provider . Click OpenStack . Specify the following fields: Provider resource name : Name of the source provider. URL : URL of the OpenStack Identity (Keystone) endpoint. For example, http://controller:5000/v3 . Authentication type : Choose one of the following methods of authentication and supply the information related to your choice. For example, if you choose Application credential ID as the authentication type, the Application credential ID and the Application credential secret fields become active, and you need to supply the ID and the secret. Application credential ID Application credential ID : OpenStack application credential ID Application credential secret : OpenStack application credential Secret Application credential name Application credential name : OpenStack application credential name Application credential secret : OpenStack application credential Secret Username : OpenStack username Domain : OpenStack domain name Token with user ID Token : OpenStack token User ID : OpenStack user ID Project ID : OpenStack project ID Token with user Name Token : OpenStack token Username : OpenStack username Project : OpenStack project Domain name : OpenStack domain name Password Username : OpenStack username Password : OpenStack password Project : OpenStack project Domain : OpenStack domain name Choose one of the following options for validating CA certificates: Use a custom CA certificate : Migrate after validating a custom CA certificate. Use the system CA certificate : Migrate after validating the system CA certificate. Skip certificate validation : Migrate without validating a CA certificate. To use a custom CA certificate, leave the Skip certificate validation switch toggled to left, and either drag the CA certificate to the text box or browse for it and click Select . To use the system CA certificate, leave the Skip certificate validation switch toggled to the left, and leave the CA certificate text box empty. To skip certificate validation, toggle the Skip certificate validation switch to the right. Optional: Ask MTV to fetch a custom CA certificate from the provider's API endpoint URL. Click Fetch certificate from URL . The Verify certificate window opens. If the details are correct, select the I trust the authenticity of this certificate checkbox, and then, click Confirm . If not, click Cancel , and then, enter the correct certificate information manually. Once confirmed, the CA certificate will be used to validate subsequent communication with the API endpoint. Click Create provider to add and save the provider. The provider appears in the list of providers. Optional: Add access to the UI of the provider: On the Providers page, click the provider. The Provider details page opens. Click the Edit icon under External UI web link . Enter the link and click Save . Note If you do not enter a link, MTV attempts to calculate the correct link. If MTV succeeds, the hyperlink of the field points to the calculated link. If MTV does not succeed, the field remains empty. 8.2. Adding an OpenShift Virtualization destination provider You can use a Red Hat OpenShift Virtualization provider as both a source provider and destination provider. Specifically, the host cluster that is automatically added as a OpenShift Virtualization provider can be used as both a source provider and a destination provider. You can also add another OpenShift Virtualization destination provider to the Red Hat OpenShift web console in addition to the default OpenShift Virtualization destination provider, which is the cluster where you installed MTV. You can migrate VMs from the cluster that MTV is deployed on to another cluster, or from a remote cluster to the cluster that MTV is deployed on. Prerequisites You must have an OpenShift Virtualization service account token with cluster-admin privileges. Procedure In the Red Hat OpenShift web console, click Migration Providers for virtualization . Click Create Provider . Click OpenShift Virtualization . Specify the following fields: Provider resource name : Name of the source provider URL : URL of the endpoint of the API server Service account bearer token : Token for a service account with cluster-admin privileges If both URL and Service account bearer token are left blank, the local OpenShift cluster is used. Choose one of the following options for validating CA certificates: Use a custom CA certificate : Migrate after validating a custom CA certificate. Use the system CA certificate : Migrate after validating the system CA certificate. Skip certificate validation : Migrate without validating a CA certificate. To use a custom CA certificate, leave the Skip certificate validation switch toggled to left, and either drag the CA certificate to the text box or browse for it and click Select . To use the system CA certificate, leave the Skip certificate validation switch toggled to the left, and leave the CA certificate text box empty. To skip certificate validation, toggle the Skip certificate validation switch to the right. Optional: Ask MTV to fetch a custom CA certificate from the provider's API endpoint URL. Click Fetch certificate from URL . The Verify certificate window opens. If the details are correct, select the I trust the authenticity of this certificate checkbox, and then, click Confirm . If not, click Cancel , and then, enter the correct certificate information manually. Once confirmed, the CA certificate will be used to validate subsequent communication with the API endpoint. Click Create provider to add and save the provider. The provider appears in the list of providers. 8.3. Selecting a migration network for an OpenShift Virtualization provider You can select a default migration network for an OpenShift Virtualization provider in the Red Hat OpenShift web console to improve performance. The default migration network is used to transfer disks to the namespaces in which it is configured. If you do not select a migration network, the default migration network is the pod network, which might not be optimal for disk transfer. Note You can override the default migration network of the provider by selecting a different network when you create a migration plan. Procedure In the Red Hat OpenShift web console, click Migration > Providers for virtualization . Click the OpenShift Virtualization provider whose migration network you want to change. When the Providers detail page opens: Click the Networks tab. Click Set default transfer network . Select a default transfer network from the list and click Save . 8.4. Creating a migration plan Use the Red Hat OpenShift web console to create a migration plan. Specify the source provider, the virtual machines (VMs) you want to migrate, and other plan details. Warning Do not include virtual machines with guest-initiated storage connections, such as Internet Small Computer Systems Interface (iSCSI) connections or Network File System (NFS) mounts. These require either additional planning before migration or reconfiguration after migration. This prevents concurrent disk access to the storage the guest points to. Important A plan cannot contain more than 500 VMs or 500 disks. Procedure In the Red Hat OpenShift web console, click Plans for virtualization and then click Create Plan . The Create migration plan wizard opens to the Select source provider interface. Select the source provider of the VMs you want to migrate. The Select virtual machines interface opens. Select the VMs you want to migrate and click . The Create migration plan pane opens. It displays the source provider's name and suggestions for a target provider and namespace, a network map, and a storage map. Enter the Plan name . To change the Target provider , the Target namespace , or elements of the Network map or the Storage map , select an item from the relevant list. To add either a Network map or a Storage map , click the + sign anf add a mapping. Click Create migration plan . MTV validates the migration plan, and the Plan details page opens, indicating whether the plan is ready for use or contains an error. The details of the plan are listed, and you can edit the items you filled in on the page. If you make any changes, MTV validates the plan again. Check the following items in the Settings section of the page: Transfer Network : The network used to transfer the VMs to OpenShift Virtualization, by default, this is the default transfer network of the provider. Verify that the transfer network is in the selected target namespace.To edit the transfer network, click the Edit icon, choose a different transfer network from the list in the window that opens, and click Save . You can configure an OpenShift network in the OpenShift web console by clicking Networking > NetworkAttachmentDefinitions . To learn more about the different types of networks OpenShift supports, see Additional Networks in OpenShift Container Platform . If you want to adjust the maximum transmission unit (MTU) of the OpenShift transfer network, you must also change the MTU of the VMware migration network. For more information see Selecting a migration network for a VMware source provider . Target namespace : Destination namespace to be used by all the migrated VMs, by default, this is the current or active namespace. To edit the namespace, click the Edit icon, choose a different target namespace from the list in the window that opens, and click Save . If your plan is valid, you can do one of the following: Run the plan now by clicking Start migration . Run the plan later by selecting it on the Plans for virtualization page and following the procedure in Running a migration plan . 8.5. Running a migration plan You can run a migration plan and view its progress in the Red Hat OpenShift web console. Prerequisites Valid migration plan. Procedure In the Red Hat OpenShift web console, click Migration Plans for virtualization . The Plans list displays the source and target providers, the number of virtual machines (VMs) being migrated, the status, the date that the migration started, and the description of each plan. Click Start beside a migration plan to start the migration. Click Start in the confirmation window that opens. The plan's Status changes to Running , and the migration's progress is displayed. Warm migration only: The precopy stage starts. Click Cutover to complete the migration. Optional: Click the links in the migration's Status to see its overall status and the status of each VM: The link on the left indicates whether the migration failed, succeeded, or is ongoing. It also reports the number of VMs whose migration succeeded, failed, or was canceled. The link on the right opens the Virtual Machines tab of the Plan Details page. For each VM, the tab displays the following data: The name of the VM The start and end times of the migration The amount of data copied A progress pipeline for the VM's migration Warning vMotion, including svMotion, and relocation must be disabled for VMs that are being imported to avoid data corruption. Optional: To view your migration's logs, either as it is running or after it is completed, perform the following actions: Click the Virtual Machines tab. Click the arrow ( > ) to the left of the virtual machine whose migration progress you want to check. The VM's details are displayed. In the Pods section, in the Pod links column, click the Logs link. The Logs tab opens. Note Logs are not always available. The following are common reasons for logs not being available: The migration is from OpenShift Virtualization to OpenShift Virtualization. In this case, virt-v2v is not involved, so no pod is required. No pod was created. The pod was deleted. The migration failed before running the pod. To see the raw logs, click the Raw link. To download the logs, click the Download link. 8.6. Migration plan options On the Plans for virtualization page of the Red Hat OpenShift web console, you can click the Options menu beside a migration plan to access the following options: Edit Plan : Edit the details of a migration plan. If the plan is running or has completed successfully, you cannot edit the following options: All properties on the Settings section of the Plan details page. For example, warm or cold migration, target namespace, and preserved static IPs. The plan's mapping on the Mappings tab. The hooks listed on the Hooks tab. Start migration : Active only if relevant. Restart migration : Restart a migration that was interrupted. Before choosing this option, make sure there are no error messages. If there are, you need to edit the plan. Cutover : Warm migrations only. Active only if relevant. Clicking Cutover opens the Cutover window, which supports the following options: Set cutover : Set the date and time for a cutover. Remove cutover : Cancel a scheduled cutover. Active only if relevant. Duplicate Plan : Create a new migration plan with the same virtual machines (VMs), parameters, mappings, and hooks as an existing plan. You can use this feature for the following tasks: Migrate VMs to a different namespace. Edit an archived migration plan. Edit a migration plan with a different status, for example, failed, canceled, running, critical, or ready. Archive Plan : Delete the logs, history, and metadata of a migration plan. The plan cannot be edited or restarted. It can only be viewed, duplicated, or deleted. Note Archive Plan is irreversible. However, you can duplicate an archived plan. Delete Plan : Permanently remove a migration plan. You cannot delete a running migration plan. Note Delete Plan is irreversible. Deleting a migration plan does not remove temporary resources. To remove temporary resources, archive the plan first before deleting it. 8.7. Canceling a migration You can cancel the migration of some or all virtual machines (VMs) while a migration plan is in progress by using the Red Hat OpenShift web console. Procedure In the Red Hat OpenShift web console, click Plans for virtualization . Click the name of a running migration plan to view the migration details. Select one or more VMs and click Cancel . Click Yes, cancel to confirm the cancellation. In the Migration details by VM list, the status of the canceled VMs is Canceled . The unmigrated and the migrated virtual machines are not affected. You can restart a canceled migration by clicking Restart beside the migration plan on the Migration plans page.

Commands: