> For the complete documentation index, see [llms.txt](https://platform9.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform9.com/kb/pmo/solution/instance-cannot-contact-metadata-service-ubuntu-16-04.md).

# Instance Cannot Contact Metadata Service (Ubuntu 16.04)

## Problem

* An instance is unable to contact the metadata service via the metadata proxy IP (169.254.169.254) with an error similar to the following.

{% tabs %}
{% tab title="None" %}

```none
# curl http://169.254.169.254curl: (7) Failed to connect to 169.254.169.254 port 80: No route to host
```

{% endtab %}
{% endtabs %}

* The gateway IP for the metadata proxy route is associated with a reserved DHCP port.
  1. Identify the gateway IP.

```
# route -nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface...169.254.169.254 10.0.0.1 255.255.255.255 UGH 0 0 0 ens3
```

```
2. Track the IP down to a Neutron port.
```

```
# openstack port list --network __NETWORK_ID__ --long --fit-width | grep -w 10.0.0.1
```

```
3. Check the device ID of the port.
```

```
# openstack port show __PORT_ID__ -f value -c device_id
```

```
    - The value should be _**reserved\_dhcp\_port**_. If not, you are likely facing a separate issue with that particular DHCP agent.
```

## Environment

* Platform9 Managed OpenStack - All Versions
* Ubuntu 16.04

## Cause

A DHCP agent failover has occurred and thus the IP/route to the Neutron metadata proxy has changed.

## Resolution

1. Remove the route for the metadata proxy IP.

{% tabs %}
{% tab title="None" %}

```none
# sudo ip route del 169.254.169.254
```

{% endtab %}
{% endtabs %}

2. Run **dhclient**.

{% tabs %}
{% tab title="None" %}

```none
# dhclient -v
```

{% endtab %}
{% endtabs %}

3. Check that the gateway IP for the 169.254.169.254 route has been updated.

{% tabs %}
{% tab title="None" %}

```none
# route -n
```

{% endtab %}
{% endtabs %}

4. Ensure that the metadata service is reachable via the proxy IP.

{% tabs %}
{% tab title="None" %}

```none
# curl http://169.254.169.254
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://platform9.com/kb/pmo/solution/instance-cannot-contact-metadata-service-ubuntu-16-04.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
