Jump to: navigation, search

Difference between revisions of "Admin-set-resource-quota-dynamically"

m (Design and implementation)
m (Introduction)
Line 6: Line 6:
 
== Introduction ==
 
== Introduction ==
  
To achieve high cost-effectiveness in IaaS cloud operation, a cloud administrator tries to save physical resources while<br />
+
To achieve high cost-effectiveness in IaaS cloud operation, a cloud administrator tries to<br />
guaranteeing users' QoS requirements. After more and more IaaS clouds are deployed, cost-effectiveness in IaaS operation<br />
+
save physical resources while guaranteeing users' QoS requirements. After more and more<br />
has become an important problem, attracting attention from both public and private cloud owners and administrators.
+
IaaS clouds are deployed, cost-effectiveness in IaaS operation has become an important<br />
 +
problem, attracting attention from both public and private cloud owners and administrators.
  
Highly cost-effective IaaS operation requires allocating physical resource quota to a VM instance quantitativelyand accurately,<br />
+
Highly cost-effective IaaS operation requires allocating physical resource quota to a VM<br />
e.g. physical CPU execution time, physical memory limitation, blkio and network bandwidth. From Grizzly, OpenStack introduces <br />
+
instance quantitativelyand accurately, e.g. physical CPU execution time, physical memory<br />
the feature of [[InstanceResourceQuota|Instance Resource Quota]], which provides the capability of static instance quota allocation. <br />
+
limitation, blkio and network bandwidth. From Grizzly, OpenStack introduces the feature of<br />
With this feature, a quantitative and accurate resource quota can be assigned and reserved for an instance statically when it is <br />
+
[[InstanceResourceQuota|Instance Resource Quota]], which provides the capability of static<br />
created. This feature is a large improvement to the basic resource allocation mechanism in OpenStack, in which only fundamental<br />
+
instance quota allocation. With this feature, a quantitative and accurate resource quota can<br />
 +
be assigned and reserved for an instance statically when it is created. This feature is a large<br />
 +
improvement to the basic resource allocation mechanism in OpenStack, in which only fundamental<br />
 
parameters, e.g. VCPU number, can be specified.
 
parameters, e.g. VCPU number, can be specified.
  
According to the requirements derived from our IaaS operation practices, we come to recognize that there is still space left for<br />
+
According to the requirements derived from our IaaS operation practices, we come to recognize<br />
further improvement in instance-level physical resource quota allocation. Except for the capability of static instance quota allocation,<br />
+
that there is still space left for further improvement in instance-level physical resource quota<br />
dynamic instance quota adjustment is also valuable for cloud administrators. With such dynamic adjustment capability, they can<br />
+
allocation. Except for the capability of static instance quota allocation, dynamic instance quota<br />
re-allocate resources according to requirements when instances are running. As an example, the admin can allocate more physical<br />
+
adjustment is also valuable for cloud administrators. With such dynamic adjustment capability,<br />
CPU execution time to a high-priority instance running computation-intensive or latency-critical workloads. Also, more blkio bandwidth<br />
+
they can re-allocate resources according to requirements when instances are running. As an<br />
could be allocated to high-poiority instances running I/O-intensive workloads. Combining the dynamic adjustment capability with the<br />
+
example, the admin can allocate more physical CPU execution time to a high-priority instance<br />
existing static allocation capability, such resource allocation decisions can be made either before or after instances are created.
+
running computation-intensive or latency-critical workloads. Also, more blkio bandwidth could<br />
 +
be allocated to high-poiority instances running I/O-intensive workloads. Combining the dynamic<br />
 +
adjustment capability with the existing static allocation capability, such resource allocation<br />
 +
decisions can be made either before or after instances are created.
  
