enable hibernation on ARM

Bug #2066999 reported by Mitchell Dzurick
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ec2-hibinit-agent (Ubuntu)
Fix Released
High
Mitchell Dzurick
Focal
Fix Released
High
Mitchell Dzurick
Jammy
Fix Released
High
Mitchell Dzurick
Mantic
Fix Released
High
Mitchell Dzurick
Noble
Fix Released
High
Mitchell Dzurick

Bug Description

[ Impact ]
This is a hardware enablement change to support hibernation on ARM.

Related to https://bugs.launchpad.net/ubuntu/+source/linux-aws/+bug/2060992

[ Test Plan ]
The test plan is the same steps, but tested on both ARM64 and AMD64 to ensure functional enablement and no regressions for amd64.

1. Create an AWS instance
2. Update the hibernation agent
3. Spawn a process
4. Initiate hibernation of the instance
5. Resume the instance
6. Check that the process is still running on the instance

[ Where problems could occur ]
* Regressions in hibernation on amd64 instances due to changes to support arm.

Related branches

Changed in ec2-hibinit-agent (Ubuntu):
assignee: nobody → Mitchell Dzurick (mitchdz)
Changed in ec2-hibinit-agent (Ubuntu Focal):
assignee: nobody → Mitchell Dzurick (mitchdz)
Changed in ec2-hibinit-agent (Ubuntu Jammy):
assignee: nobody → Mitchell Dzurick (mitchdz)
Changed in ec2-hibinit-agent (Ubuntu Mantic):
assignee: nobody → Mitchell Dzurick (mitchdz)
Changed in ec2-hibinit-agent (Ubuntu Noble):
assignee: nobody → Mitchell Dzurick (mitchdz)
Changed in ec2-hibinit-agent (Ubuntu Focal):
status: New → In Progress
Changed in ec2-hibinit-agent (Ubuntu Jammy):
status: New → In Progress
Changed in ec2-hibinit-agent (Ubuntu Mantic):
status: New → In Progress
Changed in ec2-hibinit-agent (Ubuntu Noble):
status: New → In Progress
Changed in ec2-hibinit-agent (Ubuntu):
status: New → In Progress
importance: Undecided → High
Changed in ec2-hibinit-agent (Ubuntu Focal):
importance: Undecided → High
Changed in ec2-hibinit-agent (Ubuntu Jammy):
importance: Undecided → High
Changed in ec2-hibinit-agent (Ubuntu Mantic):
importance: Undecided → High
Changed in ec2-hibinit-agent (Ubuntu Noble):
importance: Undecided → High
description: updated
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

I've tested the agent on amd64 instances to ensure no regression when updating. Further results for ARM enablement coming soon.

description: updated
summary: - Add ARM support
+ enable hibernation on ARM
Revision history for this message
Mitchell Dzurick (mitchdz) wrote (last edit ):

This is the shell script I made to test for amd64 regressions, and the results.

mitchdz-hibernate-test-6mantic results:
 Version: 1.0.0-0ubuntu16.23.10.1~mantic1
  22:50:50 up 0 min, 0 user, load average: 1.18, 0.40, 0.14

mitchdz-hibernate-test-6focal results:
 Version: 1.0.0-0ubuntu9.6~focal1
  23:36:28 up 46 min, 1 user, load average: 0.31, 0.08, 0.02

mitchdz-hibernate-test-6jammy results:
 Version: 1.0.0-0ubuntu11.22.04.5~jammy1
  23:00:46 up 10 min, 0 users, load average: 0.23, 0.07, 0.02

mitchdz-hibernate-test-6noble results:
 Version: 1.0.0-0ubuntu16.24.04.1~noble1
  23:07:27 up 17 min, 1 user, load average: 0.24, 0.06, 0.02

mitchdz-hibernate-test-6oracular results:
 Version: 1.0.0-0ubuntu17~oracular1
  23:14:17 up 24 min, 1 user, load average: 0.07, 0.02, 0.00

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ec2-hibinit-agent - 1.0.0-0ubuntu17

