-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
add_cloud_metadata detecting wrong cloud provider (aws as openstack) #13816
Comments
Beats 7.4 introduced a new setting to select the providers to query. Original PR #13812 If all your instances run on AWS, you can configure the processor as follows:
|
Thanks for the information. We are currently running beats v6.x and it's unlikely we will upgrade to v7 in the short term, so we may have to live with this one. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is there any way to fix? Another user has reported the issue. |
Pinging @elastic/integrations (Team:Integrations) |
Hi! We're labeling this issue as |
👍 |
Hi! We're labeling this issue as |
The suggested workaround is not available to Elastic Agent users who cannot modify the configuration for the
|
We just upgraded Elastic Agent from
|
I'm encountering this with 8.11.x. AWS is being misidentified as Openstack. |
Same here. Just tested migrating to 8.11 from 8.5 and found out some data was mislabeled as "openstack" |
Also hitting this issue on 8.11 agent. Edit: One thing that I found was a bit more helpful in generally fixing this issue was to ensure the IMDSv2 was set to required, not entirely sure why that makes a difference, but at least in my case it did. |
I am hitting the same issue in 8.11 and resolved it by adding processor in each of system integration outputs (very painful as I could not find a global way to do so) in the fleet managed elastic agents.
|
I think I found a workaround that can use the @Custom ingest pipeline that will require less specific workarounds.
|
I think this makes sense, but may require a substantial amount of testing. Another option that involves fewer changes would be to check if the OpenStack-specific endpoint exists, and then continue using the EC2-compatible endpoint for returning the values. Ideally we should have some automated integration testing for this. Probably not running all the time, possibly just on-demand. I was looking for an easy way to test against OpenStack and found https://microstack.run/docs/single-node; I tried it in an EC2 instance and it's timing out, so not sure if that's a viable option. EDIT: managed to get it |
Experiencing this using fleet, agent v8.14.3 Our infra is AWS, EC2 Still seeing:
We have tried to find a way to force configuration via fleet to:
but so far no luck. If it makes a difference, we are registering our ephemeral ec2 instances via cron on startup:
Any advice would be greatly appreciated |
Some additional information (for my case, at least) - I noticed that our fleet server instance is getting the correct cloud.provider and service - it appears that the instances using the fleet-configured |
I had a look into this and the following are my observations. Background The root cause have few aspects, first the openstack implementation 1 relies on the EC2-compatible metadata 2 endpoints. Then the both Openstack and EC2/AWS implementations are enabled by default 3 4. (note - Local is a misleading name) For AWS EC2 instances that enforce IMDSv2, openstack metadata fetch fails as IMDSv2 require a session token 5 to access endpoints (as observed here - #13816 (comment)). This makes Openstack implementation to fail where EC2 metadata fetch wins the race condition. Action I am looking into migrating openstack implementation to use Nova metadata service 6 as proposed by many. Further, while this is being investigated, a workaround here is to use the processors:
- add_cloud_metadata:
providers:
aws Footnotes
|
#41636 attempts to fix this by adding priority to AWS/EC2 & Azure metadata fetch mechanisms. I had to do this as I was unable to get a stable Openstack instance to validate their dedicated metadata endpoints. |
I am running a large number of instances in AWS which have multiple beat agents running on them (metricbeat, winlogbeat and filebeat). A small percentage of instances are starting up and detecting that they are running on 'openstack' instead of 'ec2' (ie,
meta.cloud.provider=openstack
).Looking through the code and the way the cloud platform is detected, it's not very surprising that this is occurring as it looks like the endpoints/paths used by EC2 and Openstack both collide with each other. This appears to be have been briefly discussed as a potential issue in the original pull request that added Openstack as a cloud provider: #7663 (comment) but it doesn't look like the concern was addressed.
Perhaps using the non-ec2 compatible Openstack metadata endpoint would be a simple solution to avoid this?
https://docs.openstack.org/nova/latest/user/metadata.html#metadata-openstack-format
Version:
libbeat v6.8.2
Operating System:
Experienced on Windows but would affect all.
Discuss Forum URL:
Not created by me but a pre-existing one:
https://discuss.elastic.co/t/add-cloud-metadata-wrong-provider/189780
Steps to reproduce:
Starting beat on AWS EC2 instances can sometimes result in
openstack
being identified as theprovider
:INFO add_cloud_metadata/add_cloud_metadata.go:323 add_cloud_metadata: hosting provider type detected as openstack, metadata={"availability_zone":"ap-southeast-2a","instance_id":"i-xxxxxxxxxxxxxxx","instance_name":"ip-10-xx-xx-xx","machine_type":"r5d.2xlarge","provider":"openstack"}
The text was updated successfully, but these errors were encountered: