Introduction
VM I/O Throttling, to set the maximum disk I/O rate of VMs.
Purpose
Virtual machines are running on the same storage device (local storage or share strage). Because of the rate limitation of device (such as iops), if one VM has large disk operation, it may affect the disk performance of other VMs running on the same storage device.
It is neccesary to set the maximum rate and limit the disk I/O of VMs.
Target Branch
4.2.0
Feature Specifications
- set the maximum rate of VMs (in service_offering, disk_offering, and global configuration)
- change the maximum rate of VMs
- limit the disk rate (total bps and iops)
Use cases
TBD
Architecture and Design description
- change service_offering and disk_offering table in cloud database.
alter table disk_offering add column total_bytes_sec bigint(20) unsigned default 0;
alter table disk_offering add column total_iops_sec bigint(20) unsigned default 0;
- add global configurations
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vm.disk.throttling.io_rate', 0, 'Default disk I/O rate in requests per second allowed in User vm\'s disk. ');
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vm.disk.throttling.bytes_rate', 0, 'Default disk I/O rate in bytes per second allowed in User vm\'s disk. ');
- change kvm/LibvirtComputingResource to support IO Throttling
com.cloud.hypervisor.kvm.resource.LibvirtDomainXMLParser.parseDomainXML(String)
com.cloud.hypervisor.kvm.resource.LibvirtVMDef.DiskDef
com.cloud.hypervisor.kvm.resource.LibvirtComputingResource
- change APIs (createServiceOffering, createDiskOffering)
- change the CloudStack UI (Compute offering, system offering, disk offering)
Web Services APIs and Responses
createServiceOffering: Creates a service offering.
createDiskOffering: Creates a disk offering.
ServiceOfferingResponse: response of createServiceOffering/update/list
DiskOfferingResponse: response of createDiskOffering/update/list
ApiResponseHelper.createServiceOfferingResponse: create service offering response
ApiResponseHelper.createDiskOfferingResponse: create disk offering response
UI flow
add "Disk Rate (BPS)" and "Disk Rate (IOPS)" in Offerings ( compute,system,disk)
display "Disk Rate (BPS)" and "Disk Rate (IOPS)" in the detail page of offerings.
Discussions
- Is it necessary to limit the disk I/O of systemvms?
- For Attached additional Volume(AddVolumetoVM), is the limitation set to vm.service_offering (if not 0) or volume.disk_offering?
- the changes of names and labels.
References
Appendix
Appendix A:
Appendix B: