migctl reference

migctl is a command-line tool for setting up and managing a Migrate for Anthos migration environment on Google Cloud:

For a step-by-step introduction to key migctl commands and to make a simple migration, see Quickstart.

migctl

Command Description
artifacts-repo Configure an artifacts rrepositoryepo
completion Generate bash completion scripts
docker-registry Configure a Docker registry
doctor Check Migrate for Anthos deployment status and related configuration
help Help about any command
migration Migration operations.
setup Install or uninstall Migrate for Anthos
source Manage references to the migration source.
version Print version for Migrate for Anthos, and for migctl

Synopsis

migctl [-h]

Flags

-h, --help
Help for this command.

Notes

migctl included in Cloud Shell

migctl artifacts-repo

Command Description
migctl artifacts-repo create Create an artifacts repository configuration.
migctl artifacts-repo update Update an artifacts repository configuration.
migctl artifacts-repo delete Delete an artifacts repository configuration.
migctl artifacts-repo list List the artifacts repository configurations.
migctl artifacts-repo set-default Set the default artifacts repository configuration.

See also

Defining data repositories

migctl artifacts-repo create

Create an artifacts repository configuration.

Synopsis

migctl artifacts-repo create gcs|s3|basic-auth repository-name flags

Positional arguments

repository-name

Name of the artifacts repository configuration.

Flags

-h, --help

Help for this command.

The remaining flags are based on the type of registry:

  • Cloud Storage

    migctl artifacts-repo create gcs repository-name --bucket-name bucket-name  --json-key=m4a-install.json

    where:

    • repository-name is the user-defined name of the artifacts repository configuration.

    • bucket-name specifies an existing bucket in the Cloud Storage repository. If you do not have an existing bucket, create on using the instructions at Creating storage buckets.

      Note: When installing Migrate for Anthos on clusters on Google Cloud, the Migrate for Anthos installer automatically creates a default bucket named:

      PROJECT-migration-artifacts

      Where PROJECT is your Google project ID. However, when installing Migrate for Anthos on an processing cluster or on Anthos clusters on AWS, no default bucket is created. You must create one yourself.

    • m4a-install.json is the name of the JSON key file for the service account for accessing Container Registry and Cloud Storage as described in Configuring a service account.

  • S3

    migctl artifacts-repo create s3 repository-name --bucket-name bucket-name --region aws-region --access-key-id=key-id

    You are prompted to enter the secret key for key-id.

    Alternatively, specify the path to a credentials file:

    migctl artifacts-repo create s3 repository-name --bucket-name bucket-name --region aws-region --credentials-file-path file-path 

    where:

    • repository-name is the user-defined name of the artifacts repository configuration.

    • bucket-name specifies an existing bucket in the S3 repository. If you do not have an existing bucket, create one using the instructions at Working with Amazon S3 Buckets.

    • aws-region specifies the AWS region for the repository. The processing cluster and the repository can be in separate regions as long as the cluster has permissions to access the repository.

    • key-id specifies the access key. See Managing access keys for IAM users for more.

    • file-path specifies the path to a CSV file, downloaded from the AWS console, containing the credentials. See Configuring AWS IAM groups and instance roles for more on creating the CSV file.

Examples

  • Cloud Storage

    migctl artifacts-repo create gcs myRepository --json-key=m4a-install.json
  • S3

    migctl artifacts-repo create s3 myRepository --bucket-name bucket-name --region aws-region --access-key-id=key-id

migctl artifacts-repo update

Update an artifacts repository configuration.

Synopsis

migctl artifacts-repo update gcs|s3|basic-auth repository-name same-flags-as-create

Positional arguments

repository-name

Name of the artifacts repository configuration.

Flags

same-flags-as-create

Specify the same flags for updating the registry configuration as you used to create it as shown in migctl artifacts-repo create above.

migctl artifacts-repo delete

Delete an artifacts repository configuration.

Synopsis

migctl artifacts-repo delete repository-name

Positional arguments

repository-name

Name of the artifacts repository configuration.

