SourceProvider CRD

Apply a SourceProvider .yaml to create a migration source.

When you apply a Migration .yaml to create a migration resource, you must specify the name of the SourceProvider in the Migration .yaml.

See Adding a migration source for examples on creating a SourceProvider .yaml for different migration sources.

The SourceProvider .yaml has the following format:

Compute Engine

Use for an existing VM on Google Cloud

apiVersion: anthos-migrate.cloud.google.com/v1beta2
kind: SourceProvider
metadata:
  name: migration-source-name
spec:
  gce:
    project: project-name
    <-- See below for more on this service account. --->
    serviceAccount:
      secretRef:
        name: secret-name
        namespace: v2k-system

AWS/Azure/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 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

Anthos clusters on VMware

apiVersion: anthos-migrate.cloud.google.com/v1beta2
kind: SourceProvider
metadata:
  name: migration-source-name
spec:
  localVmware:
    address: vCenter-DNS-or-IP
     < -- The username for a user that has permission to access the vCenter. --->
    username: username
    password:
      secretRef:
        < -- The password for the user that has permission to access the vCenter. --->
        name: secret-name
        namespace: v2k-system

Anthos clusters on AWS

apiVersion: anthos-migrate.cloud.google.com/v1beta2
kind: SourceProvider
metadata:
name: migration-source-name
spec:
localAws:
  region: aws-region
  < -- The username for a user that has permission to access AWS. --->
  accessKeyId: access-key-id
  secretAccessKey:
    secretRef:
      < -- The password for the user that has permission to access AWS. --->
      name: secret-name
      namespace: v2k-system

MigrateForCE

Use for migrate from VMware using MigrateForCE 5.0 service


apiVersion: anthos-migrate.cloud.google.com/v1beta2
kind: SourceProvider
spec:
gce:
  project: TARGET-PROJECT
  <-- See below for more on this service account. --->
  serviceAccount:
    secretRef:
      name: secret-name
      namespace: v2k-system
remoteSourceSpec:
  migrateForCEService:
    location:SERVICE-LOCATION
    project: SERVICE-PROJECT
    replicatingVMDefaults:
      targetProject: TARGET-PROJECT
      zone: TARGET-ZONE
     <-- See below for more on this service account. --->
    serviceAccount:
      secretRef:
        name: REFERENCE-TO-EXISTING-SECRET
        namespace: v2k-system
    sourceName: SOURCE-NAME

Migrating from Compute Engine

You must create a service account with the necessary permissions. See Creating a service account for using Compute Engine as a migration source for more.

You then create the secret using the command:

kubectl create secret generic secret-name -n v2k-system --from-file=cloud-platform-service-account-key=path-to-json-key-file