AWS and Canonical today announce the public release of Amazon EC2 Hibernation support for Ubuntu 16.04 LTS, bringing support for this feature on par with Ubuntu 18.04 LTS.
Hibernation allows you to pause your Amazon EC2 Instances when not required and resume them at a later time. Applications will start up exactly from where they left off instead of rebuilding their memory footprint. Using Hibernation, users can maintain a fleet of pre-warmed instances that can get to a productive state faster. Users can take advantage of this feature without the need of modifying your existing applications.
Support for Hibernation on Amazon EC2 is provided by the latest linux-aws-hwe kernel package, version 4.15.0-1058-aws, now available for Ubuntu 16.04 LTS. Users must install this package along with ec2-hibinit-agent to enable this feature via the following instructions:
sudo apt update
sudo apt install linux-aws-hwe
sudo apt install ec2-hibinit-agent
To confirm the correct kernel is now in use after the reboot, issue the following command:
The uname command should report kernel version 4.15.0-1058-aws or greater.
The linux-aws-hwe package is fully supported by Canonical and will continue to receive regular updates until the end of standard support for Ubuntu 16.04 LTS in April 2021. Security updates until the end of 2024 are available with Extended Security Maintenance (ESM) support.
There is a known issue when using Amazon EC2 Hibernation related to KASLR (Kernel Address Space Layout Randomisation). KASLR is a standard Linux kernel security feature which helps to mitigate exposure to and ramifications of yet-undiscovered memory access vulnerabilities by randomising the base address value of the kernel. In a small percentage of tests, instances with KASLR enabled do not resume and become completely unusable after hibernation. Disabling KASLR, which is enabled by default, is known to avoid this issue. Please see bug lp:1837469 for additional details.