Before you start migrating, you create a migration source that represents the source platform from which you will 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
Determine your workload's fit for migration by using the Linux discovery tool.
Complete the migration prerequisites specific to your migration:
Create a processing cluster specific to your migration:
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.
migctl on Google Cloud
Compute Engine
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.
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:
IP address or URL of the Migrate for Compute Engine Manager.
Specify the name of the Migrate for Compute Engine 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
Specify the:
IP address or URL of the Migrate for Compute Engine Manager.
Specify the Cloud Details name, as configured in Migrate for Compute Engine.
Specify the name of the Migrate for Compute Engine 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
Specify the:
IP address or URL of the Migrate for Compute Engine Manager.
Specify the Cloud Details name, as configured in Migrate for Compute Engine.
Specify the name of the Migrate for Compute Engine Extension.
You'll be prompted for the password for your Migrate for Compute Engine management server.
migctl on VMware
VMware
migctl source create local-vmware local-vmware-src --vc '1.2.3.4' --username 'admin'
Where:
--vc
specifies the vCenter DNS name or vCenter IP address.--username
specifies a user that has permission to access the vCenter. You will be prompted to enter the user's password.
migctl on AWS
AWS
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 GCP 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
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
If you are using Compute Engine as the migration source:
Create a service account and download the JSON key file, as described in Configuring a service account.
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
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
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 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
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
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: # GCP region of cluster. region: my-region accessKeyId: admin secretAccessKey: secretRef: name: secret-aws namespace: v2k-system
Apply the file:
kubectl apply -f my-source-provider.yaml
Console
Open the Migrate for Anthos page in the Cloud Console.
Click the Sources tab to display a table containing the available sources.
Click Add Source.
Select a cluster where you have already installed the Migrate for Anthos components from the drop-down list.
Click Next.
Specify the name of the source, such as
my-ce-source1
.Select the Source type.
Click Next.
Configure the source:
For Compute Engine:
Select the project that contains the VM that you want to migrate.
Select the service account. You can either:
- Create a new service account. You are prompted to enter the name of the new service account.
- 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.
For VMware, AWS, and Azure:
Specify the IP address or URL of the Migrate for Compute Engine Manager.
Specify the password of the Migrate for Compute Engine Manager.
Specify the name of the Migrate for Compute Engine Extension.
(AWS and Azure only) Specify the Cloud Details name, as configured in Migrate for Compute Engine.
Click Next.
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 for Compute Engine management server.
- For on-prem 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
Open the Migrate for Anthos page in the Cloud Console.
Click the Sources tab to display a table containing the available sources.
In the table
VCENTER/MANAGER-ADDRESS
specifies the address of your Migrate for Compute Engine management server.
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
- Begin creating a migration.