---------------
ec2-hibinit-agent (1.0.0-0ubuntu17) oracular; urgency=medium

  * d/p/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch: do
    not set the snapshot swap area if /dev/snapshot does not exist. This is
    necessary to enable ARM hibernation. (LP: #2066999)

 -- Mitchell Dzurick <email address hidden> Thu, 23 May 2024 16:51:55 -0700

Changed in ec2-hibinit-agent (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Seth Carolan (secarola) wrote :

Successfully tested with the agent on the M6g family. Received 599/600 successful hibernate resumes. The one failure was unrelated to the agent and within reasonable margins.

High level testing steps:
1.) Run M6g Instance.
2.) Connect to the instance and install the PPA (https://launchpad.net/~mitchdz/+archive/ubuntu/ec2-hibinit-agent-arm)
3.) Install kernel with the changes in this bug so that hibernation is enabled. (https://bugs.launchpad.net/ubuntu/+source/linux-aws/+bug/2060992)
4.) Reboot instance and create an AMI from the instance.
5.) Use the created AMI in all remaining steps
6.) Run Instance
7.) Run script on instance to emit timestamped "heartbeat" to dynamoDB table
8.) Hibernate instance
9.) Resume instance
10.) Confirm "heartbeat" is emitted with a new timestamp after resume
11.) Repeat 8-10 once more.

Revision history for this message
Andreas Hasenack (ahasenack) wrote : Please test proposed package

Hello Mitchell, or anyone else affected,

Accepted ec2-hibinit-agent into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ec2-hibinit-agent/1.0.0-0ubuntu16.24.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ec2-hibinit-agent (Ubuntu Noble):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-noble
Changed in ec2-hibinit-agent (Ubuntu Mantic):
status: In Progress → Fix Committed
tags: added: verification-needed-mantic
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Hello Mitchell, or anyone else affected,

Accepted ec2-hibinit-agent into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ec2-hibinit-agent/1.0.0-0ubuntu16.23.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ec2-hibinit-agent (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Hello Mitchell, or anyone else affected,

Accepted ec2-hibinit-agent into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ec2-hibinit-agent/1.0.0-0ubuntu11.22.04.5 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ec2-hibinit-agent (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Hello Mitchell, or anyone else affected,

Accepted ec2-hibinit-agent into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ec2-hibinit-agent/1.0.0-0ubuntu9.6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Seth Carolan (secarola) wrote :

Testing details:
Batch tested on Jammy, manually tested on all other OS. On Jammy batch tests, achieved 99% hibernate/resume success rate, failures unrelated to the Hibernate agent.

High level batch testing details:
1.) Run M6g Instance.
2.) Connect to the instance and install the kernel from jammy proposed and the hibinit agent from jammy proposed. (the kernel is required to support hibernation - https://bugs.launchpad.net/ubuntu/+source/linux-aws/+bug/2060992)
3.) Reboot instance and create an AMI from the instance.
4.) Use the created AMI in all remaining steps
5.) Run Instance
6.) Run script on instance to emit timestamped "heartbeat" to dynamoDB table
7.) Hibernate instance
8.) Resume instance
9.) Confirm "heartbeat" is emitted with a new timestamp after resume
10.) Repeat 8-10 once more.

Manually testing details:
1.) Run M6g Instance.
2.) Connect to the instance and install the kernel from (focal/mantic/noble) proposed and the hibinit agent from (focal/mantic/noble) proposed. (the kernel is required to support hibernation - https://bugs.launchpad.net/ubuntu/+source/linux-aws/+bug/2060992)
3.) Reboot instance and confirm updated kernel is running.
4.) Run bash script to write timestamp to a text file every second

#!/bin/bash
while :
do
        echo $(date) > text.txt
        sleep 1
done

5.) Hibernate instance
6.) Resume instance
7.) Confirm timestamp is being written to text file with a new timestamp after resume
8.) Repeat 5-8 once more.

