Migrate to Containers, formerly Migrate for Anthos (M4A), converts traditional workloads into containers for Kubernetes. It extracts application code, runtime, libraries, configuration, and other execution dependencies from a VM, often without requiring source-code changes or a complete rewrite. section 6.2.5 section 15.0
The generated artifacts include a container image, Dockerfile, deployment YAML, and persistent volumes. Kubernetes takes over common infrastructure functions, while the migration runtime and captured user-mode system form layers of the resulting image. Generated artifacts can run on Kubernetes-conformant distributions independently of the migration deployment. section 15.3.2
A migration proceeds through setup, migration, and optimization:
- Discover candidate workloads and prepare a cloud landing zone, including identity, networking, security, and billing. Create a processing cluster and define migration sources. section 15.3.1
- Create and review a migration plan, generate artifacts, and monitor progress. Test the artifacts before deploying the workload to the target environment. section 15.3.1 section 15.4.2
- Optimize the migrated workload and integrate it with practices such as CI/CD. Containerization does not require an immediate conversion to microservices. section 15.0 section 15.8
Candidates include stateless web frontends, multitier web stacks, middleware, databases, and bursty workloads. Assess dependencies and data placement before migration; workloads requiring particular drivers or legacy support may instead need VM migration and later manual refactoring. section 15.2 section 15.3.4
Migrate an Apache VM with the CLI
A Compute Engine VM running Apache can be migrated to GKE using a separate Kubernetes processing cluster. Create service accounts and grant the processing and source permissions, install the migration tool, and check it with migctl doctor. Register the Compute Engine source, create a migration, review its plan, generate and retrieve artifacts, then apply the deployment YAML and check the resulting service. section 15.4.2
migctl migration create my-migration --source http-source --vm-id http-server-demo --intent Image
This command creates the example migration from a registered Compute Engine source; replace the migration, source, and VM names for your environment. section 15.4.2
The Google Cloud console provides a comparable workflow: a processing cluster controls migration, artifacts are stored in Cloud Storage, and container images are pushed to Container Registry. In the documented console workflow, supported clusters are Google Cloud clusters rather than Anthos on AWS or VMware. section 15.4.3
Review generated configuration for operational dependencies. Use Kubernetes Services and DNS conventions for migrated applications, restrict frontend-to-backend access with NetworkPolicy, and manually add NFS persistent-volume directives because NFS mounts are not automatically migrated. section 15.5
For the documented Windows workflow, Compute Engine is the source; VMs from other environments can first be migrated or cloned there. The tool extracts the ASP.NET application and IIS configuration onto a Windows Server image, with stateless web and middleware tiers as suitable candidates. section 15.3.3 section 15.4.4
