-
Notifications
You must be signed in to change notification settings - Fork 0
simplified IaaS
Our goal is to design and implement our own private cloud providing simplified IaaS to the clients.
- Client Client can request to create new virtual machines according to his own requirements. The requirements can be number of virtual cpus , memory for the created virtual machines. Other initial configuration information to create the virtual machine can be used by default. Client can request to create virtual machines by name and later can also request to suspend, resume and destroy them by giving virtual machine name and request type to cloud controller.
- Cloud Controller Cloud controller can get the request from client . it will process the received request and send commands to cluster controllers accordingly. Later cluster controllers can perform operations in their corresponding availability zones.
Various functions in cloud controller-
-
createVM :- this function is used to command the cluster controller in the corresponding availability zone for creating virtual machine by giving its name .
-
createVMreq :- in this function client can specify its requirements as number of virtual machines, number of cpus, memory size and availability zone for virtual machine creation.
-
suspendVM :- in this function the running virtual machine can be suspended by using its virDomain name.this request is forwarded to the corresponding availability zone in which the virtual machine is running.
-
resumeVM :- in this function the paused virtual machine can be resumed by using its virDomain name.this request is forwarded to the corresponding availability zone in which the virtual machine is in paused state.
-
destroyVM :- in this function the running virtual machine can be destroyed by using its virDomain name.this request is forwarded to the corresponding availability zone in which the virtual machine is running.
-
autoconfigVM :- the cloud controller can turn on the autoconfig option. This option is used to monitor the traffic handled by the virtual machines. By getting this request cluster controller can start to monitor the traffic and it can according apply auto scaling up and auto scaling down dynamically.
-
serverConsolidate :- in this function cloud controller will gather the information from all the node controllers. This information contains their busy resources and their all resources e.g. vcpu , memory. Then it will calculate volumes for all the nodes by using the following mathematical relation :-
Normalized_busy_cpus = busy_cpus / total_cpus Volume = 1/(1-normalized_busy_cpus) + 1/(1-normalized_busy_memory) Volume_to_memory_ratio = volume / busy_memory
The volume_to_memory_ratio is stored for all the nodes inside volume_memory_ratios vector. then the vector is sorted in ascending order. The node with the highest volume_memory_ratio will be considered as target for the migrated virtual machines and the node with the lowest volume_memory_ratio will be considered as source to migrate virtual machines. The source having the lowest volume_memory_ratio will be the candidate for consolidation. After computing the source and the target for migration, cloud controller will ask for the busy resources in source and the available resources in target nodes .then it will check that all the busy resources can be make available by the migration to target node. If this condition is satisfied then cloud controller will send the target nodes’ uri to the source node by calling the function migrateVM. So that the source node can migrate all its virtual machines to the target node. After successful completion of the migration, source node can go into consolidate state.
-
Cluster Controller Cluster controller will get the requests from the cloud controller and will operate in its availability zone. It will get the virtual machine requirements from the the cloud controller and will ask to all the node controllers that they can fulfill all the requirements of the cloud controller. If they are not sufficient then it will send error message to the cloud controller. If it can fulfill then it will run some scheduling algorithm to create the virtual machines in the nodes present in their corresponding availability zones. Cluster controller can able to run greedy, round robin and matchmaking algorithm to schedule the virtual machines.
createVM :- this function is used to command the node controller in the corresponding availability zone for creating virtual machine by giving its name .
RestClient::post("http://localhost:10007/node/createVM","application/json",sp.str());
createVMreq :- in this function cloud controller specifies its requirements as number of virtual machines, number of cpus, memory size for virtual machine creation. By getting all the requirements, it will ask to all the nodes by sending requests.
RestClient::get("http://"+ allnodeuris[i] +"/node/getavailResources"); RestClient::post("http://"+ allnodeuris[i] +"/node/createVMreq","application/json",sp.str());
Then cluster controller will check that all the available resources present in that availability zone are sufficient to fulfill requirement of virtual machines or not. If they are sufficient it will execute greedy, round robin and matchmaking algorithms as shown in the flow diagram.
Greedy Algorithm
Match_Making Algorithm
Round_Robin Algorithm
suspendVM :- in this function the running virtual machine can be suspended by using its virDomain name.this request is forwarded to the corresponding node controller in which the virtual machine is running. RestClient::post("http://localhost:10007/node/suspendVM","application/json",sp.str());
resumeVM :- in this function the paused virtual machine can be resumed by using its virDomain name.this request is forwarded to the corresponding node controller in which the virtual machine is in paused state. RestClient::post("http://localhost:10007/node/resumeVM","application/json",sp.str());
destroyVM :- in this function the running virtual machine can be destroyed by using its virDomain name. this request is forwarded to the corresponding node controller in which the virtual machine is running. RestClient::del("http://localhost:10007/node/destroyVM/"+ sp.str());
destroyVMdir :- in this function the running virtual machine can be destroyed to implement the autoscaling down algorithm. this request is forwarded to the corresponding node controller in which the virtual machine is running.
RestClient::del("http://localhost:10007/node/destroyVMdir");
autoconfigVM :- The autoscaling option is used to monitor the traffic handled by the virtual machines. By getting this request cluster controller can start to monitor the traffic and it can according apply auto scaling up and auto scaling down dynamically.
RestClient::get("http://172.50.88.15:80/server-status");
It will get the traffic information from apache web server running on virtual machine.it will check the request rate after every 2 minutes. If there is 20% increase in current request rate from the previous request rate checked before 2 minutes then it will call the method createVMdir (scaleup) on cluster controller which will create virtual machines in round robin algorithm. If there is 20% decrease in request rate then it will request to destroy (scaledown) the virtual machines.the flowchart of algorithm is shown in the diagram.
- Node controller Node controller is responsible for managing the virtual machines running on the node. It will keep the dynamic information about all the virtual machines running on the node. All the information about the virtual machines are provided by the node controller to the cluster controller and cloud controller whenever asked. It will keep an unordered map with key as the name of the virtual machine will will have the state, vcpus, memory, max memory info about the virtual machines. virNodeInfo struct virNodeInfo {
char model[32] model string indicating the CPU model unsigned long memory memory size in kilobytes unsigned int cpus the number of active CPUs unsigned int mhz expected CPU frequency, 0 if not known or on unusual architectures unsigned int nodes the number of NUMA cell, 1 for unusual NUMA topologies or uniform memory access; check capabilities XML for the actual NUMA topology unsigned int sockets number of CPU sockets per node if nodes > 1, 1 in case of unusual NUMA topology unsigned int cores number of cores per socket, total number of processors in case of unusual NUMA topolog unsigned int threads number of threads per core, 1 in case of unusual numa topology } virDomainInfo struct virDomainInfo {
unsigned char state the running state, one of virDomainState unsigned long maxMem the maximum memory in KBytes allowed unsigned long memory the memory in KBytes used by the domain unsigned short nrVirtCpu the number of virtual CPUs for the domain unsigned long long cpuTime the CPU time used in nanoseconds }
createVM :- this function will create the virtual machine by given name and include the running virtual machine information i.e. virdomaininfo in the unordered map allVMinfo.
createVMreq :- in this function the node controller will create client specified number of virtual machines with the specified number of cpus, memory size.and it will also add the created virtual machine information in the unordered map allVMinfo.
suspendVM :- in this function the running virtual machine is suspended by using its virDomain name. The virtual machine will go into the paused state after this. The same info will be updated in the allVMinfo corresponding to the key as virtual machine name.
resumeVM :- in this function the paused virtual machine is resumed by using its virDomain name. The virtual machine will go into the running state after this. The same info will be updated in the allVMinfo corresponding to the key as virtual machine name.
destroyVM :- in this function the running virtual machine is destroyed by using its virDomain name.The same info will be deleted in the allVMinfo corresponding to the key as virtual machine name.
destroyVMdir :- in this function the running virtual machine is destroyed. The same info will be deleted in the allVMinfo corresponding to the key as virtual machine name.
getavailResources :- this function will return the available resources at the node whenever it is requested by either cluster controller and cloud controller. Available resources will contain number of all available cpus, available memory size. struct hostinformation { int availablevcpus; unsigned long long availablememory; };
getbusyResources :- this function will return the busy resources at the node whenever it is requested by either cluster controller and cloud controller. busy resources will contain number of all busy cpus, busy memory size.
getResources :- this function will return all the resources at the node whenever it is requested by either cluster controller and cloud controller. all resources will contain number of all cpus, total memory size.