# VM Deployment Failed Due to Insufficient Storage

## Problem

VM deployment using Ephemeral storage fails with "No valid host was found" on ostackhost logs, and "insufficient resources or a temporary occurrence as compute nodes start up" error in Nova-scheduler logs.

```ruby
INFO nova.scheduler.manager [None [Req-UUID] [Project-ID] [User-ID] - - default default] Got no allocation candidates from the Placement API. This could be due to insufficient resources or a temporary occurrence as compute nodes start up.
```

## Environment

* Self-Hosted Private Cloud Director Virtualization - v2025.4 and Higher
* Self-Hosted Private Cloud Director Kubernetes - v2025.4 and Higher

## Cause

VM deployment failed because the requested size surpassed the resource provider's **`max_unit`** allocation. Further details on [\[max\_units\]](https://docs.openstack.org/osc-placement/queens/cli/index.html) allocation.

## Diagnostics

#### On underlying host:

1. Get the VM disk storage path using command given below:

```bash
$ sudo virsh domblklist <VM_UUID>
```

```ruby
$ sudo virsh domblklist <VM_UUID>
 Target   Source
-------------------------------------------------------------------------
 vda      _opt_data_instances_[VM_UUID]_disk
```

2. Check where the VM disk storage path is mounted.

> The OpenStack placement API takes Disk dev mapper size into account when calculating the resource provider's max unit value.

```bash
$ df -lh _opt_data_instances_<VM_UUID>_disk
```

```ruby
$ sudo df -lh _opt_data_instances_[VM_UUID]_disk
Filesystem                         Size  Used Avail Use% Mounted on
[Disk dev mapper path]             98G   69G   25G  74% _
```

Here,

* VM disk storage path is mounted on "/".
* The OpenStack consider this 98 GB size while calculating the resource provider's max unit value.

#### OpenStack CLI:

3. List down all available resource providers. These resource providers are responsible for allocating the CPU, Memory and Storage to the VMs.

```bash
$ openstack resource provider list
```

4. Check for `max_unit` for `Disk_GB` on all resource providers listed above.

> Any VM requesting an ephemeral storage disk above the max\_unit value will fail with "`insufficient resources or a temporary occurrence as compute nodes start up`" error in the nova-scheduler logs.

```bash
$ openstack resource provider inventory list <RESOURCE_PROVIDER_UUID>
```

```ruby
$ openstack resource provider inventory list <RESOURCE_PROVIDER_UUID>
+----------------+------------------+----------+----------+----------+-----------+--------+-------+
| resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size |  total |  used |
+----------------+------------------+----------+----------+----------+-----------+--------+-------+
| VCPU           |             16.0 |        1 |       80 |        0 |         1 |     80 |     6 |
| MEMORY_MB      |              1.5 |        1 |   773663 |      512 |         1 | 773663 | 12288 |
| DISK_GB        |           9999.0 |        1 |       97 |        0 |         1 |     97 |   120 | 
+----------------+------------------+----------+----------+----------+-----------+--------+-------+
```

Here,

The `DISK_GB` for the resource provider is 97GB, a value determined by the VM's disk storage configured for the root (`/`) mount point.

## Resolution

1. Use image which has storage requirements less than the **`max_unit`** value from all available resource providers.
2. It is recommended to use Cinder-backed volumes for VM deployments.

## Validation

1. How much storage is requested by the image used to deploy VM.

```bash
$ openstack image list --all | grep -i <IMAAGE_USED_BY_VM>
$ openstack image show <IMAGE_UUID> --fit
```

```ruby
+------------------+-----------------------------------------------------------------------+
| Field            | Value                                                                 |
+------------------+-----------------------------------------------------------------------+
...                .                                                                       .
| disk_format      | qcow2                                                                 |
| file             | _v2_images_[image_uuid]_file                                          |
| id               | [image_uuid]                                                          |
| min_disk         | 80            <----- Image requires 80 GB disk, within max_unit value |
| min_ram          | 0                                                                     |
| name             | [image_name]                                                          |
...                .                                                                       .
+------------------+-----------------------------------------------------------------------+
```

2. If these steps prove insufficient to resolve the issue, reach out to the [Platform9 Support Team](https://support.platform9.com/hc/en-us) for additional assistance.


---

# 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/self-hosted/vm-deployment-failed-due-to-insufficient-storage.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.
