Red Hat Bugzilla – Bug 976279
openstack-horizon: no size validation on volume creation
Last modified: 2016-06-13 02:55:54 EDT
Description of problem:
no size validation on volume creation, tried to create a volume with size of 150G and it failed (since my vg size is 100g).
please add validation upon creation of new volumes
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. log in to horizon
2. create volume that is big enough from current cinder-volume VG
Created attachment 763356 [details]
Thank you for the report. I'm not sure if there is much that can be done from the Horizon side. I don't believe there is a Cinder API that can tell us if there is sufficient free space available.
A clearer error message would be nice, but it doesn't seem that we get an error message back from Cinder at all (the same happens from the command line, `$ cinder create 150` returns the volume created that will be in error).
I wonder if we really want to return that kind of info though. Wouldn't this give too much information on the cloud infrastructure to a user? Usually in the cloud world, available space appears to be infinite, and even if the user gets told about why the volume failed to be created it's not a problem they can solve (only the admin can act on it).
Adding a needsinfo for our resident Cinder expert Eric to get his opinion and see if he has alternative suggestions.
I'm also not sure what can be done about this today. Cinder volume create calls are asynchronous and unless the failure occurs in the synchronous part of the create call (i.e. exceeding quota), Cinder doesn't indicate the reason for failure.
IMO the answer for fixing this up is to have Cinder report why it failed, rather than trying to check for sufficient space up front. (Some Cinder backends don't report a specific amount of free space, anyway.)
But, for Horizon to give more useful information, Cinder would have to report more details through an API.
Here, the failure was that the scheduler couldn't find a host with enough free space:
2013-06-20 12:28:30 WARNING [cinder.scheduler.filters.capacity_filter] Insufficient free space for volume creation (requested / avail): 150/107.0
2013-06-20 12:28:30 ERROR [cinder.scheduler.manager] Failed to schedule_create_volume: No valid host was found.
Matching target versions to bug depended on.
I am able to reproduce the issue in latest upstream code also.
No api to get the error message from the cinder.
cinder printing the below error message in log.
2015-12-22 06:41:29.102 ERROR cinder.scheduler.flows.create_volume [req-7dfbb556-19d6-4f5b-b1f9-8da7e28e58be 576fc9a0217744d9bbce4670cb3a3e19 f4d95fcce5d840c6a4fd74cb20e01dba] Failed to run task cinder.scheduler.flows.create_volume.ScheduleCreateVolumeTask;volume:create: No valid host was found. No weighed hosts available
as of now horizon displaying the status of the volume as "Error".
this should be handled upstream. I've been told, there is not much we can do until volume creation either succeeds or fails.