# How to Setup resource allocation ratios in PCD for the hosts in cluster?

## Problem

How to setup and configure host resource like cpu, memory and disk allocation ratio in PCD?

How to ensure the instances are spawned on hosts with specific resource allocation ratio mapped?

## Environment

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

## Procedure

> It is necessary to ensure that the target set of hosts to be used for the isolation should belong to a PCD host cluster and should be added to the newly created aggregate from the UI

* From the PCD UI create a [**host cluster**](https://platform9.com/docs/private-cloud-director/private-cloud-director/virtualized-cluster#creating-a-cluster) and add the required hosts
* From the PCD UI create an [**aggregate**](https://platform9.com/docs/private-cloud-director/private-cloud-director/host-aggregate) with required hosts mapped into it.
* Set the required metadata tag to the aggregate:

![](https://uploads.developerhub.io/prod/K9yg/zc8hs146z4mbx2a4zuvewuwti9arkaw6t27qrdq7hm1o1rfizekb1w8sd0p7bqri.png)

* Create a flavor with matching metadata to the aggregate thus created:

![](https://uploads.developerhub.io/prod/K9yg/4fteecpwoj4iqqvfdz98ukx85denqg858hqz6xta5fhu03wx6p3sro0tvmy4m60q.png)

* From the clusters host page, select the specific host that is part of the host aggregate as well the host cluster and set the allocation ratio values:

![](https://uploads.developerhub.io/prod/K9yg/2frknp3vbd6of8e9o1w9r3ya83c53ztmikdv0gw58wv6u3u2dh27y9uhd38dc7zw.png)

## Validation

* Deploy an instance by selecting the cluster to which the specific host belongs:

![](https://uploads.developerhub.io/prod/K9yg/ab6qkj6cct3skz2bvtlvthf22attn6h7j1z9fxdjl7vxgyaat9tja4344nib6dk2.png)

* In the next section select the flavor that has the specific tag matching and applied:

![](https://uploads.developerhub.io/prod/K9yg/ilxasn6iyj90aaxs12c40f32h1ag9kvw6p8skae2p2ath6ck9e9sn1qk17buj23j.png)

* Complete the subsequent instance creation form and continue to deploy the VM.

## Additional Information

* The actual allocation ratios will be placed within the placement API DB instead of host-level changes.
* When successfully applied, the values can be reviewed by looking at the resource provider inventory list for the specific hosts:

```bash
$ openstack resource provider list
+-------------------+---------------------+------------+--------------------+----------------------+
| uuid              | name                | generation | root_provider_uuid | parent_provider_uuid |
+-------------------+---------------------+------------+--------------------+----------------------+
| [RESOURCE1_UUID]  | [HOST1.EXAMPLE.COM] |          4 | [PROVIDER1_UUID] 	| None                 |
| [RESOURCE2_UUID]  | [HOST2.EXAMPLE.COM] |          8 | [PROVIDER2_UUID]   | None                 |
| [RESOURCE3_UUID]  | [HOST3.EXAMPLE.COM] |          4 | [PROVIDER3_UUID]   | None                 |
| [RESOURCE4_UUID]  | [HOST4.EXAMPLE.COM] |          3 | [PROVIDER4_UUID]   | None                 |
+-------------------+---------------------+------------+--------------------+----------------------+

$ openstack resource provider inventory list <RESOURCE1_UUID>
+----------------+------------------+----------+----------+----------+-----------+-------+------+
| resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size | total | used |
+----------------+------------------+----------+----------+----------+-----------+-------+------+
| VCPU           |              1.0 |        1 |        8 |        0 |         1 |     8 |    0 |
| MEMORY_MB      |              1.0 |        1 |    15988 |      512 |         1 | 15988 |    0 |
| DISK_GB        |           9999.0 |        1 |      125 |        0 |         1 |   125 |    0 |
+----------------+------------------+----------+----------+----------+-----------+-------+------+
```


---

# 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/compute/how-to-setup-resource-allocation-ratios-in-pcd-for-the-hosts-in-cluster.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.
