Skip to content

Improve retrying method of connections to IMDS not to cause much connections within a few seconds #129

@sugitk

Description

@sugitk

On AL2023, when the instance cannot receive the correct response from the IMDS, the ec2net retries the connection 60 times within a few seconds and it fails to configure the update with these errors below.

ec2net[344204]: [get_meta] Querying IMDS for network/interfaces/macs/xx:xx:xx:xx:xx:xx/device-number
ec2net[344204]: Got IMDSv2 token for interface ens5 from http://169.254.169.254/latest via ens5
ec2net[344204]: [get_meta] Querying IMDS for network/interfaces/macs/xx:xx:xx:xx:xx:xx/device-number
ec2net[344204]: Got IMDSv2 token for interface ens5 from http://169.254.169.254/latest via ens5
ec2net[344204]: [get_meta] Querying IMDS for network/interfaces/macs/xx:xx:xx:xx:xx:xx/device-number
ec2net[344204]: Got IMDSv2 token for interface ens5 from http://169.254.169.254/latest via ens5
...
ec2net[344204]: [get_meta] Querying IMDS for network/interfaces/macs/xx:xx:xx:xx:xx:xx/device-number
ec2net[344204]: Got IMDSv2 token for interface ens5 from http://169.254.169.254/latest via ens5
ec2net[344204]: Unable to identify device-number for ens5 after 60 attempts
ec2net[344204]: Unable to identify device-number for ens5 in IMDS
systemd[1]: refresh-policy-routes@ens5.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: refresh-policy-routes@ens5.service: Failed with result 'exit-code'.
systemd[1]: Failed to start refresh-policy-routes@ens5.service - Refresh policy routes for ens5.

And when the ec2net failure, refresh-policy-routes@ens5.service will also fail with the status 1/FAILURE as the above log. However it doesn't impact to the OS and network configuration immediately, can you consider lowering the priority from err to warning ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions