Monitor a migration

Use the migctl tool or the Google Cloud console to view the progress of a migration after executing the migration.

migctl

List 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

Get status

Get the status of your migration with migctl migration status. When migration status show that 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

Get verbose status

For a more detailed status, and migration events, 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:
  kubectl.kubernetes.io/last-applied-configuration: |
    {"apiVersion":"anthos-migrate.cloud.google.com/v1beta2","kind":"Migration","metadata":{"annotations":{},"name":"my-migration","namespace":"v2k-system"},"spec":{"intent":"Image","osType":"Linux","sourceSnapshot":{"sourceId":"ub18-cloudimg-ref","sourceProvider":"my-onprem-src"}}}
creationTimestamp: "2020-07-07T11:39:35Z"
generation: 1
labels:
  migration: 6d6491
  migration-name: my-migration
  migration-namespace: v2k-system
  migration-uid: 6d644091-eaba-4-9fad46cc9ac8
name: my-migration
namespace: v2k-system
resourceVersion: "35454454"
selfLink: /apis/anthos-migrate.cloud.google.com/v1beta2/namespaces/v2k-system/migrations/my-migration
uid: 6d644091-eaba-4f74-6cc9ac8
spec:
intent: Image
osType: Linux
sourceSnapshot:
  sourceId: ub18-cloudimg-ref
  sourceProvider: my-onprem-src
status:
artifacts:
  deploymentFiles:
    artifactsManifestFile: v2k-system-my-migration/manifest.yaml
    bucket: velos-auto-1-migration-artifacts
    deploymentYaml: v2k-system-my-migration/deployment_spec.yaml
    dockerfile: v2k-system-my-migration/Dockerfile
    migrationFile: v2k-system-my-migration/migration.yaml
    type: gcs
  image: gcr.io/velos-auto-1/ub18-cloudimg-ref:v1.0.0
  imageBase: gcr.io/velos-auto-1/ub18-cloudimg-ref-non-runnable-base:v1.0.0
currentOperation: GenerateArtifacts
currentOperationSubSteps:
- description: ExtractImage
  status: Completed
- description: UploadImage
  status: Completed
- description: GenerateDeploymentFiles
  status: Completed
flowId: 6d644091
resources:
  generateArtifacts:
    name: generate-artifacts-flow-6d644091-4-bad4-9fad46cc9ac8
    status:
      completed: true
      deployment:
        artifactsManifestFile: v2k-system-my-migration/manifest.yaml
        deploymentYaml: v2k-system-my-migration/deployment_spec.yaml
        dockerfile: v2k-system-my-migration/Dockerfile
        migrationFile: v2k-system-my-migration/migration.yaml
        repositoryBucket: velos-auto-1-migration-artifacts
      image:
        extraction:
          copyProgress:
            copiedBytes: 1388683264
            sourceSizeBytes: 3659124736
          job:
            name: my-migration-task-export-job-ebd11e3e-6258-436e9cba969
          status: Completed
        upload:
          job:
            name: my-migration-task-image-upload-job-ebd11e3e-6253aca35
          status: Completed
  sourceSnapshot:
    name: source-snapshot-6d644091-eaba-4f74-46cc9ac8
    status:
      localVmware:
        cloneVm:
          create:
            cancelable: false
            cancelled: false
            endTime: "2020-07-07T11:40:44Z"
            error: ""
            finished: true
            id: task-18325
            name: CloneVM_Task
            progress: 0
            result: vm-1217
            startTime: "2020-07-07T11:40:42Z"
            state: success
            target: ub18-cloudimg-ref
        createPvcs:
        - claimPhase: Bound
          created: true
          csiPvc: false
          name: m4a-clone-eda18a2e-56cf-46ae-a129-db900c989a4218
          resourcePath: '[ds.23.0.131] m4a-clone-eda18a2e-56cf-46a1531441/m4a-clone-eda146ae-a129-db91441-000008.vmdk'
        - claimPhase: Bound
          created: true
          csiPvc: true
          name: v2k-csi-pvc-eda18a2e-56cf-46a9091531441
        createSnapshot:
          create:
            cancelable: false
            cancelled: false
            endTime: "2020-07-07T11:40:41Z"
            error: ""
            finished: true
            id: task-18324
            name: CreateSnapshot_Task
            progress: 0
            result: snapshot-1216
            startTime: "2020-07-07T11:40:40Z"
            state: success
            target: ub18-cloudimg-ref
      ready: true
