# Image Creation Failed Using CLI

## Problem

> When image creation failures occur during VM image uploads through the OpenStack or [pcdctl](https://platform9.com/docs/private-cloud-director/private-cloud-director/pcdctl-command-line) command-line tool, this troubleshooting guide provides resolution steps.

## Environment

* Private Cloud Director - v2025.4 and Higher.
* Self-Hosted Private Cloud Director Virtualisation – v2025.4 and Higher.

## Procedure

{% stepper %}
{% step %}
**Prerequisites**

Ensure the the [prerequisites](https://platform9.com/docs/private-cloud-director/private-cloud-director/pre-requisites#image-library-prerequisites) are met. Also refer to the documentation about [importing image via CLI](https://platform9.com/docs/private-cloud-director/private-cloud-director/image-library---images#importing-images-via-the-cli).
{% endstep %}

{% step %}
**Source OpenStack credentials**

Source the OpenStack `admin.rc` file. Ensure that `OS_USERNAME` and `OS_PASSWORD` are correct as per your <code class="expression">space.vars.product\_name</code> account.
{% endstep %}

{% step %}
**Verify permissions**

Ensure you have `administrator` permission to upload the image.
{% endstep %}

{% step %}
**Set OS\_INTERFACE**

Make sure that the `OS_INTERFACE` variable is set to the `admin` value as specified in the UI as mentioned in the [documentation](https://platform9.com/docs/private-cloud-director/private-cloud-director/image-library---images#step-3---upload-the-image).
{% endstep %}

{% step %}
**Run OpenStack CLI in debug/verbose mode**

Use command debug mode during image creation to get detailed output.

{% tabs %}
{% tab title="Command" %}
{% code title="openstack debug" %}

```bash
$ openstack --debug image create 
or 
$ openstack --verbose image create
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}
**Review glance logs (Self-Hosted PCD)**

Review glance server logs in the `glance-api` pod logs for Self-Hosted PCD. On the host, check `/var/log/pf9/glance-api.log` to track relevant events against a specific image ID.
{% endstep %}

{% step %}
**Get glance endpoints**

Get the glance API public endpoint:

{% tabs %}
{% tab title="Command" %}
{% code title="list glance endpoints" %}

```bash
$ openstack endpoint list --service glance
$ openstack endpoint list --service glance-cluster
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}
**Verify glance API**

Verify the glance API service by connecting to the glance endpoint. It will return the version, status and other details.

{% tabs %}
{% tab title="Command" %}
{% code title="curl glance" %}

```bash
$ curl -s https://<PCD_FQDN>/glance/
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}
**Contact Support**

If these steps do not resolve the issue, reach out to the [Platform9 Support Team](https://support.platform9.com/) for additional assistance.
{% endstep %}
{% endstepper %}

## Most common causes

* Glance service on the underlying host is down.
* Glance host is unreachable from the VM from where the upload is being performed.
* OpenStack `admin.rc` file does not have the `OS_INTERFACE` variable set to the `admin`.
* The `--insecure` flag was not used as the Glance node uses self-signed certificates.
* The user does not have sufficient permissions to perform the image upload.
* Ensure that the glance [Pre-Requisites](https://platform9.com/docs/private-cloud-director/private-cloud-director/image-library---images#prerequisites) are met.


---

# Agent Instructions: 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:

```
GET https://docs.platform9.com/private-cloud-director/2026.1/images-and-image-library/troubleshooting-and-log-files/image-creation-failed-using-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
