Can OpenStack Nova live migration move a small application with zero user-visible downtime?
0 reputation · 24 Aug 2024, 05:48 UTC
0 reputation · 24 Aug 2024, 05:48 UTC
Move a small, running application between OpenStack compute hosts using Nova live migration while avoiding any user-visible downtime.
Nova live migration pre-copies memory and state, then pauses the instance briefly during cutover to transfer remaining dirty pages. The application must tolerate that pause or recover TCP connections automatically. Shared storage such as Ceph, NFS, or Cinder is typically required for instance disks; local ephemeral storage relies on slower block migration. Libvirt/KVM computes must share network segments, CPU features, and compatible libvirt versions. CPU pinning, PCI passthrough, SR-IOV, GPU passthrough, or pinned MAC addresses can block migration or break layer-2 connectivity afterward.
Assume an OpenStack deployment using Nova with Libvirt/KVM. Whether the cutover pause is short enough to appear as zero downtime depends on the application's memory dirty rate, network speed, and connection handling, which remains unresolved without production-like testing.
34775 reputation · 24 Aug 2024, 12:08 UTC
Yes – a small, mostly read-only application can be live-migrated with no perceptible downtime provided the migration pause stays below the TCP retransmission timeout (about 200 ms) and the instance meets the usual Nova live-migration prerequisites.
For a small workload the memory dirty rate is often low (a few MB/s). On a 10 GbE link the remaining dirty pages can be flushed in under 10 ms, yielding a cutover pause of tens of milliseconds. Such a pause is shorter than typical TCP retransmission timers and keep-alive intervals, so existing TCP sessions survive without application-level reconnect and the interruption is imperceptible to users.
ceph fs list or nfsstat -m) shows the instance’s disk images are present and readable.virsh capabilities on source and destination hosts and ensure the destination’s <cpu> element is a superset of the source’s.virsh domstats --balloon or virsh domblkstat to observe the memory dirty page rate; a rate below about 10 MB/s suggests a short pause.nova live-migration ./var/log/nova/nova-compute.log for the timestamps of the last pre-copy log and the post-migration resume log; compute the interval.iperf3 -c server -t 300) and verify no packet loss or reconnection during the migration window.If the memory dirty rate cannot be estimated beforehand, the migration pause length is uncertain. Measuring the dirty rate (step 4) is the single diagnostic detail that would change the recommendation: a high dirty rate could lengthen the pause beyond the TCP timeout, making zero-downtime unlikely without application-level reconnection logic.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 24 Aug 2024, 17:17 UTC
Nova can switch to post‑copy mode after a pre‑copy threshold; the VM is paused only once, the remaining memory is fetched on‑demand by the destination host, which caps the visible pause regardless of dirty‑rate spikes. This mode requires libvirt ≥ 1.3.5 and QEMU ≥ 2.5, and the migration network must stay alive for the duration of the fetch; a network interruption forces the VM to resume on the source host, so it is best used when the migration path is reliable.