Chapter 4. Migrating from OpenStack


Run your OpenStack migration plan from the MTV UI or from the command-line.

4.1. Prerequisites

  • You have planned your migration from OpenStack.

4.2. Running a migration plan in the MTV UI

You can run a migration plan and view its progress in the Red Hat OpenShift web console.

Prerequisites

  • Valid migration plan.

Procedure

  1. In the Red Hat OpenShift web console, click Migration for Virtualization > Migration plans.

    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.

  2. Click Start beside a migration plan to start the migration.
  3. Click Start in the confirmation window that opens.

    The plan’s Status changes to Running, and the migration’s progress is displayed.

    Warning

    Do not take a snapshot of a VM after you start a migration. Taking a snaphot after a migration starts might cause the migration to fail.

  4. 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
  5. Optional: To view your migration’s logs, either as it is running or after it is completed, perform the following actions:

    1. Click the Virtual machines tab.
    2. Click the arrow (>) to the left of the virtual machine whose migration progress you want to check.

      The VM’s details are displayed.

    3. 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.
    4. To see the raw logs, click the Raw link.
    5. To download the logs, click the Download link.

4.2.1. Migration plan options

On the Migration plans page of the Red Hat OpenShift web console, you can click the Options menu kebab 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.
  • Duplicate: 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: 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 is irreversible. However, you can duplicate an archived plan.

  • Delete: Permanently remove a migration plan. You cannot delete a running migration plan.

    Note

    Delete is irreversible.

    Deleting a migration plan does not remove temporary resources. To remove temporary resources, archive the plan first before deleting it.

    Note

    The results of archiving and then deleting a migration plan vary by whether you created the plan and its storage and network mappings using the CLI or the UI.

    • If you created them using the UI, then the migration plan and its mappings no longer appear in the UI.
    • If you created them using the CLI, then the mappings might still appear in the UI. This is because mappings in the CLI can be used by more than one migration plan, but mappings created in the UI can only be used in one migration plan.

4.2.2. 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

  1. In the Red Hat OpenShift web console, click Migration for Virtualization > Migration plans.
  2. Click the name of a running migration plan to view the migration details.
  3. Select one or more VMs and click Cancel.
  4. 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.

  5. Restart a canceled migration by clicking Restart beside the migration plan on the Migration plans page.

You can migrate from an OpenStack source provider by using the command-line interface (CLI).

Prerequisites

  • If you are using a user-defined network (UDN), note the name of its namespace as defined in OpenShift Virtualization.