status: Completed
Events:
Type     Reason                  Age                From                                                  Message
----     ------                  ----               ----                                                  -------
Normal   SuccessfulCreate        26m                Job my-migration-696gx-export-job-d99bb066-cb70-11ea  Created pod: my-migration-696gx-export-job-d99bb066-cb70-11ea
Warning  FailedScheduling        26m (x2 over 26m)  Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  pod has unbound immediate PersistentVolumeClaims (repeated 2 times)
Normal   Scheduled               26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Successfully assigned v2k-system/my-migration-696gx-export-job-d99b-cb70-11ea
6b3a5xcxd4 to gke-cluster-default-pool-8a1587ba
Normal   SuccessfulAttachVolume  26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  AttachVolume.Attach succeeded for volume "pvc-527e43c0-cb70-11ea-8166-42010a8401a9"
Normal   SuccessfulAttachVolume  26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  AttachVolume.Attach succeeded for volume "quickstart-instance-disk-5267c502-cb70-11ea-
8166-420fb4191f7d"
Normal   SuccessfulAttachVolume  26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  AttachVolume.Attach succeeded for volume "pvc-db74f143-cb70-11ea-8166-42010a8401a9"
Normal   SuccessfulMountVolume   26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  MapVolume.MapDevice succeeded for volume "quickstart-instance-disk-5267c502-cb70-11ea-
8166-420fb4191f7d" globalMapPath "/var/lib/kubelet/plugins/kubernetes.io/gce-pd/volumeDevices/quickstart-instance-disk-5267c502-cb70-11ea-8166-42010a8401a9"
Normal   SuccessfulMountVolume   26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  MapVolume.MapDevice succeeded for volume "quickstart-instance-disk-5267c502-cb70-11ea-
8166" volumeMapPath "/var/lib/kubelet/pods/db79e14e-cb70-11ea-8166/volumeDevices/kubernetes.io~gce-pd"
Normal   Pulling                 26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Pulling image "eu.gcr.io/my-proj/vls-runimg:test3"
Normal   Pulled                  26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Successfully pulled image "eu.gcr.io/my-proj/vls-runimg:test3"
Normal   Created                 26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Created container lister
Normal   Started                 26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Started container lister
Normal   Started                 26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Started container aggregator
Normal   Pulling                 26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Pulling image "eu.gcr.io/my-proj/v2k-init:test3"
Normal   Created                 26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Created container aggregator
Normal   Pulled                  26m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Successfully pulled image "eu.gcr.io/my-proj/v2k-init:test3"
Normal   Pulling                 25m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Pulling image "eu.gcr.io/my-proj/v2k-export:test3"
Normal   Pulled                  25m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Successfully pulled image "eu.gcr.io/my-proj/v2k-export:test3"
Normal   Created                 25m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Created container image-exporter
Normal   Started                 25m                Pod my-migration-696gx-export-job-d99bb066-cb70-11ea  Started container image-exporter
Normal   SuccessfulCreate        22m                Job my-migration-696gx-image-upload-job-d99bb066-cb70  Created pod: my-migration-696gx-image-upload-job-d99bb066-cb70-11c
Normal   Scheduled               22m                Pod my-migration-696gx-image-upload-job-d99bb066-cb70  Successfully assigned v2k-system/my-migration-696gx-image-upload-job-d99bb066-cb70-11c
db62e84c5q to gke-smg-cluster-default-pool-8a1587ba-p986
Normal   Created                 22m                Pod my-migration-696gx-image-upload-job-d99bb066-cb70  Created container image-uploader
Normal   Pulled                  22m (x2 over 22m)  Pod my-migration-696gx-image-upload-job-d99bb066-cb70  Container image "eu.gcr.io/my-proj/v2k-export:test3" already present on machi
ne
Normal   Started                 22m                Pod my-migration-696gx-image-upload-job-d99bb066-cb70  Started container image-uploader
Normal   Created                 22m                Pod my-migration-696gx-image-upload-job-d99bb066-cb70  Created container base-image-uploader
Normal   Started                 22m                Pod my-migration-696gx-image-upload-job-d99bb066-cb70  Started container base-image-uploader

Console

To monitor a migration using the Google Cloud console:

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

    Go to the Migrate to Containers page

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

  3. View the Status column in the row for the desired migration.

  4. Click the migration Name in the row for the desired migration. The migration Details tab opens. Click the Monitoring tab to see the status details, or the Events tab to see migration events.

CRD

Use kubectl to wait for the migration "my-migration" to contain the status condition of type "Ready".

kubectl wait -n v2k-system --for=condition=Ready migrations.anthos-migrate.cloud.google.com/my-migration

What's next