Monitoring a migration

You can use the migctl tool to view the progress of a migration after executing the migration.

Use the following commands to monitor:

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                STATE                      STATUS    PROGRESS   AGE
my-migration        waitingForImageExportJob   RUNNING   [6/12]     20m
another-migration   storeDeploymentArtifacts   RUNNING   [11/12]    24m

Getting brief status for a single migration

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           STATE                      STATUS    PROGRESS   AGE
my-migration   waitingForImageUploadJob   RUNNING   [12/15]    4m22s

Getting verbose status for a single migration

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

migctl migration status my-migration -v
Name:         my-migration
Namespace:    default
Labels:       
Annotations:  kubectl.kubernetes.io/last-applied-configuration:
                {"apiVersion":"anthos-migrate.cloud.google.com/v1beta1","kind":"Migration","metadata":{"annotations":{},"name":"my-migration","namespace":...
API Version:  anthos-migrate.cloud.google.com/v1beta1
Kind:         Migration
Metadata:
  Creation Timestamp:  2020-03-01T18:14:23Z
  Generation:          1
  Resource Version:    19563
  Self Link:           /apis/anthos-migrate.cloud.google.com/v1beta1/namespaces/default/migrations/my-migration
  UID:                 7a75680a-5be8-11ea-9e24-42010a800028
Spec:
  Artifacts:
    Deployment:
      App Name:     app-centos-mini
      Bucket:       my-project-migration-artifacts
      Path Prefix:  default-my-migration/
    Exclude Filters:
      - *.swp
      - /etc/fstab
      - /boot/
      - /tmp/*
      - /var/log/*
      - /var/cache/*
    Image:
      Base:  gcr.io/my-project/centos-mini-non-runnable-base:v1.0.0
      Filters:
        
      Name:  gcr.io/my-project/centos-mini:v1.0.0
  Source:
    Vmware:
      Run Mode:            TestClone
      Storage Class Name:  my-vmware-src
      Vm Id:               centos-mini
Status:
  Progress:  [6/12]
  State:     waitingForImageExportJob
  Status:    RUNNING
  Steps:
    Name:    enforceRetainReclamationPolicy
    Status:  COMPLETED
    Name:    createStreamingPvc
    Status:  COMPLETED
    Name:    createScratchPvc
    Status:  COMPLETED
    Name:    createImageExportConfigMap
    Status:  COMPLETED
    Name:    createImageExportJob
    Status:  COMPLETED
    Name:    waitingForImageExportJob
    Status:  RUNNING
    Name:    deleteImageExportJob
    Status:  PENDING
    Name:    createImageUploadJob
    Status:  PENDING
    Name:    waitingForImageUploadJob
    Status:  PENDING
    Name:    deleteImageUploadJob
    Status:  PENDING
    Name:    storeDeploymentArtifacts
    Status:  PENDING
    Name:    cleanup
    Status:  PENDING
Events:
  Type     Reason            Age                  From                  Message
  ----     ------            ----                 ----                  -------
  Warning  FailedScheduling  24m (x801 over 19h)  migration-controller  my-migration-export-job-7a75680a-5be8-11ea-9e24-42010a800028 - pod has unbound immediate PersistentVolumeClaims (repeated 3 times)

Watching for status updates

You can use the status command's -w flag to launch a console prompt that displays new status messages as they become available.

$ migctl migration status my-migration -w
NAME           AGE
my-migration   20m

Next Steps