3 ms·
Simplistic answer is because hardware and firmware environment gets configured during boot, even for virtual machines. Some virtual machine environments do hav
by throwawaylinux 3y ago
Simplistic answer is because hardware and firmware environment gets configured during boot, even for virtual machines.
Some virtual machine environments do have facilities to snapshot the entire state of a machine and resume it (potentially on another machine), but if you look at what is involved with snapshot metadata it's more than just the state of memory, you have CPU and device state as well.
- PMunch 3y agoWouldn't hibernating the machine and then copying the hibernation data to another machine do the trick? Sure it wouldn't be as instant, but it would skip most of the boot configuration.
- Angostura 3y agoPossibly a bit fragile if there is any situation where one day the other machine isn't entirely identical? (just hand-waving here)
- j16sdiz 3y agoThe usual culprit is CPU feature flags on different CPU generations.
- LeifCarrotson 3y agoWell then wouldn't you just have one image file for each CPU generation in your datacenter. Or better yet, have one image file on the hypervisor for each individual machine! That machine is probably dedicated to Lambda instances and boots them 1000x per day, if you're spending valuable time that's actually customer-facing latency on each call to reboot the system then switch that memory<->time tradeoff back towards memory!
- throwawaylinux 3y agoConceptually at a high level yes (if the hardware was ~identical). Resuming from hibernation on the same machine resuming from hibernation is basically loading an image into memory and executing it that OP asked about too. But in either the resume or hypothetical hypernation migration cases, you can't just start running where the previous boot left off, you have to go through hibernation resume functions which basically do the same thing as boot in terms of configuring hardware. On virtual machines there probably isn't nearly so much real hardware to set up, and hypervisors can optimize virtual device setup. The machine image could also be provided via COW snapshot of memory. So I don't know, possibly at some corners it could be faster to do a resume type operation than a full boot. I haven't played with hypervisor guest boot at these kinds of speeds before.