leapp icon indicating copy to clipboard operation
leapp copied to clipboard

v0.9.0 SSM session list only show instance names of a few instances

Open jonasneves-signifyd opened this issue 2 years ago • 14 comments

Describe the bug The SSM sessions list only shows the name of a few instances, for all other instances the instance id is shown instead. However, this is inconsistent, sometimes the list doesn't show the name of any instance.

Leapp Version v0.9.0

To Reproduce Steps to reproduce the behavior:

  1. Select an AWS session to activate
  2. Click on 'View SSM sessions'
  3. Select a region
  4. See most of the instances in the list with instance id only

Expected behavior All instances with Tag:Name defined have their names shown in the list

Desktop (please complete the following information):

  • OS: macOS Big Sur
  • OS Version 11.6
  • Leapp Version v0.9.0

jonasneves-signifyd avatar Mar 01 '22 16:03 jonasneves-signifyd

Hi @jonasoneves, thank you for the feedback!

As you can see in the the method reported below, it checks if the SSM-enabled instance have a Tag:Name. If an instance has no Tag:Name, it will fallback to the instanceId, as you experienced in your Leapp installation. Please, check if all the EC2 instances - that are labeled with the instanceId - have a Tag:Name associated with them. If yes, we have to further investigate this issue.

https://github.com/Noovolari/leapp/blob/e4f347cd083b71fb19808a447fc8b420fcfd7b90/src/app/services/ssm.service.ts#L121

ericvilla avatar Mar 02 '22 12:03 ericvilla

Hi @ericvilla! Thanks for your response.

Yes, most of the instances have tag:Name set. We have 2 instances (out of 163) with no tag:Name (which are dynamic instances created by EMR), which would be easy to identify in the list since most of our instances do have tag:Name defined. However, only a few instances in the list (sometimes none of them) show their names.

jonasneves-signifyd avatar Mar 02 '22 16:03 jonasneves-signifyd

Hi @jonasoneves, may you check if the aws ec2 describe-instances command output contains more than one Reservation? This could be the reason why EMR-provisioned instances are not listed with their Tag:Name value.

ericvilla avatar Mar 07 '22 14:03 ericvilla

@ericvilla the (2) EMR instances are the only ones that don't have tag:Name defined, so it's expected to appear in the list with just ids. All other (163) instances do have tag:Name defined though, and still only show ids.

jonasneves-signifyd avatar Mar 07 '22 14:03 jonasneves-signifyd

Ok, understood! Please, can you check whether aws ec2 describe-instances lists all instances in a single Reservation or in multiple ones? This could be the issue :suspect:

ericvilla avatar Mar 07 '22 15:03 ericvilla

Yes, 117 reservation ids.

Is that already a known issue then? Since we have no control over reservation ids, as it's something that AWS assigns automatically for launched intances.

jonasneves-signifyd avatar Mar 08 '22 14:03 jonasneves-signifyd

Thank you @jonasoneves! I think we'll solve this issue by iterating over aws ec2 describe-instances output "Reservations" array. As far as now, we're taking only instances of the first available Reservation

ericvilla avatar Mar 08 '22 14:03 ericvilla

Understood, that makes sense. Thank you for your quick responses!

jonasneves-signifyd avatar Mar 08 '22 14:03 jonasneves-signifyd

Thank you @jonasoneves for your contribution!

ericvilla avatar Mar 08 '22 14:03 ericvilla

Noted this seems resolved in the 0.10.0 release notes, but I am seeing this behavior still where a small random set of instances in the SSM Session window show up with Tag:Name each time I check.

zswanson avatar Mar 10 '22 15:03 zswanson

Thank you @zswanson for the quick feedback!

You can try to log the response of the following ec2Client.describeInstance call: https://github.com/Noovolari/leapp/blob/158ef8f90547a816f84c46db2a791c838b5117de/src/app/services/ssm.service.ts#L121 This will give us a clearer idea of the issue!

To setup and run the solution locally, please follow the DEVELOPMENT.md guide

ericvilla avatar Mar 10 '22 15:03 ericvilla

is still issue still valid?

andreacavagna01 avatar Jun 30 '22 11:06 andreacavagna01

I will have to defer to @jonasoneves for comment on that, I'm no longer on the team using Leapp.

zswanson avatar Jul 05 '22 20:07 zswanson

@andreacavagna01 Yes, this is still an issue.

jonasneves-signifyd avatar Jul 11 '22 14:07 jonasneves-signifyd