Flags

-h, --help

Help for this command.

migctl artifacts-repo list

List the currently configured repositories, including the current default.

Synopsis

migctl artifacts-repo list

Flags

-h, --help

Help for this command.

migctl artifacts-repo set-default

Sets the default artifacts repository, meaning the active registry used by the processing cluster.

Synopsis

migctl artifacts-repo set-default repository-name

Positional arguments

repository-name

Name of the artifacts repository configuration.

Flags

-h, --help

Help for this command.

migctl completion

Generate bash completion scripts.

To load completion run . <(migctl completion bash)

To configure your bash shell to load completions for each session, add the following to your ~/.bashrc or ~/.profile: . <(migctl completion bash)

Synopsis

migctl completion {bash | zsh}

Positional arguments

{bash | zsh}
The shell to use.

Flags

-h, --help
Help for this command.

migctl docker-registry

Command Description
migctl docker-registry create Create a Docker registry configuration.
migctl docker-registry update Update a Docker registry configuration.
migctl docker-registry delete Delete an artDocker registry configuration.
mmigctl docker-registry list List the Docker registry configurations.
migctl docker-registry set-default Set the default Docker registry configuration.

See also

Defining data repositories

migctl docker-registry create

Create a Docker registry configuration.

Synopsis

migctl docker-registry create gcr|ecr|basic-auth registry-name flags

Positional arguments

registry-name

Name of the Docker registry configuration.

Flags

-h, --help

Help for this command.

The remaining flags are based on the type of registry:

  • GCR

    migctl docker-registry create gcr registry-name --project project-id --json-key=m4a-install.json

    where:

    • registry-name is the user-defined name of the Docker registry configuration.

    • project-id is your Google project ID.

    • m4a-install.json is the name of the JSON key file for the service account for accessing Container Registry and Cloud Storage as described in Configuring a service account.

  • ECR

    migctl docker-registry create ecr registry-name --registry-path url --access-key-id=key-id

    You are prompted to enter the secret key for key-id.

    Alternatively, specify the path to a credentials file:

    migctl docker-registry create ecr registry-name --registry-path url --credentials-file-path file-path

    where:

    • registry-name is the user-defined name of the Docker registry configuration.

    • url specifies the URL of the registry path without the http:// or https:// prefix.

    • key-id specifies the access key. See Managing access keys for IAM users for more.

    • file-path specifies the path to a CSV file, downloaded from the AWS console, containing the credentials. See Configuring AWS IAM groups and instance roles for more on creating the CSV file.

  • Docker registry

    migctl docker-registry create basic-auth registry-name --registry-path url --username username --ca-pem-file ca-pem-filename

    where:

    • registry-name is the user-defined name of the Docker registry configuration.

    • url specifies the URL of the registry without the http:// or https:// prefix. For example, localhost:8080/myregistry.

    • username for the basic authentication credentials of the registry. You are prompted to enter the password.

    • If the registry uses a self-signed cert, ca-pem-filename specifies a PEM file containing either the public key or the complete CA chain, meaning a concatenation from the intermediate CA certificates up to the root certificate. For example:

      cat int1.pem int2.pem ... root.pem

Examples

  • GCR

    migctl docker-registry create gcr myRegistry --project myproject --json-key=m4a-install.json
  • ECR

    migctl docker-registry create ecr myRegistry --registry-path myexample.com/registry --access-key-id=key-id
  • Docker registry

    migctl docker-registry create basic-auth myRegistry --registry-path myexample.com/registry --username user1 --pass pass1

    If the registry uses a self-signed cert:

    migctl docker-registry create basic-auth myRegistry --registry-path myexample.com/registry --username user1 --pass pass1 --ca-file cert.pem

migctl docker-registry update

Update a Docker registry configuration.

Synopsis

migctl docker-registry update gcr|ecr|basic-auth registry-name same-flags-as-create

Positional arguments

registry-name

Name of the Docker registry configuration.

Flags

same-flags-as-create

Specify the same flags for updating the registry configuration as you used to create it as shown in migctl docker-registry create above.

