Executing a migration

You begin migrating VMs with a command that generates target container artifacts and extracts them using the processing cluster you created in Installing Migrate to Containers.

This topic describes how to execute a migration to generate a migration zip file with the extracted application files, settings, and Dockerfile.

Once this step has completed, you'll be able to:

  • Use the migration artifacts in the zip file to build a container image.
  • Deploy the image to your GKE cluster.

Before you begin

To succeed, you should have first done the following:

Executing the migration and generating artifacts

Use the migctl migration generate-artifacts command or the GCP Console to generate the target container artifacts as part of processing a VM for migration.

migctl

migctl migration generate-artifacts my-migration

CRD

  1. Get the name of the AppXGenerateArtifactsFlow using the name specified in the Migration yaml when you created the migration:

    kubectl get migrations.anthos-migrate.cloud.google.com -n v2k-system my-migration  -o jsonpath={.status.migrationPlanRef.name}

  2. Create an AppXGenerateArtifactsTask my-generate.yaml file to define a generate artifacts task.

    In this file, migration specifies the migration name when you created the migration, and flow represents the AppxGenerateArtifactsFlow of the migration which you got on previous step:

    apiVersion: anthos-migrate.cloud.google.com/v1beta2
    kind: AppXGenerateArtifactsTask
    metadata:
     name: my-migration-task
     namespace: v2k-system
    spec:
     migration:
       name:  my-migration
     flow:
       name: appx-generateartifactsflow-my-migration
  3. Apply the file:

    kubectl apply -f my-generate.yaml

Console

  1. Open the Migrate to Containers page in the console.

    Go to the Migrate to Containers page

  2. Click the Migrations tab to display a table containing the available migrations.

  3. In the row for the desired migration, select Generate artifacts in the Next steps dropdown.

  4. View the status of a migration by:

    • Viewing the Status column for the row for your migration.

    • Clicking the migration Name. The migration Details tab opens. Click the Monitoring tab to see the status details, or the Events tab to see migration events.

When you generate artifacts for Windows workloads, Migrate to Containers writes the artifacts to a zip file and then uploads the zip file to a Cloud Storage bucket. This zip file contains:

  • Dockerfile -- The Dockerfile used to build the image for your migrated VM.
  • deployment_spec.yaml -- The YAML file that configures your workload.

    You can use kubectl apply with this file to deploy the workload to a cluster, such as a production or test cluster.

  • Several directories and files that are extracted from the source and used by the Dockerfile.

Next Steps