Performing verification for Impish.

For some reason hibernation just refused to work on any Xen based
instance type, but it works fine on KVM based instances, such as c5, t3
etc. This is being looked into on bug 1968062, but I think it affects
Impish as well.

Diverging from the testcase, and using c5.large (kvm) instances instead
of t2.medium (xen).

I started a c5.large instance with 20gb of storage, with advanced > enable 
encryption > yes.
I also made sure to enable Advanced settings > Stop State (Hibernation) Support 
> Enabled.

I waited for hibinit-agent.service to complete by watching 
$ sudo systemctl status hibinit-agent.service

This is using the current version of ec2-hibinit-agent from -updates:

$ apt-cache policy ec2-hibinit-agent | grep Installed
  Installed: 1.0.0-0ubuntu11
  
I went to the EC2 console and pressed Instance State > Hibernate.

The instance stopped within 30 seconds, and hibernation was successful.
I started the instance again.

From there, I made a swapfile, and enabled it:

$ sudo fallocate -l 4G /swapfile
$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=4194304
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
$ echo "/swapfile swap swap defaults 0 0" | sudo tee -a /etc/fstab
$ swapon --show
NAME TYPE SIZE USED PRIO
/swapfile file 4G 0B -2

I went back to the console and pressed Instance State > Hibernate.

The follow was written to journalctl:

May 26 05:06:22 ip-172-31-45-200 systemd-logind[519]: Suspend key pressed.
May 26 05:06:22 ip-172-31-45-200 systemd-logind[519]: Requested suspend 
operation not supported, ignoring.
May 26 05:06:22 ip-172-31-45-200 kernel: Adding 4095996k swap on /swap-hibinit. 
 Priority:-3 extents:5 across:4505596k SSFS
May 26 05:06:22 ip-172-31-45-200 root[2917]: ACPI action undefined: LNXSLPBN:00

The instance did not hibernate, and stayed running for 20 minutes, until
it timed out and was force stopped.

We can see from the logs that /swap-hibinit was added at priority -3,
and /swapfile is -2. /swapfile was chosen for hibernation, but as since
kernel command line and grub is not set up for this, it fails.

I terminated the instance.

I then created a new instance, again a c5.large, with 20gb of storage, with 
Advanced > Enable Encryption > yes.
I also made sure to enable Advanced settings > Stop State (Hibernation) Support 
> Enabled.

I waited for hibinit-agent.service to complete by watching 
$ sudo systemctl status hibinit-agent.service

I enabled -proposed, and installed ec2-hibinit-agent
1.0.0-0ubuntu11.21.10.1

Setting up ec2-hibinit-agent (1.0.0-0ubuntu11.21.10.1) ...
Installing new version of config file /etc/acpi/actions/sleep.sh ...
$ apt-cache policy ec2-hibinit-agent | grep Installed
  Installed: 1.0.0-0ubuntu11.21.10.1
  
I went to the EC2 console and pressed Instance State > Hibernate.

Again, the instance stopped within 30 seconds, and hibernation was
successful.

I started the instance again, and configured a second swapfile:

From there, I made a swapfile, and enabled it:

$ sudo fallocate -l 4G /swapfile
$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=4194304
4194304+0 records in
4194304+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 31.5124 s, 136 MB/s
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
no label, UUID=ae0bbc8e-4558-4e6a-936b-ed1341b45056
$ sudo swapon /swapfile
$ echo "/swapfile swap swap defaults 0 0" | sudo tee -a /etc/fstab
$ swapon --show
NAME TYPE SIZE USED PRIO
/swapfile file 4G 0B -2

Then, I went back to the EC2 console and selected Instance State >
Hibernate.

The instance stopped within 30 seconds, hibernating successfully.

I then started the instance again, and I could log in:

My screen session is still there, so hibernation went as planned.

$ screen -r
There are several suitable screens on:
        3655.pts-4.ip-172-31-27-182     (05/26/22 04:24:13)     (Detached)
        3472.pts-1.ip-172-31-27-182     (05/26/22 04:19:43)     (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.

The new package, 1.0.0-0ubuntu11.21.10.1 in -proposed fixes the issue,
and I am able to hibernate with an additional swapfile set. Happy to
mark as verified for Impish.

** Tags removed: verification-needed-impish
** Tags added: verification-done-impish

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1968805

Title:
  Hibernation fails when an additional swapfile is added due to priority
  mismatch

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ec2-hibinit-agent/+bug/1968805/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to