5

Google Compute Engine rents all size Linux VMs from 1 core to 64 cores at various prices. There are "preempt-able" instances for about 1/4 the price of guaranteed instances, but the the preempt-able instances can be terminated at any time (with an ACPI G2 soft off warning and ~ 30 secs until hard cutoff). Although you can provide a startup and shutdown script, the usual approach seems to lead to the unnecessary overhead of having to then create additional software to allow calculations to be interrupted, and to manage partial results of calculations whereas the suspend-to-disk/restore-from-disk scheme seen in laptops and desktops could be a much simpler approach to storing and resuming calculations and therefore preferable.

If I start a Linux preemptible VM on GCE, is it possible generally to suspend the state of the VM to the disk (aka hibernate) and restart a new preemptible VM from the disk afterwards? My idea is:

  1. Start a new preemptible Linux VM.
  2. When the OS receives the the preemption notice (ACPI G2 Soft Off signal), then trigger suspend the to disk - hibernate the Linux OS.
  3. Start a new preemptible Linux VM from the suspended image, i.e. restore the former VM and continue in the computation.

How would I configure Linux to suspend/restore in this way?

Paul
  • 26,170
  • 12
  • 85
  • 119
xmedeko
  • 7,336
  • 6
  • 55
  • 85
  • I am curious enough to post a bounty. The ubuntu wiki has ["Understanding Suspend"](https://wiki.ubuntu.com/UnderstandingSuspend), suggesting a possible starting point for an adventure in configuration management. – Paul Apr 25 '17 at 00:13
  • So `systemctl hibernate` will write data on a GCE VM swap device after swap is set up (it isn't by default). Getting it to resume on boot, though, is another matter. Then there's the question of if it did resume, would networking get set up correctly? I tried using an extra disk as swap device, and could not get it to resume. But there's also this possibility: https://wiki.debian.org/Hibernation/Hibernate_Without_Swap_Partition – Paul Apr 25 '17 at 05:32
  • This question is about system administration, so should go on https://serverfault.com/ – blubberdiblub Apr 30 '17 at 05:10

0 Answers0