Jump to: navigation, search

Difference between revisions of "InstanceResourceQuota"

Line 7: Line 7:
  
 
  blueprint https://blueprints.launchpad.net/nova/+spec/instance-resource-quota
 
  blueprint https://blueprints.launchpad.net/nova/+spec/instance-resource-quota
 +
 
  commit https://review.openstack.org/#/c/14151/
 
  commit https://review.openstack.org/#/c/14151/
  
Line 14: Line 15:
  
 
<pre><nowiki>  
 
<pre><nowiki>  
nova-manage flavor set_key --name m1.small  --key read_bytes_sec --value 10240000
+
nova-manage flavor set_key --name m1.small  --key limit:read_bytes_sec --value 10240000
nova-manage flavor set_key --name m1.small  --key write_bytes_sec --value 10240000
+
nova-manage flavor set_key --name m1.small  --key limit:write_bytes_sec --value 10240000
 
</nowiki></pre>
 
</nowiki></pre>
  
Line 36: Line 37:
  
 
<pre><nowiki>
 
<pre><nowiki>
nova-manage flavor set_key --name m1.small  --key cpu_quota --value 5000
+
nova-manage flavor set_key --name m1.small  --key limit:cpu_quota --value 5000
nova-manage flavor set_key --name m1.small  --key cpu_period --value 2500
+
nova-manage flavor set_key --name m1.small  --key limit:cpu_period --value 2500
 
</nowiki></pre>
 
</nowiki></pre>
  
Line 48: Line 49:
  
 
<pre><nowiki>
 
<pre><nowiki>
nova-manage flavor set_key --name m1.small  --key inboud_average --value 10240
+
nova-manage flavor set_key --name m1.small  --key limit:inboud_average --value 10240
nova-manage flavor set_key --name m1.small  --key outboud_average --value 10240
+
nova-manage flavor set_key --name m1.small  --key limit:outboud_average --value 10240
 
</nowiki></pre>
 
</nowiki></pre>

Revision as of 16:01, 24 January 2013

Instance Resource Quota

How to set Server CPU,disk IO,Bandwidth consumption limit for instances using the new feather of nova. By using cgroup,libvirt can set the per instance CPU time consumption percent. and the instances's read_iops,read_byteps, write_iops,write_byteps.also libvirt support limit the instances in/out bandwidth.

blueprint https://blueprints.launchpad.net/nova/+spec/instance-resource-quota
commit https://review.openstack.org/#/c/14151/

Config Nova to use these feathers

Config IO limit for the specified instance type

 
nova-manage flavor set_key --name m1.small  --key limit:read_bytes_sec --value 10240000
nova-manage flavor set_key --name m1.small  --key limit:write_bytes_sec --value 10240000


CPU control params :cpu_shares,cpu_quota,cpu_period

shares

The optional shares element specifies the proportional weighted share for the domain. If this is omitted, it defaults to the OS provided defaults. NB, There is no unit for the value, it's a relative measure based on the setting of other VM, e.g. A VM configured with value 2048 will get twice as much CPU time as a VM configured with value 1024. Since 0.9.0

period

The optional period element specifies the enforcement interval(unit: microseconds). Within period, each vcpu of the domain will not be allowed to consume more than quota worth of runtime. The value should be in range [1000, 1000000]. A period with value 0 means no value. Only QEMU driver support since 0.9.4, LXC since 0.9.10

quota

The optional quota element specifies the maximum allowed bandwidth(unit: microseconds). A domain with quota as any negative value indicates that the domain has infinite bandwidth, which means that it is not bandwidth controlled. The value should be in range [1000, 18446744073709551] or less than 0. A quota with value 0 means no value. You can use this feature to ensure that all vcpus run at the same speed. Only QEMU driver support since 0.9.4, LXC since 0.9.10

Config CPU limit for the specified instance type

nova-manage flavor set_key --name m1.small  --key limit:cpu_quota --value 5000
nova-manage flavor set_key --name m1.small  --key limit:cpu_period --value 2500


bandwidth params :inbound_average,inbound_peak,inbound_burst,outbound_average,outbound_peak,outbound_burst

Incoming and outgoing traffic can be shaped independently. The bandwidth element can have at most one inbound and at most one outbound child elements. Leaving any of these children element out result in no QoS applied on that traffic direction. So, when you want to shape only network's incoming traffic, use inbound only, and vice versa. Each of these elements have one mandatory attribute average. It specifies average bit rate on interface being shaped. Then there are two optional attributes: peak, which specifies maximum rate at which bridge can send data, and burst, amount of bytes that can be burst at peak speed. Accepted values for attributes are integer numbers, The units for average and peak attributes are kilobytes per second, and for the burst just kilobytes. The rate is shared equally within domains connected to the network.

Config Bandwidth limit for instance network traffic

nova-manage flavor set_key --name m1.small  --key limit:inboud_average --value 10240
nova-manage flavor set_key --name m1.small  --key limit:outboud_average --value 10240