Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error deregistering image (--delete-ami) #14

Open
rafaeltuelho opened this issue Jun 5, 2023 · 5 comments
Open

error deregistering image (--delete-ami) #14

rafaeltuelho opened this issue Jun 5, 2023 · 5 comments

Comments

@rafaeltuelho
Copy link

rafaeltuelho commented Jun 5, 2023

Getting this error when using --delete-ami

[INFO] 2023-06-05 12:31:49,365 ec2-spot-converter - [STEP 22/26] Reboot new instance (if needed and requested)... 
[INFO] 2023-06-05 12:31:49,365 ec2-spot-converter -   => SUCCESS. No reason to reboot instance 'i-0113bca587b7f5c14'... Skipping...
[INFO] 2023-06-05 12:31:49,568 ec2-spot-converter - [STEP 23/26] Update CloudWatch alarms... => SKIPPED! Need '--update-cw-alarms' argument.
[INFO] 2023-06-05 12:31:49,568 ec2-spot-converter - [STEP 24/26] Untag resources... 
[INFO] 2023-06-05 12:31:49,870 ec2-spot-converter -   => SUCCESS. Successfully untagged ['i-0113bca587b7f5c14', 'eni-0e2f07f1dbb86ca46'].
[INFO] 2023-06-05 12:31:50,102 ec2-spot-converter - [STEP 25/26] Waiting for instance to be at expected states in target groups... => SKIPPED! Need '--wait-for-tg-states' argument.
[INFO] 2023-06-05 12:31:50,102 ec2-spot-converter - [STEP 26/26] Deregister image... 
Traceback (most recent call last):
  File "/Users/rsoares/dev/github/rafaeltuelho/sno-for-100/.run/ec2-spot-converter", line 1621, in <module>
    sys.exit(main(sys.argv))
             ^^^^^^^^^^^^^^
  File "/Users/rsoares/dev/github/rafaeltuelho/sno-for-100/.run/ec2-spot-converter", line 1587, in main
    return_code, reason, keys = step["Function"]()
                                ^^^^^^^^^^^^^^^^^^
  File "/Users/rsoares/dev/github/rafaeltuelho/sno-for-100/.run/ec2-spot-converter", line 1212, in deregister_image
    snap_ids = [blk["Ebs"]["SnapshotId"] for blk in img["BlockDeviceMappings"]]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rsoares/dev/github/rafaeltuelho/sno-for-100/.run/ec2-spot-converter", line 1212, in <listcomp>
    snap_ids = [blk["Ebs"]["SnapshotId"] for blk in img["BlockDeviceMappings"]]
                ~~~^^^^^^^
KeyError: 'Ebs'
@rafaeltuelho rafaeltuelho changed the title error deregistering image (--ami-delete) error deregistering image (--delete-ami) Jun 5, 2023
@TakashiSeven
Copy link

hello does the tool still work as of october 2024 ?

@frakon
Copy link

frakon commented Nov 18, 2024

Update NOVEMBER 2024:

The Tool WORKS PERFECTLY upto STEP 25/26. Without the option '--delete-ami' it works fully (through out all steps). If the option '--delete-ami' is specified, it throws an error in STEP 26/26 and does not open the changed machine json state for comparison. But the machine is completely converted, only the AMI image must be deleted manually.

The still received error if '--delete-ami' is specified:

ec2-spot-converter - [STEP 26/26] Deregister image...
Traceback (most recent call last):
  File "/home/ubuntu/./ec2-spot-converter", line 1621, in <module>
    sys.exit(main(sys.argv))
  File "/home/ubuntu/./ec2-spot-converter", line 1587, in main
    return_code, reason, keys = step["Function"]()
  File "/home/ubuntu/./ec2-spot-converter", line 1212, in deregister_image
    snap_ids = [blk["Ebs"]["SnapshotId"] for blk in img["BlockDeviceMappings"]]
  File "/home/ubuntu/./ec2-spot-converter", line 1212, in <listcomp>
    snap_ids = [blk["Ebs"]["SnapshotId"] for blk in img["BlockDeviceMappings"]]
KeyError: 'Ebs'

@jcjorel
Copy link
Owner

jcjorel commented Nov 18, 2024 via email

@frakon
Copy link

frakon commented Nov 19, 2024

Hello, further info:

  • instance types: m5zn.metal -> c5a.4xlarge (spot -> spot)
  • volume info:
    • RootDeviceType: EBS
    • EBS Optimization: Disabled
    • Type: gp2
    • Size: 200 MB
    • IOPS: 600

@jcjorel
Copy link
Owner

jcjorel commented Nov 23, 2024

Hi,

Could you send me the JSON content of the column 'ConversionStartInstanceState' of the DynamoDB table named 'ec2-spot-converter-state-table' and located in the row describing the context of the instance ID you are trying to convert?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants