From: John Griffith Date: Wed, 16 Jul 2014 13:34:16 +0000 (+0000) Subject: Add some log info for NoValidHost X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0a0e851f3b294b824d3a6c4b60c9fbfca520e62b;p=openstack-build%2Fcinder-build.git Add some log info for NoValidHost Currently when a create call fails due to a misconfiguration on the backend, or a problem with satisfying the extra-specs from the filter scheduler, the only thing you get in the logs is a "No valid host". This patch just adds a tiny bit more info to give us a better idea where we're at. First the exception shouldn't be setup with "reason=""", so at least add "reason=no weighed hosts found". Second, add a warning message prior to getting to that point when we fail to find a host that satisfies the {extra/qos}-specs that were requested, and include what was being requested. Change-Id: I2ce65b973196f673bac455613a6f8626320339ba --- diff --git a/cinder/scheduler/filter_scheduler.py b/cinder/scheduler/filter_scheduler.py index 7af95d5b8..6ef5d91db 100644 --- a/cinder/scheduler/filter_scheduler.py +++ b/cinder/scheduler/filter_scheduler.py @@ -65,7 +65,7 @@ class FilterScheduler(driver.Scheduler): filter_properties) if not weighed_host: - raise exception.NoValidHost(reason="") + raise exception.NoValidHost(reason="No weighed hosts available") host = weighed_host.obj.host volume_id = request_spec['volume_id'] @@ -267,6 +267,9 @@ class FilterScheduler(driver.Scheduler): weighed_hosts = self._get_weighted_candidates(context, request_spec, filter_properties) if not weighed_hosts: + LOG.warning(_('No weighed hosts found for volume ' + 'with properties: %s'), + filter_properties['request_spec']['volume_type']) return None return self._choose_top_host(weighed_hosts, request_spec)