Stay organized with collections Save and categorize content based on your preferences.

Adding a migration source

Before you start migrating, you create a migration source that represents the source platform from which you will be migrating. This source is added to your migration plan.

This topic describes how to create a source for each of the supported source platforms.

Before you begin

Source naming requirements

You assign a name to a migration source when you add it to Migrate to Containers. The name must meet the following requirements:

  • Contain at most 63 characters.
  • Contain only lowercase alphanumeric characters or "-" (hyphen).
  • Start with an alphanumeric character.
  • End with an alphanumeric character.

Adding a migration source

Define the migration source you're migrating from by running the migctl source create command or by using the Google Cloud console. This process adds details needed to migrate from the source you specify — VMware, AWS, Azure, Compute Engine, or on-premises.

migctl

Compute Engine

  1. Create a service account for using Compute Engine as a migration source and download the JSON key file, as described in Configuring a service account.

  2. Create the source using the service account:

    migctl source create ce my-ce-src --project my-project --json-key=m4a-ce-src.json

    Where m4a-ce-src.json specifies the service account.

VMware

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

Specify the:

You are prompted for the password for your Migrate to VMs management server.

AWS

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

Specify the:

You are prompted for the password for your Migrate to VMs management server.

Azure

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

Specify the:

You'll be prompted for the password for your Migrate to VMs management server.

migctl on Anthos on bare metal

VMware

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

Where:

  • --vc specifies the vCenter DNS name or vCenter IP address.
  • --username specifies a user that has permission to access the vCenter. You are prompted to enter the user's password.
  • --dc specified the vSphere datacenter for the local-vmware source. It is required in multi DC environments.

migctl on VMware

VMware

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

Where:

  • --vc specifies the vCenter DNS name or vCenter IP address.
  • --username specifies a user that has permission to access the vCenter. You are prompted to enter the user's password.
  • --dc specified the vSphere datacenter for the local-vmware source. It is required in multi DC environments.

migctl on AWS

AWS

  1. Create the 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

    Where:

    • --region specifies the Google Cloud region of your cluster.
    • --access-key-id specifies the AWS access key ID for a user that has permission to access AWS. You are prompted to enter the secret for the access key ID. See Managing access keys for IAM users for more.
    • --credentials-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.

CRD

  1. Create a SourceProvider my-source-provider.yaml file to create a migration source:

    apiVersion: anthos-migrate.cloud.google.com/v1beta2
    kind: SourceProvider
    metadata:
      name: my-ce-src
    spec:
      gce:
        project: my-project 
    
  2. If you are using Compute Engine as the migration source:

    1. Create a service account and download the JSON key file, as described in Configuring a service account.

    2. Create a secret named my-secret using the command:

      kubectl create secret generic my-secret -n v2k-system --from-file=cloud-platform-service-account-key=m4a-ce-src.json
    3. Include the secret in the SourceProvider:

      apiVersion: anthos-migrate.cloud.google.com/v1beta2
      kind: SourceProvider
      metadata:
       name: my-ce-src
      spec:
       gce:
         project: my-project
         serviceAccount:
           secretRef:
             name: my-secret
             namespace: v2k-system
  3. If you are performing a migration for AWS, Azure, or VMware, edit the SourceProvider to specify the following:

    apiVersion: anthos-migrate.cloud.google.com/v1beta2
    kind: SourceProvider
    metadata:
      name: migration-source-name
    spec:
      migrateForCE:
        management:
          address: manager-ip-address
          cloudDetails: 
            platform: aws | azure | vmware
            name: Name of the source, as configured in Migrate to VMs
          cloudExtension: ID or name of the Migrate to Containers extension
          password:
            <-- Password for your Migrate to VMs management server. --->
            secretRef:
              name: secret-name
              namespace: v2k-system
  4. If you are performing a migration on Anthos clusters on VMware, you must create a secret for the vCenter credentials, in the form:

    kubectl create secret generic secret-vcenter -n v2k-system --from-literal='vc-password=pass1'

    Then include the secretRef:

    apiVersion: anthos-migrate.cloud.google.com/v1beta2
    kind: SourceProvider
    metadata:
      name: my-ce-src
    spec:
      localVmware:
        address: 1.2.3.4
        username: admin
        password:
          secretRef:
            name: secret-vcenter        
            namespace: v2k-system
  5. If you are performing a migration on Anthos clusters on AWS, you must create a secret for the AWS credentials, in the form:

    kubectl create secret generic secret-aws -n v2k-system --from-literal='AwsAccessKeyId=admin' --from-literal='AWS_SECRET_ACCESS_KEY=pass1'

    Then include the secretRef:

    apiVersion: anthos-migrate.cloud.google.com/v1beta2
    kind: SourceProvider
    metadata:
      name: my-ce-src
    spec:
      localAws:
        # Google Cloud region of cluster.
        region: my-region
        accessKeyId: admin
        secretAccessKey:
          secretRef:
            name: secret-aws        
            namespace: v2k-system
  6. Apply the file:

    kubectl apply -f my-source-provider.yaml

Console

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

    Go to the Migrate to Containers page

  2. If you are using a remote Anthos cluster, meaning you are using Anthos clusters on VMware or Anthos clusters on AWS, and have not yet logged in to the cluster, log in now.

    For more on accessing remote clusters, see Logging in to a cluster from the Google Cloud console.

  3. Click the Sources tab to display a table containing the available sources.

  4. Click Add Source.

  5. Select a cluster where you have already installed the Migrate to Containers components from the drop-down list.

  6. Click Next.

  7. Specify the name of the source, such as my-ce-source1.

  8. Select the Source type.

  9. Click Next.

  10. Configure the source based on your selection for Source type:

    1. For Compute Engine:

      1. Select the project that contains the VM that you want to migrate.

      2. Select the service account. You can either:

        1. Create a new service account. You are prompted to enter the name of the new service account.
        2. Use an existing service account if you created one as described in Creating a service account for using Compute Engine as a migration source. When you select this option, you are prompted to enter the contents of the JSON key file associated with that service account.
    2. For VMware, AWS, and Azure:

      1. Specify the IP address or URL of the Migrate to VMs Manager.

      2. Specify the password of the Migrate to VMs Manager.

      3. Specify the name of the Migrate to VMs Extension.

      4. (AWS and Azure only) Specify the Cloud Details name, as configured in Migrate to VMs.

    3. For Local VMware:

      1. Specify the vCenter DNS name or vCenter IP address.

      2. Specify the user and password for a vCenter user that has permission to access the vCenter.

    4. For Local AWS:

      1. Specify the region of your cluster.

      2. Specify the AWS credentilas as either:

        • An access key ID and secret for a user that has permission to access AWS.
        • A credentials 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.
  11. Click Next.

  12. Select Add Source.

After you add the source, your cluster should have a new SourceProvider whose name is your source name, here my-vmware-src:

kubectl get SourceProvider
NAME                 STATE
my-vmware-src        READY

Viewing a list of sources

You can view the list of migration sources using the migctl source list command or the Google Cloud console to confirm that you've successfully configured your environment with the migration source.

migctl

migctl source list
NAME            TYPE    STATE   PROJECT     CLOUD-DETAILS   CLOUD-EXTENSION     VCENTER/MANAGER-ADDRESS
my-vmware-src   VMware  READY my-project  VMware        my-cloud-extension  1.2.3.4

Where VCENTER/MANAGER-ADDRESS specifies:

  • For Cloud migrations, the address of your Migrate to VMs management server.
  • For on-premises migrations, the vCenter DNS name or vCenter IP address.

If a source is not in the READY state, you can get more information about the source, including any error messages, by using the command:

migctl source status my-vmware-src

Console

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

    Go to the Migrate to Containers page

  2. Click the Sources tab to display a table containing the available sources. In the table VCENTER/MANAGER-ADDRESS specifies the address of your Migrate to VMs management server.

Adding Migrate to Virtual Machines as a migration source

Prepare Migrate to Virtual Machines as a migration source

To use Migrate to Virtual Machines 5.0 as a migration source, you must first enable the Migrate to Virtual Machines services and install the connector, as described in the following steps:

  1. Enabling Migrate to Virtual Machines services.
  2. Installing the Migrate Connector.

Specify the Migrate to Virtual Machines service account

To use Migrate to Virtual Machines as a migration source, create a service account with the vmmigration.admin role bound on the service project:

  1. Create the m2c-m4ce-src-service service account:

    gcloud iam service-accounts create m2c-m4ce-src-service  --project=PROJECT_ID
    
  2. Grant the vmmigration.admin role to the service account:

    gcloud projects add-iam-policy-binding PROJECT_ID  \
    --member="serviceAccount:m2c-m4ce-src-service@PROJECT_ID.iam.gserviceaccount.com" \
    --role="roles/vmmigration.admin"
    
  3. Download the key file for the service account:

    gcloud iam service-accounts keys create m2c-m4ce-src-service.json \
    --iam-account=m2c-m4ce-src-service@PROJECT_ID.iam.gserviceaccount.com \
    --project=PROJECT_ID
    

Specify the Migrate to Virtual Machines target project service account

To use Migrate to Virtual Machines as a migration source, create a service account with the compute.instanceAdmin.v1 and compute.storageAdmin roles bound on the target project:

  1. Create the m2c-m4ce-src-gce service account:

    gcloud iam service-accounts create m2c-m4ce-src-gce  --project=PROJECT_ID
    
  2. Grant the compute.instanceAdmin.v1 role to the service account:

    gcloud projects add-iam-policy-binding TARGET_PROJECT_ID  \
    --member="serviceAccount:m2c-m4ce-src-gce@PROJECT_ID.iam.gserviceaccount.com
    --role="roles/compute.instanceAdmin.v1"
    
  3. Grant the compute.storageAdmin role to the service account:

    gcloud projects add-iam-policy-binding TARGET_PROJECT_ID  \
    --member="serviceAccount:m2c-m4ce-src-gce@PROJECT_ID.iam.gserviceaccount.com" \
    --role="roles/compute.storageAdmin"
    
  4. Download the key file for the service account:

    gcloud iam service-accounts keys create m2c-m4ce-src-gce.json \
    --iam-account=m2c-m4ce-src-gce@PROJECT_ID.iam.gserviceaccount.com \
    --project=PROJECT_ID
    

After downloading the service account key as a JSON file, you can create a source for migrating Migrate to Virtual Machines workloads.

What's next

Linux

Windows

Tomcat

WebSphere (Pre-Ga)