Openstack VM Limits with Nova
In the flavor set the extra specs
set like so1
nova flavor-key f103aef6-ded8-44d4-97b3-1a7d9543082d set quota:disk_total_iops_sec=200
disk1
2
3
4
5
6
7
8
9def disk_qos(self, info, extra_specs):
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 six.iteritems(extra_specs):
scope = key.split(':')
if len(scope) > 1 and scope[0] == 'quota':
if scope[1] in tune_items:
setattr(info, scope[1], value)
example in the xml1
2
3
4
5
6
7 <target dev='sda' bus='scsi'/>
<iotune>
<total_iops_sec>200</total_iops_sec>
</iotune>
<alias name='scsi0-0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
cpu1
2
3 cpu_shares
cpu_quota
cpu_period
bandwidth1
2
3
4
5
6 vif_inbound_average
vif_outbound_average
vif_inbound_peak
vif_outbound_peak
vif_inbound_burst
vif_outbound_burst