[Bug 2013336] Re: agent fails if /boot/grub/menu.lst GRUB config file is not present

Alberto Contreras 2013336 at bugs.launchpad.net
Tue Apr 25 17:09:44 UTC 2023


** Description changed:

  [ Impact ]
  
   * This bug prevents the agent to correctly set up instances
     for hibernation. It disallows AWS to hibernate spot instances.
  
  [ Test Plan ]
  
-  * Spin up a EC2 normal instance with enough disk space to hibernate.
-    The hibernation on spot instances cannot be controlled by the user but
-    we can reproduce the workflow in a normal instance:
-    https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernate-spot-instances.html
-  * sudo apt-get install hibagent
-  * sudo /usr/bin/enable-ec2-spot-hibernation
-  * `journalctl -u hibagent | grep 'Errno'` will show:
-    Failed to initialize swap, reason: [Errno 2] No such file or directory: '/boot/grub/menu.lst'
-  * And no swap is configured in the system
+  * Spin up an EC2 spot instance with `hibernate` as `Interruption behavior` [1].
+  * Install the latest hibagent: `sudo apt-get install hibagent`
+  * Enable hibernation: `sudo /usr/bin/enable-ec2-spot-hibernation`
+  * Create an AWS FIS experiment template to send a spot-instance-interruption signal [2], make it point to the created instance and launch it.
+    Note: This step is optional, one can wait for AWS EC2 to send the interruption signal, but it could take a lot of time.
+  * After some minutes, EC2 will send a signal to resume the interrupted instance.
+  * Verify the instance has correctly been resumed from hibernation.
+ 
+ [1] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/interruption-behavior.html#specifying-spot-interruption-behavior
+ [2] https://catalog.us-east-1.prod.workshops.aws/workshops/5fc0039f-9f15-47f8-aff0-09dc7b1779ee/en-US/030-basic-content/078-ec2-spot/020-spot-ec2-interrup
  
  [ Where problems could occur ]
  
   * On affected releases, hibagent modifies config files for both GRUB and
     GRUB2. The upstream patch only modifies the GRUB config file if it is
     present. Thus, if there is a regression it would affect releases with GRUB,
     but we are going to include it in series that ship with GRUB2.
  
  [ Other Info ]
  
   * Bionic ships GRUB2 but the images contain the old and not needed
     /boot/grub/menu.lst . CPC has confirmed that there are no plans
     to remove that file as that would constitute a breaking change for
     an LTS. That's why this bug does not affect bionic.
  
  [Original Description]
  
  The agent fails to initialize the swap when /boot/grub/menu.lst is not present.
  That file is related to GRUB and is not needed on systems with GRUB2 installed.
  
  # /usr/bin/enable-ec2-spot-hibernation
  # journalctl -u hibagent
  ...
  Mar 30 10:51:10 ip-172-31-34-23 /hibagent[615]: Failed to initialize swap, reason: [Errno 2] No such file or directory: '/boot/grub/menu.lst'
  Mar 30 10:51:11 ip-172-31-34-23 /hibagent[615]: Background swap initialization thread is complete.
  
  I expected the agent to not require config files of older grub versions
  to be present to correctly configure the system for hibernation.

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

Title:
  agent fails if /boot/grub/menu.lst GRUB config file is not present

Status in hibagent package in Ubuntu:
  Fix Released
Status in hibagent source package in Focal:
  New
Status in hibagent source package in Jammy:
  New
Status in hibagent source package in Kinetic:
  New

Bug description:
  [ Impact ]

   * This bug prevents the agent to correctly set up instances
     for hibernation. It disallows AWS to hibernate spot instances.

  [ Test Plan ]

   * Spin up an EC2 spot instance with `hibernate` as `Interruption behavior` [1].
   * Install the latest hibagent: `sudo apt-get install hibagent`
   * Enable hibernation: `sudo /usr/bin/enable-ec2-spot-hibernation`
   * Create an AWS FIS experiment template to send a spot-instance-interruption signal [2], make it point to the created instance and launch it.
     Note: This step is optional, one can wait for AWS EC2 to send the interruption signal, but it could take a lot of time.
   * After some minutes, EC2 will send a signal to resume the interrupted instance.
   * Verify the instance has correctly been resumed from hibernation.

  [1] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/interruption-behavior.html#specifying-spot-interruption-behavior
  [2] https://catalog.us-east-1.prod.workshops.aws/workshops/5fc0039f-9f15-47f8-aff0-09dc7b1779ee/en-US/030-basic-content/078-ec2-spot/020-spot-ec2-interrup

  [ Where problems could occur ]

   * On affected releases, hibagent modifies config files for both GRUB and
     GRUB2. The upstream patch only modifies the GRUB config file if it is
     present. Thus, if there is a regression it would affect releases with GRUB,
     but we are going to include it in series that ship with GRUB2.

  [ Other Info ]

   * Bionic ships GRUB2 but the images contain the old and not needed
     /boot/grub/menu.lst . CPC has confirmed that there are no plans
     to remove that file as that would constitute a breaking change for
     an LTS. That's why this bug does not affect bionic.

  [Original Description]

  The agent fails to initialize the swap when /boot/grub/menu.lst is not present.
  That file is related to GRUB and is not needed on systems with GRUB2 installed.

  # /usr/bin/enable-ec2-spot-hibernation
  # journalctl -u hibagent
  ...
  Mar 30 10:51:10 ip-172-31-34-23 /hibagent[615]: Failed to initialize swap, reason: [Errno 2] No such file or directory: '/boot/grub/menu.lst'
  Mar 30 10:51:11 ip-172-31-34-23 /hibagent[615]: Background swap initialization thread is complete.

  I expected the agent to not require config files of older grub
  versions to be present to correctly configure the system for
  hibernation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/hibagent/+bug/2013336/+subscriptions




More information about the foundations-bugs mailing list