> 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/generic/unable-to-delete-network-host-config-from-ui.md).

# Unable to Delete Network Host Config from UI

## Problem

Unable to delete network host config from the UI, even if the host is not using it.

## Environment

* Private Cloud Director Virtualization - till 2025.4-497
* Self-Hosted Private Cloud Director Kubernetes - till 2025.4-497
* Component: Blueprint

## Cause

The host configuration was previously associated with a host that has since been decommissioned. However, a **stale mapping entry** remains between the host and the host configuration in the `host_to_hostconfig_map` table of the Resource Manager database.

This issue is tracked under bug **PCD-407** and is now fixed in PCD 2025.6-151 and later releases, which prevent new stale mappings from being created.

{% hint style="warning" %}
Existing stale entries from earlier versions will persist after the upgrade; it's recommended to follow the steps mentioned in the Workaround to delete the stale entries.
{% endhint %}

## Workaround

* Retrieve the token:

```bash
token=$(openstack token issue -f value -c id)
```

* Get the list of host configs:

```bash
curl -s -X GET   -H "X-Auth-Token: $token"   https://<PCD_FQDN>/resmgr/v2/hostconfigs | jq '.[] | {id, name}'

# Sample Output:
{
  "id": "[HOSTCONFIG_ID_1]",
  "name": "[HOSTCONFIG_NAME_1]"
}
{
  "id": "[HOSTCONFIG_ID_2]",
  "name": "[HOSTCONFIG_NAME_2]"
}
{
  "id": "[HOSTCONFIG_ID_3]",
  "name": "[HOSTCONFIG_NAME_3]"
}
```

* Get the list of hosts that use the host config that needs to be deleted:

```bash
curl -s -X GET   -H "X-Auth-Token: $token"   https://<PCD_FQDN>/resmgr/v2/hosts   | jq -c '.[] | select(.hostconfig_id == "<HOSTCONFIG_ID>") | {id, hostname: .info.hostname, hostconfig_id}'

# Sample Output:
{
  "id": "[HOST_ID_1]",
  "hostname": "[HOSTNAME_1]",
  "hostconfig_id": "[HOSTCONFIG_ID]"
}
{
  "id": "[HOST_ID_2]",
  "hostname": "[HOSTNAME_2]",
  "hostconfig_id": "[HOSTCONFIG_ID]"
}
```

* Delete the stale host config mapping. Run below for each `[HOST_ID]`returned in the output of the command executed in the above output

```bash
curl -s -X DELETE   -H "X-Auth-Token: $token"   "https://<PCD_FQDN>/resmgr/v2/hosts/<HOST_ID>/hostconfig/<HOSTCONFIG_ID>"
```

* Delete the host Configuration after removing all the mappings

```bash
curl -s -X DELETE -H "X-Auth-Token: $token" "https://<PCD_FQDN>/resmgr/v2/hostconfigs/<HOSTCONFIG_ID>"
```

## Validation

Check the UI to confirm that the previously stale host configuration no longer appears.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://platform9.com/kb/pcd/generic/unable-to-delete-network-host-config-from-ui.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
