Cloud Migration Strategy and Execution Questions
Planning and executing a move to the cloud: the migration strategies (rehost, replatform, refactor, repurchase, retire, retain), legacy assessment, dependency mapping, cutover planning, and rollback. Covers phased migration roadmaps, workload modernization, risk management during cutover, and validating success post-migration. The end-to-end migration lifecycle, not steady-state operations.
Explain hybrid/coexistence patterns used during migration: database replication/CDC for data sync, dual-write, strangler pattern for gradual refactor, API gateways/proxies for routing between on-prem and cloud components, and active-active vs active-passive modes. For each pattern describe when it is appropriate and the main operational considerations.
Sample Answer
Direct answer: Hybrid/coexistence patterns during migration exist to let old and new systems interoperate correctly while a migration is in progress; the main ones are database replication / change-data-capture (CDC) for data sync, dual-write, an API gateway/proxy for routing between on-prem and cloud components, and active-active vs active-passive as an operating mode for the coexistence period itself.
Structured elaboration. Database replication/CDC for data sync: keeps a target database current with an ongoing source of truth during migration, appropriate when the two systems don't both need to accept writes at the same time (one is clearly the source of truth while the other is a synchronized read target, until cutover flips which one is authoritative). Dual-write: the application writes to both old and new systems as part of normal operation during the coexistence period; useful when BOTH systems genuinely need to be current and usable (e.g., some traffic is already being served by the new system while some is still on the old one), at the cost of coordination risk (if one write succeeds and the other fails, the systems diverge) that needs an explicit reconciliation process to catch. Strangler pattern for gradual refactor: routes an increasing share of functionality to the new system over time while the old system still handles what hasn't yet been migrated, typically via a routing/proxy layer in front of both; most relevant when the migration is functionally incremental (moving one capability at a time) rather than a wholesale data-store swap. API gateways/proxies for routing between on-prem and cloud components: the mechanical layer that makes several of the above patterns possible, directing a given request to whichever system (old or new) currently owns that functionality or that user/tenant, and providing a single point to adjust routing as migration progresses. Active-active vs active-passive modes: active-active means both old and new systems are live and serving real traffic simultaneously (highest operational complexity, but enables gradual, low-risk traffic shifting); active-passive means one system is fully authoritative while the other is a synchronized standby not yet serving traffic (simpler to reason about, but the cutover moment is more of a discrete event rather than a gradual shift).
When each is appropriate and main operational considerations. Replication/CDC: appropriate for a straightforward data-store migration with a clear before/after cutover moment; operational consideration is monitoring replication lag and validating parity continuously. Dual-write: appropriate when gradual, traffic-based cutover (not a single data-store swap) is needed; operational consideration is building and monitoring reconciliation to catch write-coordination failures. Strangler pattern: appropriate for a functionally-incremental migration; operational consideration is maintaining the routing layer's correctness as the split between old/new functionality shifts over time. API gateways/proxies: appropriate whenever any of the other patterns need a single, well-defined place to route requests between old and new (it's the mechanical enabler behind strangler-pattern routing and behind gradual traffic shifting generally, not a competing alternative to them); the main operational consideration is keeping the routing rules themselves correct and low-latency as the old/new split shifts over time, since a bug in the gateway's routing logic can silently misroute traffic in either direction. Active-active: appropriate when a gradual traffic-percentage cutover is the goal; operational consideration is the doubled infrastructure cost and the complexity of keeping both systems genuinely consistent while both are live. Active-passive: appropriate when a discrete cutover event is acceptable; operational consideration is that a longer time to build confidence before cutover is needed, since there's no gradual traffic-based signal along the way.
Worked example. A migration moving traffic gradually to a new backend: an API gateway routes requests based on a rollout percentage (active-active), the new backend's database stays synchronized via CDC from the still-authoritative old database (until a later point where dual-write or a full cutover flips authority), giving a combination of patterns rather than a single one in isolation, which is typical of a real migration.
Trade-offs & pitfalls. Reaching for dual-write by default because it "keeps both systems current" without first asking whether a simpler replication/CDC pattern (single source of truth, one-directional sync) would satisfy the actual requirement is a common overcomplication; dual-write's coordination risk should be accepted only when the migration genuinely needs both systems live and authoritative simultaneously, not as a default choice.
Technical: Write a high-level pseudocode or script outline (in Python) to perform an inventory of on-prem virtual machines (VMware) and output a CSV with VM name, CPU, memory, disk, OS, and network connections. Describe authentication, error handling, and throttling considerations.
Sample Answer
Direct answer: Structure the script as a thin authenticated client against the vCenter API (pyVmomi in Python), separating the network-facing collection code from the pure CSV-shaping logic so the shaping logic can be tested without a live vCenter connection; wrap every vCenter call in a throttle-and-retry layer, since bulk inventory of hundreds of VMs will trip vCenter's own rate limiting if called naively in a tight loop.
Structured elaboration
Authentication. Connect via SmartConnect with a service account (never a personal admin credential) scoped to read-only inventory permissions if the vCenter RBAC model supports it; use TLS throughout, and in production verify against vCenter's actual CA rather than disabling certificate checking (disabling checks is a common shortcut in scripts like this one that should never ship to a real migration).
Error handling. Two categories of failure matter: transient (network blip, vCenter momentarily busy) and permanent (a specific VM's summary object is malformed, a permission is missing). Transient failures should retry with exponential backoff; permanent failures on a SINGLE VM should be logged and skipped, not allowed to abort the entire inventory run, since discovering 995 of 1,000 VMs and clearly flagging the 5 that failed is far more useful for migration planning than crashing at VM #200 and starting over.
Throttling. vCenter APIs rate-limit and can degrade under a tight polling loop against thousands of objects; a fixed-interval rate limiter (cap calls per second) combined with retry-with-backoff on the actual API calls prevents the inventory run itself from becoming a mini denial-of-service against the vCenter the rest of the org still depends on during discovery.
Worked example (executed). The shaping logic below was run in this session's sandbox against synthetic VM summaries (standing in for what vm.summary returns from a live vCenter, since no vCenter was reachable here) to prove the CSV output and the throttle/retry wrapper are both correct, not just plausible:
import csv, time, ssl, sys
class ThrottledRetry:
"""Fixed-interval rate limiter + exponential-backoff retry wrapper for vCenter calls."""
def __init__(self, calls_per_sec=10, max_retries=3, backoff_base=0.5):
self.min_interval = 1.0 / calls_per_sec
self.max_retries = max_retries
self.backoff_base = backoff_base
self._last_call = 0.0
def call(self, fn, *args, **kwargs):
for attempt in range(self.max_retries + 1):
elapsed = time.monotonic() - self._last_call
if elapsed < self.min_interval:
time.sleep(self.min_interval - elapsed)
self._last_call = time.monotonic()
try:
return fn(*args, **kwargs)
except Exception as e:
if attempt == self.max_retries:
raise
time.sleep(self.backoff_base * (2 ** attempt))
def extract_vm_row(vm_summary):
net_conns = ";".join(vm_summary.get("networks", []))
return {
"vm_name": vm_summary["name"],
"cpu_count": vm_summary["cpu"],
"memory_mb": vm_summary["memory_mb"],
"disk_gb": round(vm_summary["disk_bytes"] / (1024 ** 3), 1),
"guest_os": vm_summary.get("guest_os", "unknown"),
"network_connections": net_conns,
}
def write_inventory_csv(vm_summaries, out_path):
rows = [extract_vm_row(v) for v in vm_summaries]
fieldnames = ["vm_name", "cpu_count", "memory_mb", "disk_gb", "guest_os", "network_connections"]
with open(out_path, "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=fieldnames)
w.writeheader()
w.writerows(rows)
return rows
# The actual production connection function uses pyVmomi's SmartConnect against a real
# vCenter host; omitted here since it requires live network access. Its only job is to
# populate the same vm_summary shape used above and hand it to write_inventory_csv.
Running this against three synthetic VMs and printing the resulting CSV produced:
vm_name,cpu_count,memory_mb,disk_gb,guest_os,network_connections
web-01,4,16384,100.0,Ubuntu Linux (64-bit),VLAN-100-web
db-01,16,65536,2000.0,Windows Server 2019 (64-bit),VLAN-200-db;VLAN-999-backup
app-01,8,32768,250.0,Red Hat Enterprise Linux 8 (64-bit),
Note app-01's empty network_connections field: a VM with no discovered networks produces an empty string rather than crashing the row-shaping, which matters because a real inventory run WILL hit VMs with unusual or missing network configuration and shouldn't fail on them. Separately, exercising the throttle/retry wrapper against a function that raises ConnectionError on its first two calls and succeeds on the third confirmed it retries with backoff and returns the successful result on attempt 3, rather than propagating the first transient error.
Trade-offs & pitfalls. A common shortcut is calling the vCenter API inside a plain for vm in all_vms: get_summary(vm) loop with no throttling: this works fine in a 20-VM test lab and then degrades or gets rate-limited against a real 1,000-VM estate. The other common mistake is letting one malformed VM object abort the whole run with an unhandled exception; per-VM error isolation (catch, log, continue) is what makes the script usable on a real, messy production vCenter inventory where a handful of VMs always have something odd about their configuration.
Create an observability plan to measure migration success and detect regressions post-cutover. Specify which metrics (system and business), log and tracing spans, alert thresholds, dashboards, and SLOs/KPIs you would define and monitor during a migration wave and the immediate post-migration stabilization period.
Sample Answer
Direct answer: An observability plan for a migration should track system metrics (latency, error rate, saturation), business metrics (the actual outcomes the migration shouldn't disrupt: conversion rate, transaction volume), logs, and distributed traces spanning the cutover boundary, with alert thresholds calibrated against the PRE-migration baseline specifically, not generic defaults, since "normal" for this system is whatever it was before, not an industry-standard number.
Structured elaboration. Metrics (system and business): system metrics are the standard SRE set (request latency percentiles, error rate, resource saturation) but business metrics matter equally for a migration: if latency and error rate look fine but conversion rate or transaction success rate drops, that's a real regression the system metrics alone would miss (e.g., a subtle correctness bug that doesn't throw errors but produces wrong results). Log and tracing spans: ensure logging and tracing coverage spans the actual cutover moment and the immediate stabilization window with enough granularity to reconstruct what happened if an issue surfaces, and specifically tag/label telemetry from the migration window so it can be easily filtered and compared against pre/post baselines later. Alert thresholds: set relative to the PRE-migration baseline (e.g., "alert if p99 latency exceeds baseline by 50%") rather than an absolute number that might not reflect this specific system's normal behavior; this also means capturing a clean baseline BEFORE migration starts, not estimating one after the fact. Dashboards: build a migration-specific dashboard showing old-vs-new comparison side by side for the key metrics, used actively during the cutover window and the stabilization period, not assembled after the fact for a retrospective. SLOs/KPIs to define and monitor: the existing SLOs (if any) should apply unchanged to the new environment (the migration shouldn't be an excuse to relax a commitment), plus migration-specific KPIs (e.g., "percentage of requests served without an error attributable to migration" as an explicit, temporary tracked metric during the transition). During a migration wave and the immediate post-migration stabilization period: monitoring intensity should be highest immediately around cutover (tight windows, low alert-threshold tolerance, active human attention) and can relax to normal operational monitoring once the system has demonstrated stability over an agreed stabilization period, rather than staying in a permanently heightened, unsustainable alert posture.
Worked example. A migration-specific dashboard shows, side by side: pre-migration baseline p50/p95/p99 latency versus live post-cutover values, pre- vs post-migration error rate, and a business metric (e.g., checkout completion rate) tracked continuously through the cutover window; alerts are configured at baseline+30% for latency and baseline+2x for error rate specifically for the 48-hour stabilization window following cutover, then revert to the system's normal (non-migration-specific) alerting configuration once stability is confirmed.
Trade-offs & pitfalls. Relying only on system-level metrics (latency, error rate) without a business-outcome metric is a common gap: a migration can introduce a subtle correctness issue (a currency-conversion bug, a mis-mapped field) that produces no errors and no latency change at all, and only shows up as an unexplained dip in a business metric like completed transactions.
Compare the common cutover strategies used in migrations (big-bang cutover, phased migration, blue-green deployment, canary rollout, parallel-run). For each strategy describe typical use cases, advantages, risks, and rollback considerations. Provide guidance on choosing a cutover approach for an enterprise-facing customer service application with moderate traffic and strict SLA requirements.
Sample Answer
Direct answer: Big-bang, phased, blue-green, canary, and parallel-run cutover strategies trade off risk exposure against complexity and duration; for an enterprise customer-facing application with moderate traffic and strict SLA requirements, blue-green or a phased approach usually wins over a big-bang cutover, since the SLA requirement makes rollback speed a priority the simpler big-bang approach doesn't provide as cleanly.
Structured elaboration. Big-bang cutover: switch everything at once at a scheduled moment; simplest to plan and execute, but highest risk (if something's wrong, the FULL user base is affected immediately) and rollback means reversing the whole cutover, not a subset. Best for low-traffic, low-SLA-risk applications where the simplicity is worth the concentrated risk. Phased migration: move distinct components or user segments over time (e.g., migrate by geography or by feature area); reduces blast radius per phase, but requires the old and new systems to coexist and interoperate correctly for the duration, adding architectural complexity. Rollback means reverting one phase's component or segment at a time, back to the old system, which is only safe if the not-yet-migrated phases can still interoperate correctly with whichever phase just got reverted. Blue-green deployment: stand up the full new environment (green) alongside the still-live old one (blue), validate it, then switch traffic over via a routing change (DNS or load balancer); rollback is simply switching the router back, making it one of the fastest-to-rollback options, at the cost of running two full environments simultaneously (cost overhead) for the transition period. Canary rollout: shift a small percentage of traffic to the new environment first, watching metrics closely, before progressively increasing; lowest risk exposure per increment (only a small user slice is affected by any given step), but takes the longest to reach full cutover and requires infrastructure capable of fine-grained traffic splitting. Rollback is simply reducing the traffic percentage back toward zero, which is why canary is often held up as the lowest-regret option: the blast radius of a bad step is capped by construction, and reversing it is a routing change, not a data operation. Parallel-run: run both systems processing the same input simultaneously WITHOUT cutting user traffic over, comparing outputs to validate correctness before any real cutover happens; adds the most validation confidence but the most complexity (need a way to compare outputs meaningfully) and doesn't reduce cutover risk itself, just the UNCERTAINTY about whether the new system is correct before that risk is taken. Rollback in the traditional sense doesn't apply here: since real user traffic was never cut over to the new system in the first place, there is nothing user-facing to revert, only a decision to keep the new system in shadow mode longer or promote it once its outputs are trusted.
Guidance for the stated scenario. For an enterprise customer-facing app with moderate traffic and strict SLA: blue-green is a strong default (full environment validated in advance, fast rollback via a routing switch, moderate complexity), and can be COMBINED with a brief canary step (shift a small percentage through the new environment first, even within a blue-green setup) to catch any issue before the full switch, giving the fast-rollback property of blue-green with some of canary's exposure-limiting benefit.
Worked example. Stand up the new (green) environment fully, run a parallel-run validation period comparing outputs against production traffic without affecting users, then execute the cutover as a canary-within-blue-green: shift 5% of traffic to green, hold and monitor against the SLA's specific metrics for a defined period, then 25%, then 100%, with an automated or fast-manual rollback (routing back to blue) available at every step.
Trade-offs & pitfalls. Choosing big-bang purely because it's operationally simpler to plan, without weighing that simplicity against a strict-SLA application's actual risk tolerance, is a common mismatch; the right cutover strategy should be selected against the application's stated risk tolerance, not the team's preference for a simpler runbook.
List and compare commonly used discovery, assessment, and migration tools/services across AWS, Azure, and GCP (for example: AWS Migration Hub, AWS DMS/CloudEndure, Azure Migrate, Azure Database Migration Service, Google Cloud Migrate/Database Migration Service). For each tool describe typical use cases, strengths, limitations, and what POC you would run to validate it for an enterprise workload.
Sample Answer
Direct answer: AWS, Azure, and GCP each offer a discovery/inventory tool, one or more database/server migration services, and cost-estimation tooling, and choosing between them is less about picking a "best" provider and more about matching each tool's strengths to the specific migration task and validating it via a scoped POC before committing at scale.
Structured elaboration. AWS: AWS Migration Hub (a central tracking/dashboard layer that aggregates status across other AWS migration tools rather than being a migration engine itself; limitation: it is a tracking layer ONLY, it never moves data or servers itself, so it still fully depends on another tool underneath it to do the actual migration work), AWS DMS (Database Migration Service) / CloudEndure-lineage tooling (database and server replication/migration, strong for database migrations specifically with broad source/target engine support; limitation: schema/DDL conversion for heterogeneous engine pairs is often shallow, so complex stored procedures and proprietary SQL dialects frequently need manual rework DMS itself won't do), useful for large heterogeneous estates where centralized tracking across many migration streams matters. Azure: Azure Migrate (discovery, assessment, and orchestration of the migration itself, notably strong on the discovery/assessment side for VM estates; limitation: its assessment sizing recommendations are tuned around Azure's own VM families, so cost/sizing comparisons against other clouds need independent verification), Azure Database Migration Service (focused specifically on database migrations, with particularly strong support for SQL Server-family migrations given Microsoft's own database heritage; limitation: that SQL Server strength doesn't carry over as cleanly to non-Microsoft source engines, where feature coverage and community troubleshooting resources are noticeably thinner), useful when the source estate is already Windows/SQL-Server-heavy, where Microsoft's own tooling tends to have the deepest compatibility. Google Cloud: Google Cloud Migrate (VM/server migration; limitation: narrower breadth of supported source hypervisors/formats than the AWS and Azure equivalents, so an unusual source virtualization platform is more likely to need a workaround) and Database Migration Service (database-focused, particularly strong for MySQL/PostgreSQL targets; limitation: support for heterogeneous migrations into non-Postgres/MySQL targets is comparatively limited, so a move toward, say, Spanner needs additional tooling beyond this service alone), useful for estates already leaning open-source-database-heavy or where the target architecture favors GCP's data/analytics ecosystem. POC to validate for an enterprise workload: for whichever tool(s) are shortlisted, run a POC migrating a representative (not trivial) sample workload end-to-end, specifically validating (a) does the tool handle the estate's actual complexity (a specific legacy database version, an unusual schema pattern) rather than just the vendor's demo scenario, (b) what's the actual measured downtime/cutover characteristics versus the vendor's marketing claims, and (c) how well does the tool's output integrate with the team's existing runbooks/automation, rather than requiring the team to adopt an entirely new operational model just for the migration tool. Concretely, the POC's specific focus should follow directly from each tool's own known limitation, not be identical across tools: for AWS Migration Hub, the POC should confirm it correctly aggregates status across whichever underlying migration tools are actually chosen, since it never moves data itself; for AWS DMS, the POC should run the estate's trickiest schema or stored-procedure case through the tool specifically, to measure how much manual DDL rework is actually needed rather than assuming a clean, simple table migrates representatively; for Azure Migrate, the POC should independently recompute VM sizing/cost for a sample of servers rather than trusting its Azure-tuned assessment defaults; for Azure Database Migration Service, the POC should specifically test a non-SQL-Server source engine if one exists in the estate, since that's where its coverage is measurably thinner; for Google Cloud Migrate, the POC should confirm the estate's actual source hypervisor/VM format is supported at all, given its narrower breadth versus AWS and Azure; and for Google Cloud Database Migration Service, the POC should target whatever engine the migration is actually headed toward (Spanner, AlloyDB, etc.), not just confirm MySQL/PostgreSQL support, since that's where the service's coverage thins out.
Worked example. An enterprise with a heavily SQL-Server-based estate migrating primarily to Azure would likely find Azure Database Migration Service has the deepest native compatibility (least schema-translation friction) for that specific source; the same enterprise, if migrating a smaller set of open-source-database workloads to GCP as a secondary target, would separately evaluate GCP's Database Migration Service for THAT subset, rather than assuming one tool/provider fits every workload in a genuinely heterogeneous estate.
Trade-offs & pitfalls. Committing to a single vendor's migration toolchain across an entire heterogeneous estate, without validating via POC that the tool genuinely handles the estate's actual technical variety (not just its most common case), risks discovering mid-migration that a meaningful subset of workloads need a different approach than planned, late enough to disrupt the schedule.
Unlock Full Question Bank
Get access to all 34 Cloud Migration Strategy and Execution interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.