sodcalculator

10 Tech How-To

Migrate AI Workloads from Failing GPU Cloud Without Downtime

Guide 10-38333 · Updated · Step by step

This guide walks you through moving your AI training and inference workloads from a GPU cloud that is experiencing failures to a healthy provider, with zero service interruption. You’ll learn how to prepare, execute the migration in phases, and verify everything works—all while keeping your models serving requests continuously.

What You’ll Need

  • Access to the failing cloud’s dashboard and API (to snapshot data and monitor health).
  • Credentials for the target GPU cloud (create an account and set up billing beforehand).
  • A container registry (e.g., Docker Hub, AWS ECR, or a private registry) to store your model images.
  • An object storage bucket (S3, GCS, or Azure Blob) for model weights and datasets—ideally one that both clouds can access.
  • CLI tools installed: docker, kubectl (if using Kubernetes), and the cloud CLIs for both providers.
  • Your model definitions and training scripts in a version-controlled repository (e.g., Git).

Step-by-Step

  1. Assess the failure scope. Check the failing provider’s status page and your instances’ metrics. Determine whether it’s a single node, a region, or a full outage. This decides how fast you must move.
  2. Set up the target environment. In the new cloud, create a project, enable GPU quotas, and spin up a small test instance to verify that your drivers, CUDA version, and libraries work. Note the instance type and region that best match your workload.
  3. Snapshot your current state. Take a snapshot of your running instances (if the API allows) and back up all code, model weights, and datasets to object storage. Use rsync or cloud-native sync tools. Ensure the backup is complete and restorable before proceeding.
  4. Containerize your workload. If not already containerized, create a Dockerfile that installs your dependencies and copies your code. Build the image and push it to a container registry. This makes it portable across clouds.
  5. Set up the target infrastructure. In the new cloud, create a GPU instance (or a Kubernetes cluster) with the same or better specs. Configure networking, security groups, and environment variables. Pull your container image and run a quick smoke test (e.g., load the model and run a single inference) to confirm it works.
  6. Prepare for zero-downtime switching. Use a load balancer or DNS that can route traffic between the old and new endpoints. If you have a single endpoint, set up a reverse proxy (like NGINX) that can switch upstream servers. For Kubernetes, use a Service and update the selector.
  7. Migrate data incrementally. If you have a live dataset, start syncing it to the new cloud’s storage in the background. Use tools like rclone or cloud-to-cloud transfer. For inference, ensure the model weights are identical on both sides.
  8. Switch traffic gradually. Move a small percentage of traffic to the new endpoint (e.g., 5%) and monitor for errors, latency, and accuracy. If all looks good, increase the percentage over a few minutes or hours. For training, pause new jobs on the old cloud and start them on the new one.
  9. Validate and cut over. Once 100% of traffic is on the new cloud, run a full validation suite: test all endpoints, check logs, and verify that the model outputs match expected results. Then, decommission the old instances to stop costs.
  10. Monitor post-migration. Keep an eye on the new cloud’s performance for at least 24 hours. Set up alerts for GPU utilization, memory, and error rates. Have a rollback plan in case the new environment underperforms.

Common Mistakes

  • Not testing the new environment before switching. Skipping the smoke test can lead to runtime errors that surprise you during the cutover.
  • Assuming identical GPU specs. Different cloud providers may offer the same GPU name but with different memory bandwidth or drivers. Always re-benchmark.
  • Forgetting to sync environment variables and secrets. Hardcoded credentials or paths will break in the new cloud.
  • Switching all traffic at once. A sudden spike in errors can take down your service entirely. Gradual traffic shifting is safer.
  • Not backing up before starting. If the failing cloud dies completely during migration, you lose everything if you haven’t snapshotted.

Tips

  • Use a multi-region strategy. Even after migration, consider running active-active across two clouds to avoid a single point of failure.
  • Automate the migration with Infrastructure-as-Code. Use Terraform or CloudFormation to define your target environment, so you can recreate it quickly if needed.
  • Keep your container images small. Use multi-stage builds to reduce pull time, which speeds up the migration.
  • Use a global load balancer. Services like Cloudflare or AWS Global Accelerator can route traffic based on health checks, making failover automatic.
  • Document every step. You’ll need it for post-mortem and for future migrations.

Troubleshooting

  • New cloud instance fails to start. Check the instance logs for driver or CUDA errors. Rebuild the image with the correct CUDA version for the new GPU. Verify that the GPU is actually attached (e.g., nvidia-smi).
  • Model accuracy drops after migration. This is rare but can happen if the new GPU has different floating-point behavior (e.g., TF32 vs FP32). Re-run a calibration dataset and compare outputs. If needed, adjust precision settings.
  • Latency spikes during traffic shift. The new instance may be under-provisioned or the network path is slower. Scale up the instance or use a closer region. Check if the load balancer is properly distributing traffic.
  • Data sync is too slow. Use parallel transfers or enable compression. If the dataset is huge, consider using a physical transfer appliance (like AWS Snowball) but that’s not zero-downtime—so plan ahead.
  • Old cloud dies before cutover. If you have a snapshot and container image, you can start fresh on the new cloud. If not, you’ll have to rebuild from your Git repo and object storage—this is why backups are critical.

Frequently Asked Questions

Can I migrate without a container registry?

Yes, but it’s much harder. You’d have to copy the entire filesystem, which is slow and error-prone. Containers make the process repeatable and portable.

How long does the migration take?

It depends on your data size and network speed. A small model with a few GB of weights can take minutes; a multi-TB dataset might take hours. Plan for at least a few hours.

Will my users notice any downtime?

If you use a load balancer and shift traffic gradually, users should see zero downtime. There may be a brief increase in latency during the switch, but no errors.

What if the failing cloud is completely down right now?

Skip the snapshot step and go straight to rebuilding from your Git repo and object storage. If you don’t have those, you’ll have to wait for recovery or lose data.

Can I run the same workload on both clouds simultaneously?

Yes, for inference you can run a replica on each cloud and load-balance between them. For training, you’d need a distributed framework that supports multi-cloud, which is complex.

What happens to my data on the old cloud after migration?

You should delete it to avoid charges and security risks. But first, verify that all data is fully transferred and the new system is stable for a few days.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →