Bug 1757656 - Satellite using deleted ssh keypair for provisioning EC2 instance and failing with Failed to create a compute instance xxxx: The key pair 'foreman-xxx' does not exist
Summary: Satellite using deleted ssh keypair for provisioning EC2 instance and failing...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Compute Resources - EC2
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-02 02:34 UTC by Anto P Joseph
Modified: 2020-07-20 13:06 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 4459151 0 None None None 2019-10-02 03:04:42 UTC

Description Anto P Joseph 2019-10-02 02:34:50 UTC
Description of problem:

Satellite using wrong/invalid/deleted ssh keypair and failing EC2 provisioning with following error:

----
Unable to save
Failed to create a compute aws+cr2 (us-west-2-EC2) instance carla-hritz: The key pair 'foreman-20b156c25-b77a-4534-9c9e-da60c1695849' does not exist
----

REASON:
 Satellite use ssh-key name "foreman-xxx" which was created by Satellite upon creating EC2 compute resource. key contents are available in satellite DB and AWS>Keypairs


If above keypair is deleted from AWS Console, Satellite fails with this error.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Create AWS compute resource: 
  
          WebUI: Compute Resources > aws CR > SSH Keys > you can find associated ssh keypair.(foreman-xxx)

2. Goto AWS Console (AWS > EC2 > Key Pairs) and delete mentioned keypair(foreman-xxx) and try to provision Ec2 instance.

3. 

Actual results:

Satellite will still look for DELETED KeyPair and fail.

Expected results:

Satellite Should give us option to CREATE NEW keypair. OR 
Give OPTION to choose NEW/Different keypair.

Additional info:


WORKAROUND:

-------
# hammer compute-resource list
                - Copy exact NAME of the compute resource from the list  Example: aws_cr


# foreman-rake console
# ComputeResource.find_by(:name =>'aws_cr').send(:destroy_key_pair)
# ComputeResource.find_by(:name =>'aws_cr').send(:create_key_pair)
-------

Goto: Satellite WebUI: Compute Resource > Select AWS compute resource > SSH_Keys > Now here you will have the option to create new SSH Key.


Note You need to log in before you can comment on or make changes to this bug.