migctl docker-registry delete

Delete a Docker registry configuration.

Synopsis

migctl docker-registry delete registry-name

Positional arguments

registry-name

Name of the Docker registry configuration.

Flags

-h, --help

Help for this command.

migctl docker-registry list

List the currently configured Docker registries, including the current default.

Synopsis

migctl docker-registry list

Flags

-h, --help

Help for this command.

migctl docker-registry set-default

Sets the default Docker registry, meaning the active registry used by the processing cluster.

Synopsis

migctl docker-registry set-default registry-name

Positional arguments

registry-name

Name of the Docker registry configuration.

Flags

-h, --help

Help for this command.

migctl doctor

Check Migrate for Anthos deployment status and related configuration.

Synopsis

migctl doctor

Flags

-h, --help
Help for this command.

See also

Installing Migrate for Anthos

Examples

Response for a functioning Migrate for Anthos deployment.

migctl doctor
[✓] Deployment

migctl help

Provide help on the migctl tool.

Use "migctl [command] --help" for more information about a command.

Synopsis

migctl --help

Flags

-h, --help
Help for this command.

migctl migration

Command Description
migration create Create a migration plan.
migration delete Delete a migration plan.
migration generate-artifacts Create artifacts for a given migration.
migration get Get a migration plan specification.
migration get-artifacts Get artifacts for the migration, such as Deployment/StatefulSet spec YAML and Dockerfile.
migration list List migrations.
migration status Get migration plan status.
migration update Update a migration plan.

migctl migration create

Create a migration plan.

A migration plan defines the specifics of the migration, including the source platform, VM ID, project name, and more.

The generated migration plan file is copied to the machine where the command is run -- it is not applied to the processing cluster. If you like, you can edit the file before using it in migration.

Synopsis

migctl migration create migration-name --source source-name --vm-id source-vm-id [--intent {ImageAndData | Image | Data}]  [--os-type type] [--no-comments] [--project project-name] [--zone source-vm-zone]

Positional arguments

migration-name
Name to give this migration.

Flags

-i, --intent {ImageAndData | Image | Data}
The aspect of the VM to migrate.
--no-comments
Generate YAML file without comments.
--os-type type
Specify the OS as Linux (default) or Windows.
-p, --project project-name
Override default Compute Engine source VM project.
-s, --source source-name
Name of the source created with migctl source create.
-v, --vm-id source-vm-id
Source VM ID. The form of this value varies depending on the source platform specified in source-name. See the command examples for more.
-z, --zone source-vm-zone
Override default Compute Engine source VM zone.
-h, --help
Help for this command.

Examples

Create a migration plan for Compute Engine VM, for both creating an image and exporting a data volume.

migctl migration create --source my-ce-src --vm-id my-id --intent ImageAndData

Create a migration plan for VMware VM for creating an image.

migctl migration create --source my-vmware-src --vm-id My_VMware_VM --intent Image

Create a migration plan for an AWS VM for exporting a data volume.

migctl migration create --source my-aws-src --vm-id i-1234567890abcdef0 --intent Data

See also

Creating a migration

migctl migration delete

Delete a migration plan.

This command deletes a migration you created with migctl migration create.

Synopsis

migctl migration delete migration-name 

Positional arguments

migration-name
Name of the migration to delete.

Flags

-h, --help
Help for this command.

migctl migration generate-artifacts

Create artifacts for a given migration.

For example, this command creates an image, data-volume, Dockerfile, deployment YAML, and more.

Synopsis

migctl migration generate-artifacts migration-name

Positional arguments

migration-name
Name of the migration for which to create artifacts.

Flags

-h, --help
Help for this command.

See also

Executing a migration

migctl migration get

Get a migration plan specification.

Synopsis

migctl migration get migration-name  [--output-file migration-yaml-file]

Positional arguments

migration-name
Name of the migration whose plan to get.

Flags

--output-file migration-yaml-file
Output YAML file of migration plan specification.
-h, --help
Help for this command.

migctl migration get-artifacts

Get artifacts for the migration, such as Deployment/StatefulSet spec YAML and Dockerfile.

Synopsis

migctl migration get-artifacts migration-name [--output-directory directory-path] [--overwrite]

Positional arguments

migration-name
The migration for which to get artifacts.

Flags

--output-directory directory-path
Output directory path. Default is "."
--overwrite
Overwrite existing local files.
-h, --help
Help for this command.

See also

Reviewing generated deployment files

migctl migration list

List migrations.

Synopsis

migctl migration list [--all-namespaces]

Flags

-A, --all-namespaces
List migrations across all namespaces.
-h, --help
Help for this command.

See also

Monitoring a migration

migctl migration status

Get migration plan status.

Synopsis

migctl migration status migration-name  [--verbose]

Positional arguments

migration-name
Name of the migration to get status for.

Flags

-v, --verbose
Verbose status.
-h, --help
Help for this command.

See also

Monitoring a migration

migctl migration update

Update a migration plan.

Synopsis

migctl migration update migration-name --file yaml-filename

Positional arguments

migration-name
Name of the migration to update.

Flags

--file yaml-filename
YAML file containing the updated migration plan.
-h, --help
Help for this command.

See also

Monitoring a migration

migctl setup

Command Description
setup install Install Migrate for Anthos on the current cluster.
setup uninstall Uninstall Migrate for Anthos from a cluster.
setup upgrade Upgrade Migrate for Anthos on a cluster.
setup proxy Configure an HTTPs proxy used by Migrate for Anthos.

migctl setup install

Install Migrate for Anthos on the current cluster.

Synopsis

migctl setup install [--cos-runtime] [--gkeop --json-key service-account-json] [--node-selectors string] [--tolerations string] [--version version-number]

Flags

--cos-runtime
Install runtime support on workload clusters with Container-Optimized OS nodes.
--gkeop
Install Migrate for Anthos for Anthos clusters on VMware.
--json-key service-account-json
JSON key file for the service account with the necessary permissions to install Migrate for Anthos for Anthos clusters on VMware. See Creating a service account for an migration for more.
--node-selectors string
Node selector for the components deployed by Migrate for Anthos in the form: LABEL1=VALUE1,LABEL2=VALUE2,..... See Installation options for more.
--tolerations string
Tolerations for the components deployed by Migrate for Anthos in the form: KEY1=VALUE1:EFFECT1,KEY2=VALUE2:EFFECT2,..... See Installation options for more.
--version version-number
Migrate for Anthos version to install.
-h, --help
Help for this command.

Examples

Install Migrate for Anthos on a processing cluster.

migctl setup install

Install runtime support on workload clusters with COS nodes.

migctl setup install --cos-runtime

See also

Installing Migrate for Anthos

migctl setup uninstall

Uninstall Migrate for Anthos from a cluster.

Synopsis

migctl setup uninstall [-f]

Flags

-f
Force uninstalling while migrations are in progress.
-h, --help
Help for this command.

Examples

Uninstall Migrate for Anthos.

migctl setup uninstall

Force uninstalling Migrate for Anthos while migrations are in progress.

migctl setup uninstall --force

See also

Uninstalling Migrate for Anthos

migctl setup upgrade

Upgrade Migrate for Anthos on a cluster.

Synopsis

migctl setup upgrade

Flags

--cos-runtime
Install runtime support on workload clusters with COS nodes.
--gcp-project string
Google Cloud project for uploading to Container Registry and Cloud Storage.
--gcp-region string
Google Cloud region for uploading to Cloud Storage.
--gke-on-aws
Install Migrate for Anthos on Anthos clusters on AWS.
--gkeop
Install Migrate for Anthos on Anthos clusters on VMware.
--json-key string
JSON key for the service account used for uploading to Container Registry and Cloud Storage.
--node-selectors string
node-selector for the components deployed by Migrate for Anthos in the format of LABEL1=VALUE1,LABEL2=VALUE2,...
--skip-validation
Override the cluster deployment validation.
--tolerations string
Tolerations for the components deployed by Migrate for Anthos in the form KEY1=VALUE1:EFFECT1,KEY2=VALUE2:EFFECT2,...
--version string
Migrate for Anthos version to install (default "1.7.5").
-h, --help
Help for this command.

Examples

Upgrade Migrate for Anthos to current version.

migctl setup upgrade

Upgrade Migrate for Anthos to a specific version.

migctl setup upgrade --version 1.7.0

Upgrade Migrate for Anthos on Anthos clusters on AWS.

migctl setup upgrade --gke-on-aws

See also

Upgrading Migrate for Anthos

migctl setup proxy

Configure a proxy server to access Migrate for Anthos repositories. Migrate for Anthos supports proxy requests over HTTPS only. HTTP is not supported.

When using an HTTPS proxy, Migrate for Anthos does not support self-signed certificates. You must use a signed cert with an HTTPS proxy.

Synopsis

migctl setup proxy --https-proxy proxy-address
    [--proxy-basic-authentication] [--no-proxy address] [--remove]

Flags

--https-proxy proxy-address
Specify the IP or proxy server address used to route requests, omitting the https:// prefix. If your proxy uses basic authentication, then you can include the username and password in proxy-address. For example:
user:password@proxy-address
Alternatively, you can use the --proxy-basic-authentication option to specify these values interactively in the console.
--no-proxy address
Specify an optional list of comma-separated IPs or domains where the proxy is not used.
--remove
Remove the proxy configuration.
--proxy-basic-authentication
If the proxy requires authentication, use this option to specify the username and password interactively. You are then prompted to enter the username and password required to access the proxy when you enter the command. Alternatively, you can use the --https-proxy option to specify these values as part of the proxy-address.
--h, --help
Help for this command.

Examples

To configure an HTTPS proxy with no authentication:

migctl setup proxy --https-proxy myproxy.com

To configure an HTTPS proxy and also specify domains where the proxy is not used:

migctl setup proxy --https-proxy myproxy.com --no-proxy localhost,mydomain.com

If the proxy uses basic authentication:

migctl setup proxy --https-proxy myproxy.com --proxy-basic-authentication

You are prompted to enter the username and password.

Or you can enter the credentials as part of the proxy-address:

migctl setup proxy --https-proxy user:pword@myproxy.com

To remove the proxy configuration:

migctl setup proxy --remove 

See also

Configuring an HTTPS proxy

migctl source

Perform operations related to a migration source.

Command Description
source create Add a migration source to the processing cluster.
source delete Delete a migration source from the processing cluster.
source list List migration source configurations in the processing cluster.

migctl source create

Add a migration source to the processing cluster.

Command Description
source create aws Add AWS as a migration source to the processing cluster.
source create azure Add Azure as a migration source to the processing cluster.
source create ce Add Compute Engine as a migration source.
source create local-aws Add AWS as a migration source to an AWS processing cluster.
source create local-vmware Add VMware as a migration source to an processing cluster.
source create vmware Add VMware as a migration source to the processing cluster.

See also

Adding a migration source

migctl source create aws

Add AWS as a migration source to the processing cluster.

Synopsis

migctl source create aws name --cloud-details cloud-details --manager-address manager-address --cloud-extension cloud-extension

Flags

-d, --cloud-details
Cloud Details name of the source, as configured in Migrate for Compute Engine
--cloud-extension
ID or name of the Migrate for Compute Engine Cloud Extension
--manager-address
Address of the Migrate for Compute Engine Manager server
-h, --help
Help for this command.

Examples

Add AWS as a migration source.

migctl source create aws my-aws-src--manager-address 1.2.3.4 --cloud-extension my-cloud-extension --cloud-details my-aws-cloud-details

See also

Adding a migration source

migctl source create azure

Add Azure as a migration source to the processing cluster.

Synopsis

migctl source create azure name --cloud-details cloud-details --manager-address manager-address --cloud-extension cloud-extension

Positional arguments

name
A name to give the source.