Seth Carolan (secarola)
tags: added: verification-done-focal verification-done-jammy verification-done-mantic verification-needed-done
removed: verification-needed-focal verification-needed-jammy verification-needed-mantic verification-needed-noble
tags: added: verification-done-noble
removed: verification-needed verification-needed-done
tags: added: verification-done
Revision history for this message
Mitchell Dzurick (mitchdz) wrote (last edit ):

The following packages have been tested on amd64 to ensure no regressions:

* 1.0.0-0ubuntu16.24.04.1
* 1.0.0-0ubuntu16.23.10.1
* 1.0.0-0ubuntu11.22.04.5
* 1.0.0-0ubuntu9.6

The process is the same for each release, but shown below is the example for noble.

1) Launch instance
Example of how to start it via awscli:
$ aws ec2 run-instances --region eu-north-1 --image-id ami-0b15dce563b217be3 --count 1 --instance-type t3.micro --key-name mitchell --security-group-ids sg-0e03e00997fa53926 --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=mitchdz-hibernate-test-noble}]' --metadata-options HttpTokens=required --block-device-mappings '[{"DeviceName":"/dev/sda1","Ebs":{"Encrypted":true,"DeleteOnTermination":true,"VolumeSize":24,"VolumeType":"gp3"}}]' --hibernation-options Configured=true

2) ssh into the ec2 instance

3) Update package
# cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
EOF
# apt update && apt upgrade -y
# apt install -y ec2-hibinit-agent -t noble-proposed

4) log time
# uptime | tee -a /tmp/uptime.old

5) Hibernate the instance

6) Wait for instance to be available to start, then start the instance

7) ssh into the instance

8) check /tmp/uptime.old existence and contents to be correct, meaning the time is as expected when ran the command before hibernation

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ec2-hibinit-agent - 1.0.0-0ubuntu16.24.04.1

---------------
ec2-hibinit-agent (1.0.0-0ubuntu16.24.04.1) noble; urgency=medium

  * d/p/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch: do
    not set the snapshot swap area if /dev/snapshot does not exist. This is
    necessary to enable ARM hibernation. (LP: #2066999)

 -- Mitchell Dzurick <email address hidden> Thu, 23 May 2024 16:49:47 -0700

Changed in ec2-hibinit-agent (Ubuntu Noble):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ec2-hibinit-agent has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ec2-hibinit-agent - 1.0.0-0ubuntu16.23.10.1

---------------
ec2-hibinit-agent (1.0.0-0ubuntu16.23.10.1) mantic; urgency=medium

  * d/p/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch: do
    not set the snapshot swap area if /dev/snapshot does not exist. This is
    necessary to enable ARM hibernation. (LP: #2066999)

 -- Mitchell Dzurick <email address hidden> Thu, 23 May 2024 16:46:53 -0700

Changed in ec2-hibinit-agent (Ubuntu Mantic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ec2-hibinit-agent - 1.0.0-0ubuntu11.22.04.5

---------------
ec2-hibinit-agent (1.0.0-0ubuntu11.22.04.5) jammy; urgency=medium

  * d/p/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch: do
    not set the snapshot swap area if /dev/snapshot does not exist. This is
    necessary to enable ARM hibernation. (LP: #2066999)

 -- Mitchell Dzurick <email address hidden> Thu, 23 May 2024 16:43:57 -0700

Changed in ec2-hibinit-agent (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ec2-hibinit-agent - 1.0.0-0ubuntu9.6

---------------
ec2-hibinit-agent (1.0.0-0ubuntu9.6) focal; urgency=medium

  * d/p/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch: do
    not set the snapshot swap area if /dev/snapshot does not exist. This is
    necessary to enable ARM hibernation. (LP: #2066999)

 -- Mitchell Dzurick <email address hidden> Thu, 23 May 2024 16:39:47 -0700

Changed in ec2-hibinit-agent (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.