> 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/pcd/compute/vm-creation-failure-due-to-glance-host-and-stale-ovn-netns-issue.md).

# VM Creation Failure Due to Image Role Host and Stale OVN NetNS Issue

## Problem

VM creation was failing at the volume-from-image stage due to the image role host being in a failed state. The failure was linked to a stale OVN metadata network namespace, which caused the `pf9-neutron-ovn-metadata-agent` to crash, impacting Glance functionality.

## Environment

* Private Cloud Director Virtualization - v2025.4 and Higher
* Private Cloud Director Kubernetes – v2025.4 and Higher
* Self-Hosted Private Cloud Director Virtualization - v2025.4 and Higher
* Self-Hosted Private Cloud Director Kubernetes - v2025.4 and Higher
* Component: Networking and Image Service

## Cause

The root cause was traced to the Image role host being in a failed state. Additionally, a stale/corrupted OVN metadata namespace caused the `pf9-neutron-ovn-metadata-agent` service to fail, which contributed to network namespace issues affecting Image service and possibly volume creation.

## Diagnostics

* Image service backend was not visible in the `openstack volume backend pool list` command output.
* `pf9-neutron-ovn-metadata-agent` was in a failed state with the following critical log in `/var/log/pf9/pf9-neutron-ovn-metadata-agent.log`:

```bash
[TimeStamp] CRITICAL neutron [-] Unhandled error: OSError: [Errno 22] failed to open netns
```

* Stale/invalid NETNS entry found under `/var/run/netns`:

{% code title="Affected Host:" %}

```bash
$ ip netns list
ovnmeta-[ovnnetns-id-1] (id: 0)
ovnmeta-[ovnnetns-id-2]

$ ls -l /var/run/netns
total 0
-r--r--r-- 1 root root 0 [Time Stamp] ovnmeta-[ovnnetns-id-1]
---------- 1 root root 0 [Time Stamp] ovnmeta-[ovnnetns-id-2]
```

{% endcode %}

* The invalid namespace had no permissions and was inaccessible..

## Resolution

* Identified that `pf9-neutron-ovn-metadata-agent` was in a failed state.
* Found a stale NETNS entry with invalid permissions:

```bash
---------- 1 root root 0 Jun [Time Stamp] ovnmeta-[ovnnetns-id-2]
```

* Deleted the stale netns:

```bash
$ sudo ip netns delete ovnmeta-<OVS_NETNS_ID_2>
```

* Restarted the metadata agent:

```bash
$ sudo systemctl restart pf9-neutron-ovn-metadata-agent
```

* Restarted the `glance-api` service to ensure backend availability:

```bash
$ sudo systemctl restart pf9-glance-api
```

## Validation

* Post-remediation, `pf9-neutron-ovn-metadata-agent` started successfully without errors.
* Image service backend was registered properly.
* VM creation using image-backed volume was tested and succeeded.


---

# 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/pcd/compute/vm-creation-failure-due-to-glance-host-and-stale-ovn-netns-issue.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.