Procedure

  1. Create a Secret manifest for the source provider credentials:

    $ cat << EOF | oc apply -f -
    apiVersion: v1
    kind: Secret
    metadata:
      name: <secret>
      namespace: <namespace>
      ownerReferences:
        - apiVersion: forklift.konveyor.io/v1beta1
          kind: Provider
          name: <provider_name>
          uid: <provider_uid>
      labels:
        createdForProviderType: openstack
        createdForResourceType: providers
    type: Opaque
    stringData:
      user: <user>
      password: <password>
      insecureSkipVerify: <"true"/"false">
      domainName: <domain_name>
      projectName: <project_name>
      regionName: <region_name>
      cacert: |
        <ca_certificate>
      url: <api_end_point>
    EOF

    where:

    ownerReferences
    Is an optional section in which you can specify a provider’s name and uid.
    <user>
    Specifies the OpenStack user.
    <password>
    Specifies the user OpenStack password.
    <"true"/"false">
    Specifies "true" to skip certificate verification, and specifies "false" to verify the certificate. Defaults to "false" if not specified. Skipping certificate verification proceeds with an insecure migration and then the certificate is not required. Insecure migration means that the transferred data is sent over an insecure connection and potentially sensitive data could be exposed.
    cacert
    Specifies the CA cert object. When this field is not set and skip certificate verification is disabled, MTV attempts to use the system CA.
    <api_end_point>
    Specifies the API endpoint URL, for example, https://<identity_service>/v3.
  2. Create a Provider manifest for the source provider:

    $ cat << EOF | oc apply -f -
    apiVersion: forklift.konveyor.io/v1beta1
    kind: Provider
    metadata:
      name: <source_provider>
      namespace: <namespace>
    spec:
      type: openstack
      url: <api_end_point>
      secret:
        name: <secret>
        namespace: <namespace>
    EOF

    where:

    <api_end_point>
    Specifies the URL of the API endpoint.
    <secret>
    Specifies the name of the provider Secret CR.
  3. Create a NetworkMap manifest to map the source and destination networks:

    $  cat << EOF | oc apply -f -
    apiVersion: forklift.konveyor.io/v1beta1
    kind: NetworkMap
    metadata:
      name: <network_map>
      namespace: <namespace>
    spec:
      map:
        - destination:
            name: <network_name>
            type: pod
          source:
            id: <source_network_id>
            name: <source_network_name>
        - destination:
            name: <network_attachment_definition>
            namespace: <network_attachment_definition_namespace>
            type: multus
          source:
            id: <source_network_id>
            name: <source_network_name>
      provider:
        source:
          name: <source_provider>
          namespace: <namespace>
        destination:
          name: <destination_provider>
          namespace: <namespace>
    EOF

    where:

    type
    Specifies the network type. Allowed values are pod and multus.
    source
    Specifies the source network. You can use either the id or the name parameter to specify the source network. For id, specify the OpenStack network UUID.
    <network_attachment_definition>
    Specifies a network attachment definition (NAD) for each additional OpenShift Virtualization network.
    <network_attachment_definition_namespace>
    Specifies the namespace of the OpenShift Virtualization NAD. Required only when type is multus.
    namespace
    Specifies the namespace. If you are using a user-defined network (UDN), its namespace is defined in OpenShift Virtualization.
  4. Create a StorageMap manifest to map source and destination storage:

    $ cat << EOF | oc apply -f -
    apiVersion: forklift.konveyor.io/v1beta1
    kind: StorageMap
    metadata:
      name: <storage_map>
      namespace: <namespace>
    spec:
      map:
        - destination:
            storageClass: <storage_class>
            accessMode: <access_mode>
          source:
            id: <source_volume_type>
      provider:
        source:
          name: <source_provider>
          namespace: <namespace>
        destination:
          name: <destination_provider>
          namespace: <namespace>
    EOF

    where:

    <access_mode>
    Specifies the access mode. Allowed values are ReadWriteOnce and ReadWriteMany.
    <source_volume_type>
    Specifies the OpenStack volume_type UUID. For example, f2737930-b567-451a-9ceb-2887f6207009.
  5. Optional: Create a Hook manifest to run custom code on a VM during the phase specified in the Plan CR:

    $  cat << EOF | oc apply -f -
    apiVersion: forklift.konveyor.io/v1beta1
    kind: Hook
    metadata:
      name: <hook>
      namespace: <namespace>
    spec:
      image: quay.io/kubev2v/hook-runner
      serviceAccount:<service account>
      playbook: |
        LS0tCi0gbm...
    EOF

    where:

    <service account>
    Specifies the Red Hat OpenShift service account. This is an optional label. Use the serviceAccount parameter to modify any cluster resources.
    playbook

    Specifies the Base64-encoded Ansible Playbook. If you specify a playbook, the image must include an ansible-runner.

    Note

    You can use the default hook-runner image or specify a custom image. If you specify a custom image, you do not have to specify a playbook.

  6. Enter the following command to create the network attachment definition (NAD) of the transfer network used for MTV migrations.

    You use this definition to configure an IP address for the interface, either from the Dynamic Host Configuration Protocol (DHCP) or statically.

    Configuring the IP address enables the interface to reach the configured gateway.

    $ oc edit NetworkAttachmentDefinitions <name_of_the_NAD_to_edit>
    apiVersion: k8s.cni.cncf.io/v1
    kind: NetworkAttachmentDefinition
    metadata:
      name: <name_of_transfer_network>
      namespace: <namespace>
      annotations:
        forklift.konveyor.io/route: <IP_address>
  7. Create a Plan manifest for the migration:

    $ cat << EOF | oc apply -f -
    apiVersion: forklift.konveyor.io/v1beta1
    kind: Plan
    metadata:
      name: <plan>
      namespace: <namespace>
    spec:
      provider:
        source:
          name: <source_provider>
          namespace: <namespace>
        destination:
          name: <destination_provider>
          namespace: <namespace>
      map:
        network:
          name: <network_map>
          namespace: <namespace>
        storage:
          name: <storage_map>
          namespace: <namespace>
      targetNamespace: <target_namespace>
      vms:
        - id: <source_vm1>
        - name: <source_vm2>
          hooks:
            - hook:
                namespace: <namespace>
                name: <hook>
              step: <step>
    EOF

    where:

    <plan>
    Specifies the name of the Plan CR.
    map
    Specifies only one network map and one storage map per plan.
    network
    Specifies a network mapping, even if the VMs to be migrated are not assigned to a network. The mapping can be empty in this case.
    <network_map>
    Specifies the name of the NetworkMap CR.
    storage
    Specifies a storage mapping, even if the VMs to be migrated are not assigned with disk images. The mapping can be empty in this case.
    <storage_map>
    Specifies the name of the StorageMap CR.
    vms
    Specifies the source VMs. Accepts either the id or the name parameter to specify the source VMs. If you are using a UDN, verify that the IP address of the provider is outside the subnet of the UDN. If the IP address is within the subnet of the UDN, the migration fails.
    <source_vm1>
    Specifies the OpenStack VM UUID.
    hooks
    Specifies up to two hooks for a VM. Each hook must run during a separate migration step. This is an optional label.
    <hook>
    Specifies the name of the Hook CR.
    <step>
    Specifies the type of hook. Allowed values are PreHook, before the migration plan starts, or PostHook, after the migration is complete.
  8. Create a Migration manifest to run the Plan CR:

    $ cat << EOF | oc apply -f -
    apiVersion: forklift.konveyor.io/v1beta1
    kind: Migration
    metadata:
      name: <name_of_migration_cr>
      namespace: <namespace>
    spec:
      plan:
        name: <name_of_plan_cr>
        namespace: <namespace>
      cutover: <optional_cutover_time>
    EOF
    Note

    If you specify a cutover time, use the ISO 8601 format with the UTC time offset, for example, 2024-04-04T01:23:45.678+09:00.

You can use the command-line interface (CLI) to cancel either an entire migration or the migration of specific virtual machines (VMs) while a migration is in progress.

You can use the command-line interface (CLI) to cancel an entire migration while a migration is in progress.

Procedure

  • Delete the Migration CR:

    $ oc delete migration <migration> -n <namespace>

    where:

    <migration>
    Specifies the name of the Migration CR.

You can use the command-line interface (CLI) to cancel the migration of specific virtual machines (VMs) while a migration is in progress.

Procedure

  1. Add the specific VMs to the spec.cancel block of the Migration manifest, following this example:

    $ cat << EOF | oc apply -f -
    apiVersion: forklift.konveyor.io/v1beta1
    kind: Migration
    metadata:
      name: <migration>
      namespace: <namespace>
    ...
    spec:
      cancel:
      - id: vm-102
      - id: vm-203
        name: rhel8-vm
    EOF

    where:

    id or name

    Specifies a VM by using the id key or the name key.

    The value of the id key is the managed object reference, for a VMware VM, or the VM UUID, for a Red Hat Virtualization VM.

  2. Retrieve the Migration custom resource (CR) to monitor the progress of the remaining VMs, following this example:

    $ oc get migration/<migration> -n <namespace> -o yaml
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top