# VM Deployment Fails Due to Missing Image Data on the Image Library Shared Storage

## Problem

VM creation in the region was failing with repeated retry errors due to missing image data in the Image Library’s shared storage.

{% code title="UI Error" %}

```
Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance <INSTANCE_ID>. Last exception: Failed to call glance method data with args ('<IMAGE_ID>',), {} on endpoints ['https://10.1
nova.exception.MaxRetriesExceeded: Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance <INSTANCE_ID>. Last exception: Failed to call glance method data with args ('<IMAGE_ID>',), {} on endpoints ['https://<ENDPOINT_IP1>:9494', 'https://<ENDPOINT_IP2>:9494', 'https://<ENDPOINT_IP3>:9494']
```

{% endcode %}

## Environment

* Private Cloud Director Virtualization - All versions
* Self-Hosted Private Cloud Director Virtualization - All versions
* Component: Image library

## Cause

1. The Shared Storage option in the Image Library was disabled.
2. Images were uploaded before the NFS-backed storage was in use.
3. Once shared storage was enabled or mounted, the previously stored image files were no longer present on the new backend.
4. Image services still reported these images as active in the database, but the underlying files were missing.
5. As a result, compute failed to fetch the image data required for instance creation.

## Diagnostics

1. Check the Image Library backend directory (`/var/lib/glance/images/glance` )

   The directory existed but contained no actual image files:

   <pre data-title="Image Library Host"><code>$ cd /var/lib/glance/images/glance
   $ ls -al
   total 12
   drwxr-xr-x 3 pf9 pf9group 4096 Nov 11 22:02 .
   drwxr-xr-x 3 pf9 pf9group 4096 Nov 11 22:02 ..
   drwxr-xr-x 2 pf9 pf9group 4096 Nov 11 22:02 snapshot
   </code></pre>
2. Verify NFS mount<br>

   <pre data-title="Image Library Host"><code>$ df -h
   &#x3C;NFS_FQDN>:/&#x3C;LOCATION>  2.0T  426G  1.6T  22% /var/lib/glance/images
   </code></pre>
3. Confirm connectivity to NFS server using nslookup and ping<br>

   <pre data-title="Image Library Host"><code>$ nslookup &#x3C;NFS_FQDN>
   $ ping &#x3C;IP>
   </code></pre>
4. Inspect Cluster Blueprint
   1. The Shared Storage option in the Image Library section of the cluster blueprint was found to be disabled. If shared storage is required for image hosting, this option must be enabled.

## Resolution

1. Enable Shared Storage
   1. In the region’s Cluster Blueprint, under **Image Library → Shared Storage**
2. Upload a new image after enabling shared storage
   1. Previously uploaded images cannot be recovered because their data no longer exists on the NFS path.
3. Wait for the new image to reach active state.
4. Attempt VM creation using the newly uploaded image.
5. Verify that the new VM deploys successfully.

## Validation

Perform the following checks to ensure the issue is resolved:

1. Confirm that new image files exist on NFS backend.<br>

   <pre data-title="Image Library Host"><code>$ ls -al /var/lib/glance/images
   </code></pre>
2. Check image status<br>

   ```
   $ openstack image list --long
   ```
3. Create a test VM<br>

   ```
   $ openstack server create --flavor m1.tiny --image <NEW_IMAGE_ID> --network <NETWORK> <INSTANCE_NAME>
   ```

## Additional Information

This issue typically occurs when image uploads are performed before shared storage is fully configured or mounted.


---

# 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://platform9.com/kb/pcd/image-library/vm-deployment-fails-due-to-missing-image-data-on-the-image-libra.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.
