Search code examples
openstackkvmopenstack-novahypervisor

What is disk_available_least parameter of hypervisor in openstack


The response of OS api v2.1/{tenant-id}/os-hypervisors/detail is returning a parameter disk_available_least which is having a negative value. I wanted to know what this parameter is and how it is calculated.

Tried searching in OpenStack documentation but no luck.


Solution

  • Over Commitment


    Though virtualization helps better utilization of resources, most of the time it still can be more optimized.

    For Example a developer's workstation is used only 8-9 hours a day. The resources assigned to this workstation can be used for other developer who is working in different shift. Another example is, may be not all of the allocated RAM is used by a machine most of the time.

    Openstack allows us to over commit CPU, disk and RAM. Check official openstack documentation here

    This means that while we have physical machine with only 100GB of RAM but we can create VMs which have cumulative allocated RAM of may be 150GB depending on over commitment ratio.

    Answer to the question


    disk_available_least is calculated using below formula:

    disk_available_least = disk_free_gb - disk_over_committed
    

    As you can observe this value is dependent on over committed value of disk which may be higher than the physical value of disk as well as free disk size which leads to a negative value.

    There is a very good page explaining this phenomena with example and actual source code of openstack.