Stuck in stopping state

0

Hello there, I have launched EC2 instance with hibernate mode enabled from custom Ubuntu-20 based AMI. When I choose hibernate option for this EC2 instance, its taking more than 20 minutes to change from stopping to stopped state. I don't know why its taking this much time to take stopped state. I tried with multiple EC2 instances from this custom AMI. All launched instances from this AMI, taking more than 20 minutes to stopped state. I increased my root volume size too, now this root volume has more than 15 GB free space. However, its still taking more time to stopped state when I choose hibernate option from console. I can see the hibernate related logs from /var/log/syslog. Can any one please help me to outdo from this issues?

Sep 27 12:17:41 SparxEA systemd[1]: Starting EC2 instance hibernation setup agent... Sep 27 12:17:41 SparxEA /hibinit-agent: Effective config: {'log_to_syslog': True, 'log_to_stderr': True, 'mkswap': 'mkswap {swapfile}', 'swapon': 'swapon {swapfile}', 'swapoff': 'swapoff {swapfile}', 'touch_swap': False, 'grub_update': True, 'swap_percentage': 100, 'swap_mb': 4000} Sep 27 12:17:41 SparxEA /hibinit-agent: Will check if swap is at least: 4000 megabytes Sep 27 12:17:41 SparxEA /hibinit-agent: Create swap and initialize it Sep 27 12:17:41 SparxEA hibinit-agent[1101]: Effective config: {'log_to_syslog': True, 'log_to_stderr': True, 'mkswap': 'mkswap {swapfile}', 'swapon': 'swapon {swapfile}', 'swapoff': 'swapoff {swapfile}', 'touch_swap': False, 'grub_update': True, 'swap_percentage': 100, 'swap_mb': 4000} Sep 27 12:17:41 SparxEA hibinit-agent[1101]: Will check if swap is at least: 4000 megabytes Sep 27 12:17:41 SparxEA hibinit-agent[1101]: Create swap and initialize it Sep 27 12:17:41 SparxEA /hibinit-agent: kicking child process to initiate the setup Sep 27 12:17:41 SparxEA /hibinit-agent: Allocating 4194304000 bytes in /swap-hibinit Sep 27 12:17:41 SparxEA /hibinit-agent: Swap pre-heating is skipped, the swap blocks won't be touched during to ensure they are ready Sep 27 12:17:41 SparxEA /hibinit-agent: Running: mkswap /swap-hibinit Sep 27 12:17:41 SparxEA systemd[1]: Started EC2 instance hibernation setup agent. Sep 27 12:17:41 SparxEA hibinit-agent[1105]: Setting up swapspace version 1, size = 3.9 GiB (4194299904 bytes) Sep 27 12:17:41 SparxEA hibinit-agent[1105]: no label, UUID=16350ccb-d242-40f1-93f5-9fbe280d33ce Sep 27 12:17:41 SparxEA /hibinit-agent: Running: swapon /swap-hibinit Sep 27 12:17:41 SparxEA kernel: [ 25.160330] Adding 4095996k swap on /swap-hibinit. Priority:-2 extents:16 across:11141120k SSFS Sep 27 12:17:41 SparxEA /hibinit-agent: Updating the kernel offset for the swapfile: /swap-hibinit Sep 27 12:17:41 SparxEA /hibinit-agent: Updating GRUB to use the device PARTUUID=4986e35b-1bd5-45d3-b528-fa2edb861a38 with offset 4161536 for resume Sep 27 12:17:42 SparxEA hibinit-agent[1112]: Sourcing file /etc/default/grub' Sep 27 12:17:42 SparxEA hibinit-agent[1112]: Sourcing file /etc/default/grub.d/40-force-partuuid.cfg' Sep 27 12:17:42 SparxEA hibinit-agent[1112]: Sourcing file /etc/default/grub.d/50-cloudimg-settings.cfg' Sep 27 12:17:42 SparxEA hibinit-agent[1112]: Sourcing file /etc/default/grub.d/99-set-swap.cfg' Sep 27 12:17:42 SparxEA hibinit-agent[1112]: Sourcing file `/etc/default/grub.d/init-select.cfg' Sep 27 12:17:42 SparxEA hibinit-agent[1187]: Generating grub configuration file ... Sep 27 12:17:42 SparxEA hibinit-agent[1245]: GRUB_FORCE_PARTUUID is set, will attempt initrdless boot Sep 27 12:17:42 SparxEA hibinit-agent[1245]: Found linux image: /boot/vmlinuz-5.15.0-1019-aws Sep 27 12:17:42 SparxEA hibinit-agent[1245]: Found initrd image: /boot/microcode.cpio /boot/initrd.img-5.15.0-1019-aws Sep 27 12:17:43 SparxEA hibinit-agent[1245]: Found linux image: /boot/vmlinuz-5.13.0-1029-aws Sep 27 12:17:43 SparxEA hibinit-agent[1245]: Found initrd image: /boot/microcode.cpio /boot/initrd.img-5.13.0-1029-aws Sep 27 12:17:43 SparxEA hibinit-agent[1740]: Found memtest86+ image: /boot/memtest86+.elf Sep 27 12:17:43 SparxEA hibinit-agent[1740]: Found memtest86+ image: /boot/memtest86+.bin Sep 27 12:17:45 SparxEA hibinit-agent[1823]: Found Ubuntu 20.04.5 LTS (20.04) on /dev/nvme0n1p1 Sep 27 12:17:46 SparxEA hibinit-agent[3078]: done Sep 27 12:17:46 SparxEA /hibinit-agent: GRUB configuration is updated Sep 27 12:17:46 SparxEA /hibinit-agent: Setting swap device to 66305 with offset 4161536 Sep 27 12:17:46 SparxEA /hibinit-agent: Done updating the swap offset. Turning swapoff Sep 27 12:17:46 SparxEA /hibinit-agent: Running: swapoff /swap-hibinit Sep 27 12:17:46 SparxEA systemd[1]: swap\x2dhibinit.swap: Succeeded. Sep 27 12:17:46 SparxEA systemd[877]: swap\x2dhibinit.swap: Succeeded. Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Effective config: {'log_to_syslog': True, 'log_to_stderr': True, 'mkswap': 'mkswap {swapfile}', 'swapon': 'swapon {swapfile}', 'swapoff': 'swapoff {swapfile}', 'touch_swap': False, 'grub_update': True, 'swap_percentage': 100, 'swap_mb': 4000} Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Will check if swap is at least: 4000 megabytes Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Create swap and initialize it Sep 27 12:17:46 SparxEA hibinit-agent[1103]: kicking child process to initiate the setup Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Allocating 4194304000 bytes in /swap-hibinit Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Swap pre-heating is skipped, the swap blocks won't be touched during to ensure they are ready Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Running: mkswap /swap-hibinit Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Running: swapon /swap-hibinit Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Updating the kernel offset for the swapfile: /swap-hibinit Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Updating GRUB to use the device PARTUUID=4986e35b-1bd5-45d3-b528-fa2edb861a38 with offset 4161536 for resume Sep 27 12:17:46 SparxEA hibinit-agent[1103]: GRUB configuration is updated Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Setting swap device to 66305 with offset 4161536 Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Done updating the swap offset. Turning swapoff Sep 27 12:17:46 SparxEA hibinit-agent[1103]: Running: swapoff /swap-hibinit Sep 27 12:17:46 SparxEA systemd[1]: hibinit-agent.service: Succeeded.

asked 2 years ago196 views
1 Answer
0

Hi There

Please check the prerequisites for hibernation here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html

What type of EBS volume are you using? This can affect the hibernation performance.

Supported EBS volume types

* General Purpose SSD (gp2 and gp3)

* Provisioned IOPS SSD (io1 and io2)

If you choose a Provisioned IOPS SSD volume type, you must provision the EBS volume with the appropriate IOPS to achieve optimum performance for hibernation. For more information, see Amazon EBS volume types.
profile pictureAWS
EXPERT
Matt-B
answered 2 years ago
  • HI Matt, After creating new AMI and launched new instance from new AMI then make it hibernate. Now its getting stopped state with in 1 minutes and 20 seconds. Is this reasonable time to change stopped state when I choose hibernate from AWS console?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions