leapp
leapp copied to clipboard
v0.9.0 SSM session list only show instance names of a few instances
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:
- Select an AWS session to activate
- Click on 'View SSM sessions'
- Select a region
- 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
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
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.
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 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.
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:
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.
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
Understood, that makes sense. Thank you for your quick responses!
Thank you @jonasoneves for your contribution!
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.
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
is still issue still valid?
I will have to defer to @jonasoneves for comment on that, I'm no longer on the team using Leapp.
@andreacavagna01 Yes, this is still an issue.