Why does Azure virtual machine with dual stack network is not able to reach IMDS server 169.254.169.254

Mahudeeswaran Palanisamy 0 Reputation points
2025-01-07T18:47:45.43+00:00

We have our appliance image which is basically a linux machine deployed using Azure SDK (Java), the virtual machine is configured with two network interfaces, both of which is connected to dual stack subnet. After the node is deployed and booting up, as part of cloud-init, it connects to IMDS server to get the metadata, but the request is timing out, logs below.

[ 13.248532] cloud-init[493]: /usr/lib/python3/dist-packages/requests/init.py:87: RequestsDependencyWarning: urllib3 (2.2.3) or chardet (4.0.0) doesn't match a supported version!

[ 13.255596] cloud-init[493]: warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "

[ OK ] Listening on Load/Save RF …itch Status /dev/rfkill Watch.

[ 13.464770] cloud-init[619]: Cloud-init v. 23.1.2-0ubuntu0~22.04.1 running 'init-local' at Mon, 16 Dec 2024 06:05:28 +0000. Up 13.44 seconds.

***[ 45.738883] cloud-init[619]: 2024-12-16 06:06:00,320 - azure.py[WARNING]: Failed to fetch metadata from IMDS: HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /metadata/instance?api-version=2021-08-01&extended=true (Caused by ConnectTimeoutError(

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,216 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sai Krishna Katakam 1,680 Reputation points Microsoft Vendor
    2025-01-08T07:29:49.0033333+00:00

    Hi Mahudeeswaran Palanisamy,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Azure virtual machines with a dual stack network (IPv4 and IPv6) may face connectivity issues with the Instance Metadata Service (IMDS) at 169.254.169.254 due to routing conflicts or misconfigurations. The IMDS is accessible only via IPv4, and if the network configuration prioritizes IPv6, it may prevent successful communication with the IMDS.

    Troubleshooting Steps:

    • Ensure that the network interface is configured to allow IPv4 traffic.
    • Verify that there are no routing conflicts that could affect access to the IMDS.
    • Use the following command to test connectivity to the IMDS;
    curl -H "Metadata: true" "http://169.254.169.254/metadata/instance?api-version=2021-08-01&extended=true"
    
    • A successful response (HTTP status code 200) indicates that the IMDS is reachable.

    User's image

    • Ensure that there are no firewall rules blocking outbound traffic to the IMDS IP address (169.254.169.254).
    • If IPv6 is not required for your application, consider disabling it on the network interface to avoid potential conflicts.

    For more information, please refer to the below documentation:
    Azure Instance Metadata Service

    If an answer has been helpful, please consider accept the "Answer" and "Upvote" to help increase visibility of this question for other members of the Microsoft Q&A community. 

    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.