Troubleshoot VM Metadata Service Connectivity Failures
Problem
A Virtual Machine (VM) cannot reach the OpenStack metadata service at boot, so cloud-init cannot fetch its configuration (SSH keys, hostname, network config, and so on). The VM falls back to a default configuration instead. Symptoms include:
The VM's
cloud-init-output.logshows repeated warnings such as:url_helper.py[WARNING]: Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded ...")] during request to http://169.254.169.254/openstack, raising last exception util.py[WARNING]: No active metadata service foundManually curling the metadata endpoint from inside the VM fails:
$ curl http://169.254.169.254/openstack curl: (7) Failed to connect to 169.254.169.254 port 80 after 3087 ms: Couldn't connect to servercloud-init eventually reports
Used fallback datasourceand generates new SSH host keys instead of applying the expected configuration.
Environment
Private Cloud Director Virtualization - All Versions
Self-Hosted Private Cloud Director Virtualization - All Versions
Component - Networking Service
Prerequisites: Executing OVN Commands
Refer to the existing guide for SaaS Alias setup or Self-Hosted kubectl exec instructions to run ovn-nbctl commands.
Procedure
1. Confirm the Network and Compute Node
2. Check Whether the Metadata Namespace Exists
Log into the compute node identified above and check for the network's metadata namespace.
Success: The namespace is listed. The issue described in this guide is not the cause; continue with general connectivity troubleshooting.
Failure: No output. The
neutron-ovn-metadata-agentnever created the namespace for this network, which matches the symptom in this guide.
3. Identify the Network's Metadata Port
Every network has one dedicated metadata port, distinct from the VM and router ports on the same network.
4. Check the Metadata Port's OVN Type
Expected:
localport.Failure: The command returns nothing (an empty type). This is the root cause: without
type=localport,neutron-ovn-metadata-agentdoes not create theovnmeta-<NETWORK_ID>namespace, so no VM on that network can reach169.254.169.254.
5. Restore the Port Type
neutron-ovn-metadata-agent creates the ovnmeta-<NETWORK_ID> namespace within a few seconds of this change, and metadata access is restored for all VMs on the network without a restart.
6. Recover Cloud-Init on Affected VMs
If a VM already fell back to a default configuration during boot (visible as Used fallback datasource in its cloud-init-output.log), reboot the VM once metadata access is restored so cloud-init can retry against the metadata service. Rebooting alone is sufficient; the VM does not need to be recreated.
If these steps prove insufficient to resolve the issue, reach out to the Platform9 Support Team for additional assistance. Because the trigger for the port type change is still being investigated, include the network ID and approximate time of occurrence when you contact Support so the case can be tracked.
Most Common Causes
The network's OVN metadata logical switch port has its
typeunexpectedly reset fromlocalportto empty, which stopsneutron-ovn-metadata-agentfrom creating the network's metadata namespace. This has been observed rarely, and the exact trigger is not yet fully understood.
Last updated
