> 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/creating-instances-from-new-image-fail.md).

# Creating Instances from Newly Added Image Fail with Error ‘Corrupt Image Download’

## Problem

Instance creation with newly added image in Glance Image Library fails with the below error in */var/log/pf9/ostackhost.log* on the compute host.

{% tabs %}
{% tab title="/var/log/pf9/ostackhost.log" %}

```bash
ERROR nova.image.glance [<request_UUID>] Error writing to /opt/pf9/data/instances/_base/<base_disk_UUID>.part: [Errno 32] Corrupt image download. Checksum was a1b2c3d4 expected p5q6r7s8: BrokenPipeError: [Errno 32] Corrupt image download. Checksum was a1b2c3d4 expected p5q6r7s8

ERROR nova.compute.manager [<request_UUID>] [instance: <instance_UUID>] Instance failed to spawn: BrokenPipeError: [Errno 32] Corrupt image download. Checksum was a1b2c3d4 expected p5q6r7s8
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed OpenStack - All Versions
* Glance
* Images
* Nova

## Cause

* For larger images that are copied over the network (via SCP, FTP, etc) to the Image Library directory directly, the image transfer can take a longer time. In such a case, Image Library could calculate the checksum of a partial image and store it in glance-registry.
* As the checksum differs from the image downloaded by Nova and the image in the Image Library directory, instances creation from that image will fail.

{% hint style="info" %}
**Info**

Image Library adds the metadata with the checksum of the glance image to the glance-registry from the image content monitored directory ( [Image Library directory](https://platform9.com/docs/openstack/infrastructure-configure-host-as-image-library) default path: */var/opt/pf9/imagelibrary/data/* ).
{% endhint %}

## Resolution

1. Remove the existing problematic image from the glance:

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

```bash
$ glance image-delete <image-name>
```

{% endtab %}
{% endtabs %}

2. The recommended method is to transfer the image to Glance hosts in a temporary/home directory and then move it to the image content monitored directory.

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

```bash
$ scp myimage.img <username>@<glance-host>:/tmp/
$ ssh <username>@<glance-host>
$ mv /tmp/myimage.img /var/opt/pf9/imagelibrary/data/
```

{% endtab %}
{% endtabs %}

**OR**

2. Use the *glance image-create* command to upload the image, Refer [Managing Images with CLI](https://platform9.com/docs/openstack/images-mange-images-cli) article.

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

```bash
$ qemu-img info myimage.img
image: myimage.img
file format: qcow2
virtual size: 39M (41126400 bytes)
disk size: 13M
cluster_size: 65536

$ glance image-create --disk-format qcow2
--container-format bare
--file /tmp/myimage.img
--visibility public
--name myimage
--property pf9_description='best image ever'
--property pf9_virtual_size=41126400
```

{% 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 following URL with the `ask` and `goal` query parameters:

```
GET https://platform9.com/kb/pmo/solution/creating-instances-from-new-image-fail.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 `build a script that syncs our docs to a CMS` 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.
