Monitoring a migration

Use the migctl tool or the GCP Console to view the progress of a migration after executing the migration.

migctl

Listing migrations

When you have more than one migration in progress, you can view brief status for all of them at once by running migctl migration list.

migctl migration list

NAME                STATUS      CURRENT-OPERATION
my-migration        Completed   GenerateArtifacts
another-migration   Running     GenerateMigrationPlan

Getting status

Get the status of your migration with migctl migration status. When migration status show thats the migration has finished, you can move on to the next step in the migration.

migctl migration status my-migration

NAME            CURRENT-OPERATION       PROGRESS        STEP            STATUS  AGE
my-migration    GenerateArtifacts       [1/1]           ExtractImage    Running 12m2s

Getting verbose status

For a more detailed status, as well as events in the migration, along with warnings and errors, use the -v flag:

migctl migration status my-migration -v
apiVersion: anthos-migrate.cloud.google.com/v1beta2
kind: Migration
metadata:
annotations:
  anthos-migrate.cloud.google.com/initial-intent: Image
creationTimestamp: "2020-07-13T17:48:28Z"
generation: 1
labels:
  migration: 30ae4f80
  migration-name: my-migration
  migration-namespace: v2k-system
  migration-uid: 30ae4f80-fdb5-4049-95fc33926
name: my-migration
namespace: v2k-system
resourceVersion: "18992"
selfLink: /apis/anthos-migrate.cloud.google.com/v1beta2/namespaces/v2k-system/migrations/my-migration
uid: 30ae4f80-fdb5-4049-fc33926
spec:
osType: Windows
sourceSnapshot:
  sourceId: v2k-windows-test-2019
  sourceProvider: my-ce-src-win
status:
artifacts:
  deploymentFiles:
    bucket: velos-auto-1-migration-artifacts
    type: gcs
    windowsArtifactsFile: v2k-system-my-migration/artifacts.zip
currentOperation: GenerateArtifacts
currentOperationSubSteps:
- description: ExtractImage
  status: Completed
flowId: 30ae4f80
intent: Image
resources:
  sourceSnapshot:
    name: source-snapshot-3f80-fdb5-40499fc33926
    status:
      computeEngine:
        sourceDisks:
        - name: v2k-windows-test-2019
          zone: europe-west1-c
        volumes:
          v2k-windows-happy-flow-test-2019:
            copiedDisk:
              endTime: "2020-07-13T10:49:59.058-07:00"
              name: v2k-windows-test-2019-disk-9fdced96-e4f5-1f7a810e0
              operationName: operation-12535938-50d-72da2cc2-55a00121
              operationType: insert
              progress: 100
              startTime: "2020-07-13T10:48:56.458-07:00"
              status: DONE
              zone: europe-west1-b
            pvc:
              claimPhase: Bound
              created: false
              csiPvc: false
              name: v2k-windows-test-2019-disk-9fdced96-e4f5-81adf3435
            snapshot:
              endTime: "2020-07-13T10:48:53.835-07:00"
              name: v2k-windows-test-2019-europe-west1-c-snapedd80ddca
              operationName: operation-159466251458b7edd7-63d270b9-59daefff
              operationType: createSnapshot
              progress: 100
              startTime: "2020-07-13T10:48:35.264-07:00"
              status: DONE
      ready: true
  windowsDiscovery:
    name: windowsdiscovery-e4f80-fdb5-40d81a9fc33926
    status:
      discover:
        job:
          name: discover-51df463f-a4b7-4813d84a88b379
        status: Completed
      status: Completed
      windowsDiscoveryResult:
        name: windowsdiscovery-30f80-fdb50-d81a9fc33926
      windowsGenerateArtifacts:
        name: migrationplan-51df463f-a4b7-483d84a88b379
  windowsGenerateArtifacts:
    name: migrationplan-51df463f-a4b7-4851-a88b379
    task:
      name: my-migration-mpchq
      status:
        artifacts:
          artifactsZip: artifacts.zip
          repositoryBucket: velos-auto-1-migration-artifacts
          repositoryFolder: v2k-system-my-migration/
        extract:
          job:
            name: extract-9f-e6fc-c-9d251331770b
          status: Completed
        status: Completed
status: Completed
Events:
Type    Reason            Age    From                                          Message
----    ------            ----   ----                                          -------
Normal  SuccessfulCreate  10m    Job discover-92def542-e10b-4817-947b3a        Created pod: discover-92def542-e10b-4817-947b3a
Normal  Scheduled         10m    Pod discover-92def542-e10b-4817-949d-2fe0mlv  Successfully assigned v2k-system/discover-92def542-e10b-4817-949d to gke-smg-c
luster-nodepool-6ff-bkbx
Normal  Pulling           9m53s  Pod discover-92def542-e10b-4817-947b3a  Pulling image "eu.gcr.io/velos-auto-1/v2k-windows-discover:test3"
Normal  Pulled            6m20s  Pod discover-92def542-e10b-4817-947b3a  Successfully pulled image "eu.gcr.io/velos-auto-1/v2k-windows-discover:test3"
Normal  Created           6m20s  Pod discover-92def542-e10b-4817-947b3a  Created container discover-92def542-e10b-4817-949d-2fe0mlv
Normal  Started           6m9s   Pod discover-92def542-e10b-4817-947b3a  Started container discover-92def542-e10b-4817-949d-2fe0mlv

CRD

Use kubectl to get execution information and status by specifying a JSONPath to the necessary field.

  1. Get the migration operation:

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

    Returns GenerateArtifacts.

  2. Get the migration status:

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

    When the status shows that the operation has completed, you can move on to the next step.

Next Steps