In this blueprint, we propose the capability of dynamically adjusting available physical resources, e.g. CPU execution time for VCPU<br />
+
In this blueprint, we propose the capability of dynamically adjusting available physical resources,<br />
of an instance, physical memory occupation, disk I/O bandwidth, etc. With this feature, it can be decided quantitatively that how much<br />
+
e.g. CPU execution time for VCPU of an instance, physical memory occupation, disk I/O bandwidth,<br />
physical resources should be allocated and reserved to an instance when it is running.
+
etc. With this feature, it can be decided quantitatively that how much physical resources should be<br /> allocated and reserved to an instance when it is running.
  
 
== Design and implementation ==
 
== Design and implementation ==

Revision as of 13:25, 1 November 2013

  • Launchpad Entry: NovaSpec:admin-set-resource-quota-dynamically
  • Created: Sep. 18, 2013
  • Contributors: Yu Zhang

Introduction

To achieve high cost-effectiveness in IaaS cloud operation, a cloud administrator tries to
save physical resources while guaranteeing users' QoS requirements. After more and more
IaaS clouds are deployed, cost-effectiveness in IaaS operation has become an important
problem, attracting attention from both public and private cloud owners and administrators.

Highly cost-effective IaaS operation requires allocating physical resource quota to a VM
instance quantitativelyand accurately, e.g. physical CPU execution time, physical memory
limitation, blkio and network bandwidth. From Grizzly, OpenStack introduces the feature of
Instance Resource Quota, which provides the capability of static
instance quota allocation. With this feature, a quantitative and accurate resource quota can
be assigned and reserved for an instance statically when it is created. This feature is a large
improvement to the basic resource allocation mechanism in OpenStack, in which only fundamental
parameters, e.g. VCPU number, can be specified.

According to the requirements derived from our IaaS operation practices, we come to recognize
that there is still space left for further improvement in instance-level physical resource quota
allocation. Except for the capability of static instance quota allocation, dynamic instance quota
adjustment is also valuable for cloud administrators. With such dynamic adjustment capability,
they can re-allocate resources according to requirements when instances are running. As an
example, the admin can allocate more physical CPU execution time to a high-priority instance
running computation-intensive or latency-critical workloads. Also, more blkio bandwidth could
be allocated to high-poiority instances running I/O-intensive workloads. Combining the dynamic
adjustment capability with the existing static allocation capability, such resource allocation
decisions can be made either before or after instances are created.

In this blueprint, we propose the capability of dynamically adjusting available physical resources,
e.g. CPU execution time for VCPU of an instance, physical memory occupation, disk I/O bandwidth,
etc. With this feature, it can be decided quantitatively that how much physical resources should be
allocated and reserved to an instance when it is running.

Design and implementation

This feature depends on the cgroup support provided by libvirt. As an example, by opening the setSchedulerParameters() method of
virDomain class in libvirt, we can achieve management on physical CPU execution time.

To implemented this CPU execution time management, proposed modifications include:

  • An action with a proposed name _action_set_cpu_time_quota() is defined in nova-api

File to be modified:
/nova/api/openstack/compute/servers.py
/nova/compute/instance_actions.py

  • An api with a proposed name set_cpu_time_quota() is defined in nova-compute

File to be modified:
/nova/compute/api.py
/nova/compute/rpcapi.py
/nova/compute/manager.py

  • The setSchedulerParameters() method of virDomain class in libvirt is exposed in nova-virt

File to be modified:
/nova/virt/driver.py
/nova/virt/libvirt/driver.py

The execution flow of this CPU execution time management is shown in the following figure:

Execution flow

Status and schedule

The feature of dynamically adjusting CPU execution time has been implemented in our local OpenStack environment and works well.

Testing

To be added

Scope

Since this feature depends on both cgroup of Linux and libvirt, therefore, if either KVM or libvirt are not used, this feature might not work.
But based on this feature, supports to other hypervisors and drivers should be easier to be added.

Reference

  • cgroup doc

https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt

  • libvirt API doc

http://libvirt.org/html/libvirt-libvirt.html

  • Related blueprints

Instance Resource Quota
- Wiki: https://wiki.openstack.org/wiki/InstanceResourceQuota
- Blueprint: https://blueprints.launchpad.net/nova/+spec/quota-instance-resource