Re:AWS vs. GCP reliability is wildly different
by lbhdc on Wednesday September 21, 2022 @05:44PM
(#32931921)
How does migrating a vm to another physical machine work?
[ Parent
| on HN ]
Re:AWS vs. GCP reliability is wildly different
by roomey on Wednesday September 21, 2022 @05:49PM
(#32931981)
VMware has been doing this for years, it's called vmotion and there is a lot of documentation about it if you are interested (eg https://www.thegeekpub.com/8407/how-vmotion-works/ )
Essential, memory state is copied to the new host, the VM is stunned for a millisecond and the cpu states is copied and resumed on the new host (you may see a dropped ping). All the networking and storage is virtual anyway so that is "moved" (it's not really moved) in the background.
Re:AWS vs. GCP reliability is wildly different
by jiggawatts on Wednesday September 21, 2022 @07:32PM
(#32933023)
The clever trick here is that they'll pre-copy most of the memory without bothering to do it consistently, but mark pages that the source had written to as "dirty". The network cutover is stop-the-world, but VMware doesn't copy the dirty pages during the stop. Instead, it simply treats them as "swapped to pagefile", where the pagefile is actually the source machine memory. When computation resumes at the target, the source is used to page memory back in on-demand. This allows very fast cutovers.
Re:AWS vs. GCP reliability is wildly different
by politelemon on Thursday September 22, 2022 @02:05AM
(#32935245)
> VM is stunned for a millisecond
This conjures up hilarious mental imagery, thanks
Re:AWS vs. GCP reliability is wildly different
by kevincox on Thursday September 22, 2022 @10:15AM
(#32939065)
You just bop it on the head, and move it to the new machine quickly. By the time the VM comes to it won't even realize that it is in a new home.
Re:AWS vs. GCP reliability is wildly different
by mh- on Wednesday September 21, 2022 @06:14PM
(#32932270)
Up to 500ms per your source, depending on how much churn there is in the memory from the source system.
Very cool.
Re:AWS vs. GCP reliability is wildly different
by lbhdc on Wednesday September 21, 2022 @06:26PM
(#32932393)
That is really interesting I didn't realize it was so fast. Thanks for the post I will give it a read!
Re:AWS vs. GCP reliability is wildly different
by the_duke on Wednesday September 21, 2022 @06:05PM
(#32932171)
This blog post is pretty old (2015) but gives a good introduction.
https://cloudplatform.googleblog.com/2015/03/Google-Compute-...
Re:AWS vs. GCP reliability is wildly different
by lbhdc on Wednesday September 21, 2022 @06:26PM
(#32932395)
Thanks for sharing, I will give it a read!
Re:AWS vs. GCP reliability is wildly different
by pclmulqdq on Wednesday September 21, 2022 @05:52PM
(#32932026)
They pause your VM, copy everything about its state over to the new machine, and quickly start the other instance. It's pretty clever. I think there are tricks you can play with machines that have large memory footprints to copy most of it before the pause, and only copy what has changed since then during the pause.
The disks are all on the network, so no need to move anything there.
Re:AWS vs. GCP reliability is wildly different
by prmoustache on Wednesday September 21, 2022 @06:12PM
(#32932253)
In reality it sync the memory first to the other host and only pause the vm when the last state sync is small enough to be so quick the pause is barely measurable.
Re:AWS vs. GCP reliability is wildly different
by water-your-self on Wednesday September 21, 2022 @06:21PM
(#32932349)
Indian jones and the register states
Re:AWS vs. GCP reliability is wildly different
by lbhdc on Wednesday September 21, 2022 @06:28PM
(#32932413)
When its transferring the state to the target, how does it handle memory updates that are happening at that time? Is the programs execution paused at that point?
Re:AWS vs. GCP reliability is wildly different
by GauntletWizard on Wednesday September 21, 2022 @07:12PM
(#32932855)
No, but the memory accesses have hooks that say "This memory was written". Then, program execution is paused, and just the sections of memory that were written are copied again.
This has memory performance characteristics - I ran a benchmark of memory read/write speed while this was happening once. It more than halved memory speed for the 30s or so it took from migration started to migration complete. The pause, too, was much longer.
Re:AWS vs. GCP reliability is wildly different
by lbhdc on Wednesday September 21, 2022 @07:37PM
(#32933070)
Ahh I think that was the piece I was missing, thanks! I didn't realize there were hooks for tracking memory changes.
Re:AWS vs. GCP reliability is wildly different
by outworlder on Wednesday September 21, 2022 @07:09PM
(#32932824)
No, they keep track of dirty pages.
Re:AWS vs. GCP reliability is wildly different
by valleyjo on Wednesday September 21, 2022 @05:51PM
(#32932004)
Stream the contents of ram from source to dest, pause the source, reprogram the network and copy and memory that changed since the initial stream, resume the dest, destroy the source, profit.
Re:AWS vs. GCP reliability is wildly different
by rejectfinite on Wednesday September 21, 2022 @05:48PM
(#32931975)
vsphere vmotion has been a thing for years lmao