Adding a migration source

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

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

Before you begin

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-prem. For example, for platforms such as AWS and Azure, you'll provide Cloud Details you created when you set up Migrate for Compute Engine.

GKE 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

You'll be prompted for the password for your Migrate for Compute Engine management server.

AWS

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

You'll be prompted for the password for your Migrate for Compute Engine management server.

Azure

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

You'll be prompted for the password for your Migrate for Compute Engine management server.

GKE on-prem migctl

VMware

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

Where:

  • --vc specifies the vCenter DNS name or vCenter IP address.
  • --username and --password specifies the credentials for a user that has permission to access the vCenter.

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=gcp-sa=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:

    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 for Compute Engine
          cloudExtension: ID or name of the Migrate for Anthos extension
          password:
            <-- Password for your Migrate for Compute Engine management server. --->
            secretRef:
              name: secret-name
              namespace: v2k-system
  4. If you are performing an on-prem migration, 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. Apply the file:

    kubectl apply -f my-source-provider.yaml

Console

  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.

    If you did not create the service account, you can create it below in the Google Cloud Console when creating the migration source.

  2. Open the Migrate for Anthos page in the Cloud Console.

    Go to the Migrate for Anthos page

  3. Click Add Source.

  4. Select a cluster where you have already installed the Migrate for Anthos components from the drop-down list.

  5. Click Next.

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

  7. Set the Source type to Compute Engine.

  8. Click Next.

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

  10. 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. When you select this option, you are prompted to enter the contents of the m4a-ce-src.json file. Open m4a-ce-src.json in an editor, then copy and paste the file content here.
  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        CREATED

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 source list
NAME            TYPE    STATE   PROJECT     CLOUD-DETAILS   CLOUD-EXTENSION     VCENTER/MANAGER-ADDRESS
my-vmware-src   VMware  CREATED my-project  VMware          my-cloud-extension  1.2.3.4

Where VCENTER/MANAGER-ADDRESS specifies:

  • For Cloud migrations, the address of your Migrate for Compute Engine management server.
  • For on-prem migrations, the vCenter DNS name or vCenter IP address.

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

migctl source status my-vmware-src

Deleting a source

You can use migctl source delete to delete the source if you want to make a change and create it again. If you run

migctl source delete my-vmware-src

Next Steps