summaryrefslogtreecommitdiffstats
path: root/nova/scheduler
diff options
context:
space:
mode:
authorvladimir.p <vladimir@zadarastorage.com>2011-08-26 11:14:44 -0700
committervladimir.p <vladimir@zadarastorage.com>2011-08-26 11:14:44 -0700
commit96a1b218d1d1d24853df3eceff11ba7676cd48ae (patch)
tree0e87a780c9031ea9e630297fc3820bf834d02856 /nova/scheduler
parenteecb6ce2acee168713177459942e405b099fb25a (diff)
downloadnova-96a1b218d1d1d24853df3eceff11ba7676cd48ae.tar.gz
nova-96a1b218d1d1d24853df3eceff11ba7676cd48ae.tar.xz
nova-96a1b218d1d1d24853df3eceff11ba7676cd48ae.zip
added debug prints for scheduler
Diffstat (limited to 'nova/scheduler')
-rw-r--r--nova/scheduler/vsa.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/nova/scheduler/vsa.py b/nova/scheduler/vsa.py
index ad5ebc2dc..6962dd86b 100644
--- a/nova/scheduler/vsa.py
+++ b/nova/scheduler/vsa.py
@@ -272,7 +272,7 @@ class VsaScheduler(simple.SimpleScheduler):
self._consume_resource(qos_cap, vol['size'], -1)
def schedule_create_volumes(self, context, request_spec,
- availability_zone, *_args, **_kwargs):
+ availability_zone=None, *_args, **_kwargs):
"""Picks hosts for hosting multiple volumes."""
num_volumes = request_spec.get('num_volumes')
@@ -285,6 +285,8 @@ class VsaScheduler(simple.SimpleScheduler):
host = self._check_host_enforcement(context, availability_zone)
try:
+ self._print_capabilities_info()
+
self._assign_hosts_to_volumes(context, volume_params, host)
for vol in volume_params:
@@ -324,6 +326,8 @@ class VsaScheduler(simple.SimpleScheduler):
return super(VsaScheduler, self).schedule_create_volume(context,
volume_id, *_args, **_kwargs)
+ self._print_capabilities_info()
+
drive_type = {
'name': volume_type['extra_specs'].get('drive_name'),
'type': volume_type['extra_specs'].get('drive_type'),
@@ -398,6 +402,26 @@ class VsaScheduler(simple.SimpleScheduler):
self._consume_partition(qos_values, GB_TO_BYTES(size), direction)
return
+ def _print_capabilities_info(self):
+ host_list = self._get_service_states().iteritems()
+ for host, host_dict in host_list:
+ for service_name, service_dict in host_dict.iteritems():
+ if service_name != "volume":
+ continue
+
+ LOG.info(_("Host %s:"), host)
+
+ gos_info = service_dict.get('drive_qos_info', {})
+ for qosgrp, qos_values in gos_info.iteritems():
+ total = qos_values['TotalDrives']
+ used = qos_values['FullDrive']['NumOccupiedDrives']
+ free = qos_values['FullDrive']['NumFreeDrives']
+ avail = BYTES_TO_GB(qos_values['AvailableCapacity'])
+
+ LOG.info(_("\tDrive %(qosgrp)-25s: total %(total)2s, "\
+ "used %(used)2s, free %(free)2s. Available "\
+ "capacity %(avail)-5s"), locals())
+
class VsaSchedulerLeastUsedHost(VsaScheduler):
"""