'disk_available_least' is not calculated correct if 'preallocate_images = space' is used.

Solution Verified - Updated -

Issue

  • With preallocate_images = space set in nova.conf the disk_over_committed calculation is wrong because in the end the size of the ephemeral disk is deducted twice when checking the available resources. As a result available_least which is used for the disk filter shows no available disk, even if there is.

E.g. creating a single instance with 20GB ephemeral disk on a compute with 33GB available:

  • preallocate_images = space
2018-03-08 11:46:54.444 12793 DEBUG nova.virt.libvirt.driver [req-e41619b7-f10d-407f-bc71-95d7e4fe610f - - - - -] disk_free_gb 13 get_available_resource /usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py:5503
...
2018-03-08 11:46:54.674 12793 DEBUG nova.virt.libvirt.driver [req-e41619b7-f10d-407f-bc71-95d7e4fe610f - - - - -] DISK info 21474573824 _get_disk_over_committed_size_total /usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py:7111
2018-03-08 11:46:54.674 12793 DEBUG nova.virt.libvirt.driver [req-e41619b7-f10d-407f-bc71-95d7e4fe610f - - - - -] disk_over_committed out 21474573824 get_available_resource /usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py:5505
2018-03-08 11:46:54.675 12793 DEBUG nova.virt.libvirt.driver [req-e41619b7-f10d-407f-bc71-95d7e4fe610f - - - - -] available_least -7515930112 get_available_resource /usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py:5507
  • preallocate_images = none
2018-03-08 11:48:35.348 13987 DEBUG nova.virt.libvirt.driver [req-fff3e2a9-c70b-4e62-8f33-c761f3337930 - - - - -] disk_free_gb 33 get_available_resource /usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py:5503
...
2018-03-08 11:48:35.581 13987 DEBUG nova.virt.libvirt.driver [req-fff3e2a9-c70b-4e62-8f33-c761f3337930 - - - - -] DISK info 21474573824 _get_disk_over_committed_size_total /usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py:7111
2018-03-08 11:48:35.582 13987 DEBUG nova.virt.libvirt.driver [req-fff3e2a9-c70b-4e62-8f33-c761f3337930 - - - - -] disk_over_committed out 21474573824 get_available_resource /usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py:5505
2018-03-08 11:48:35.582 13987 DEBUG nova.virt.libvirt.driver [req-fff3e2a9-c70b-4e62-8f33-c761f3337930 - - - - -] available_least 13958906368 get_available_resource /usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py:5507

Environment

  • Red Hat OpenStack Platform 8.0
  • Red Hat OpenStack 9.0
  • Red Hat OpenStack 10.0
  • Red Hat OpenStack 11.0
  • Red Hat OpenStack 12.0
  • Red Hat OpenStack 13.0
  • preallocate_images = space set in /etc/nova/nova.conf

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In