From 7fb7e0b30085ca3f2f1d04e278796dd105e35505 Mon Sep 17 00:00:00 2001 From: Tony Walker Date: Fri, 17 Apr 2015 18:49:17 +0000 Subject: [PATCH] Apply IO tuning to non-ephemeral disks Borrow disk_qos() from https://review.openstack.org/#/c/143939/ and implement for all volumes to be attached to a new instance. --- nova/virt/libvirt/driver.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 4e94b60..d8d7356 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -3200,6 +3200,7 @@ class LibvirtDriver(driver.ComputeDriver): info = disk_mapping[vol_dev] self._connect_volume(connection_info, info) cfg = self._get_volume_config(connection_info, info) + self.disk_qos(cfg, inst_type['extra_specs']) devices.append(cfg) vol['connection_info'] = connection_info vol.save() @@ -3217,6 +3218,17 @@ class LibvirtDriver(driver.ComputeDriver): return devices + def disk_qos(self, info, extra): + tune_items = ['disk_read_bytes_sec', 'disk_read_iops_sec', + 'disk_write_bytes_sec', 'disk_write_iops_sec', + 'disk_total_bytes_sec', 'disk_total_iops_sec'] + for key, value in extra.iteritems(): + scope = key.split(':') + if len(scope) > 1 and scope[0] == 'quota': + if scope[1] in tune_items: + setattr(info, scope[1], value) + + def _get_host_sysinfo_serial_hardware(self): """Get a UUID from the host hardware -- 1.8.1.5