disk_allocation_ratio does not work with placement API

Bug #1681658 reported by nirendra
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Medium
Unassigned

Bug Description

disk_allocation_ratio is not working with Ocata since we are checking if requested amount is less than max_unit.
Because of this if I have a compute with 64GB local disk and I'm using iSCSI storage then even after setting disk_allocation_ratio to 9999.0 I can not create a VM with 80GB as root disk.

Following code segment in objects/resource_provider.py is causing this to fail:
                _INV_TBL.c.resource_class_id == r_idx,
                (func.coalesce(usage.c.used, 0) + amount <= (
                    _INV_TBL.c.total - _INV_TBL.c.reserved
                ) * _INV_TBL.c.allocation_ratio),
                _INV_TBL.c.min_unit <= amount,
                _INV_TBL.c.max_unit >= amount,

Environment:
# openstack --version
openstack 3.8.1

Tags: scheduler
Sean Dague (sdague)
tags: added: scheduler
Changed in nova:
importance: Undecided → Medium
Jay Pipes (jaypipes)
Changed in nova:
status: New → Won't Fix
Revision history for this message
Chris Dent (cdent) wrote :

This is the correct behavior. min_unit and max_unit describe the minimum and maximum amounts that any single allocation must fit within. However it's not entirely clear if that describe your case as you've not said what your inventory settings are.

Assuming your max_unit is <80 then that means an 80GB allocation is not possible, whatever allocation_ratio is set to.

What allocation_ratio does is modify the apparently available total capacity for all all allocations.

max_unit is the biggest any single allocation can be
step_size is the "chunk size" of any allocation. For example if '5' any allocation must be a multiple of 5 and:

* more than min_unit
* less than max_unit
* and within the remaining capacity where capacity = ((total - reservered) * allocation_ration) - amount already allocated)

Please follow up if this doesn't explain things.

Revision history for this message
Jay Pipes (jaypipes) wrote :

This is correct behaviour. The max_unit value represents the maximum limit of the resource on the compute node. In this case, you can't put a disk of size 80GB on a compute node with 64GB of physical disk space.

If you had a compute node with 100GB of disk space, you could, however, set your allocation ratio to 9999.0 and launch 2 VMs requesting 80GB of disk space.

Revision history for this message
nirendra (nirendra) wrote :

Find below the scenario I'm trying:
1. Create a Cinder volume of size 100GB
2. Spawn a VM using this volume
  i.) Select a flavor with "Root Disk (GB)" of size 80GB
3. My compute has 20GB space in root disk
4. Nova placement API still skips the hosts by checking root disk size on compute

Since we are using cinder volume to create this VM do we still need to check for root disk size on the host?

Revision history for this message
Jay Pipes (jaypipes) wrote :

@nirendra: yes, please select a flavor with a root disk 20GB or less.

Revision history for this message
Daniel (leaberry) wrote :

This is a poor design decision in my opinion and took a while for me to debug since it breaks previous behavior. We primarily run cinder backed volumes but need to specify the flavor disk size so that static images with fixed disks work properly.

Can you at least add a config option to spoof/change the max_unit? Or a max_unit_multiplier that works like the disk_allocation_ratio used to?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.