Flags

-d, --cloud-details cloud-details
Cloud Details name of the source, as configured in Migrate for Compute Engine
--cloud-extension cloud-extension
ID or name of the Migrate for Compute Engine Cloud Extension
--manager-address manager-address
Address of the Migrate for Compute Engine Manager server
-h, --help
Help for this command.

Examples

Add Azure as a migration source.

migctl source create azure my-azure-src--manager-address 1.2.3.4 --cloud-extension my-cloud-extension --cloud-details my-azure-cloud-details

See also

Adding a migration source

migctl source create ce

Add Compute Engine as a migration to the processing cluster.

Synopsis

migctl source create ce name --project project [--json-key service-account-json ]

Positional arguments

name
A name to give the source.

Flags

--project project
Default project for the Compute Engine source type.
--json-key service-account-json
JSON key file for the service account used to create the Compute Engine source. See Creating a service account for using Compute Engine as a migration source for more.
-h, --help
Help for this command.

Examples

Add Compute Engine as a migration source.

migctl source create ce my-ce-src --project myproject --zone us-west1-a

See also

Adding a migration source

migctl source create local-aws

Add AWS as a migration source to an AWS processing cluster.

Synopsis

migctl source create local-aws name --region region [--access-key-id key] [--credentials-file-path=credentials.csv] [flags]

Positional arguments

name
A name to give the source.

Flags

--region region
Specifies the Google Cloud region of your cluster.
--access-key-id key
The AWS access key ID for a user that has permission to access AWS. You must specify either --access-key-id or --credentials-file-path. You are prompted to enter the secret for the access key ID. See Managing access keys for IAM users for more.
--credentials-file-path credentials.csv
The path to a CSV file, downloaded from the AWS console, containing the credentials. You must specify either --access-key-id or --credentials-file-path. See Configuring AWS IAM groups and instance roles for more on creating the CSV file.
-h, --help
Help for this command.

Examples

Add AWS as a migration source.

migctl source create local-aws local-aws-src --region my-region --access-key-id my-access-key-id

or:

migctl source create local-aws local-aws-src --region my-region --credentials-file-path=credentials.csv

See also

Adding a migration source

migctl source create local-vmware

Add VMware as a migration source to a processing cluster.

Synopsis

migctl source create local-vmware name --vc vcenter --user user [flags]

Positional arguments

name
A name to give the source.

Flags

--vc host
Specifies the vCenter DNS name or vCenter IP address.
--username user
The username for a user that has permission to access the vCenter. You are prompted to enter the user's password.
-h, --help
Help for this command.

Examples

Add VMware as a migration source.

migctl source create local-vmware local-vmware-src --vc '1.2.3.4' --username 'admin'

See also

Adding a migration source

migctl source create vmware

Add VMware as a migration source to the processing cluster.

Synopsis

migctl source create vmware name --manager-address manager-ip --cloud-extension extension-name 

Positional arguments

name
A name to give the source.

Flags

--cloud-extension extension-name
ID or name of the Migrate for Compute Engine Cloud Extension.
--manager-address manager-ip
Address of the Migrate for Compute Engine management server
-h, --help
Help for this command.

Examples

Add VMware as a migration source.

migctl source create vmware my-vmware-src --manager-address 1.2.3.4 --cloud-extension my-cloud-extension

See also

Adding a migration source

migctl source delete

Delete a migration source from the processing cluster.

Synopsis

migctl source delete source-name [-f] 

Positional arguments

source-name
The name of the source to delete, meaning the name that you specified when you created the source with migctl source create.

Flags

-f
Ignore errors and force the deletion.
-h, --help
Help for this command.

Examples

Delete the migration source.

migctl source delete my-source

Attempt to force deletion of a source.

migctl source delete my-source -f

migctl source list

List migration source configurations in the processing cluster.

Synopsis

migctl source list

Flags

-h, --help
Help for this command.

migctl version

Print the version for Migrate for Anthos and for migctl.

Synopsis

migctl version

Flags

-h, --help
Help for this command.