Dynamic Programming based Allocation of Virtual Machine Instances in Clouds

Auction-based mechanism for dynamic virtual machine provisioning and allocation (VMPA) can help cloud providers configure the resources efficiently based on the user demand and yield high revenue. The existing auction-based mechanisms mostly use greedy method to allocate the VM resources, which give priority to the users with high bid density. However, this kind of local optimal selection does not always bring the overall optimal solution. We propose dynamic programming based mechanism for solving VMPA problem (DP-VMPA), which takes the maximum social welfare as the objective function, and uses the combinatorial auction-based dynamic programming (CA-DP) allocation algorithm to solve the Winner Determination Problem (WDP). Finally, the Vickrey-Clarke-Groves (VCG) mechanism is used to decide the payment of each user. We perform simulation experiments to compare our proposed mechanism with CA-PROVISION mechanism and show that the DP-VMPA mechanism can allocate VM resources more effectively, and bring higher profits to the auctioneer.


Introduction
Cloud computing enables individuals and small medium enterprises satisfy their computational needs, while cloud providers provide computing resources through cloud computing platform to obtain profits.A cloud computing platform abstracts the underlying physical resources with the view of virtual machines (VMs).This enables easy management and pricing of the resources.Different types of VM instance represent different types of processors, memory, and etc.A user bid for a bundle of VM instances of different types required for executing her application.
The current cloud computing platforms (e.g., Microsoft Azure (1) , Amazon EC2 (2) ) allocate and price the resource based on fixed-price mechanism.Obviously this allocation and pricing system has many shortcomings, first of all it can not guarantee the effective allocation of resources, those who has higher value of the resources do not have more chance to obtain the requested resources, and secondly, it leads to lower than optimal revenue for the cloud provider (3,4) .Combinatorial auction-based mechanisms can effectively solve the above problem, which allocate items based on the bundle size and the perceived value of the users.
Cloud providers provision their resources statically or dynamically and then allocate them in the form of VM instances to their customers.In the case of static provisioning, they require that the VM instances are already provisioned and would not change, while in the case of dynamic provisioning, the providers provision a set of VM instances according to the current users' demand.Due to virtualization technology, dynamic provisioning can configure available resource into different numbers and types of VM instances, and lead to efficient resource utilization.Existing methods, mostly use the greedy algorithm to determine the allocation.It sorts the users' bid in descending order of density of valuation, determines the allocation greedily by selecting bids in this order within the resource restriction.But this greedy method does not always get the optimal solution.
In this paper, we consider combinatorial auction-based mechanism that dynamically provisions and allocates VM instances.Though the WDP is NP-complete, we can objectively formulate the VMPA problem, give the objective function, and then use the CA-DP allocation algorithm to find the optimal solution.The main idea of the CA-DP algorithm is to find the analytic construction of optimal solution, and then recursively find the winner set.We price the allocated resources by the VCG mechanism, which charges each individual the harm they cause to other bidders.

Related Work
Zaman (3) first introduced the fixed-price mechanism, and then designed two combinatorial auction-based approximation mechanisms that require static provisioning: CA-GREEDY and CA-LP.They performed extensive simulation experiments to compare them with the fixed-price mechanism to show that auction-based mechanism can significantly improve the allocation efficiency while generating higher revenue for the cloud providers.The CA-LP mechanism is a better choice when the objective is to obtain higher revenue and higher utilization of resources and the CA-GREEDY mechanism is widely recognized for its low execution time and efficient allocation performance.
Zaman (4) presented the CA-PROVISION mechanism to address the VMPA problem dynamically.They compared that with CA-GREEDY mechanism and the results showed that dynamic provisioning considering the current demand from the users can ensure the efficient use of resources and increase the profit of the auctioneer.
An effective bidding strategy (5) was proposed to help the cloud computing users generate the best bid within users' budgets.This bidding strategy can help users to generate efficient bids and thus, ensure good completion times and higher utility for their applications.This also helps the provider generate a fair amount of revenue while maintaining user satisfaction.
Nejad (6) proposed a heuristic greedy algorithm for dynamic VMPA which considered several types of resources including cores, memory, storage, etc.They used relevance fact characterizing the scarcity of each type of resources to re-define bid density which was then used for greedy allocation.They (3,4,6) all used the greedy method to allocate resources, which found the approximate solution through constructing the local optimal solution step by step and would yield more benefit for the cloud provider practically.Garfinkel (7) proposed a set partitioning algorithm to solve general version of winner determination problem.Nisan (8) expressed the WDP as a standard mixed integer programming problem and showed that could be managed by use of standard algorithms and commercially available software.Sandholm (9) showed that CPLEX performed well to manage large bid sets.Fujisima (10) recommended CASS software to solve the large-scale WDP.Their work increased the efficiency of the auction but they ignore the price problem.
Feng (11) presented four possible mechanisms: opt, greedy, VCG and TruTeamin to solve the allocation and pricing problems in set packing, and proved that VCG mechanism and TruTeam mechanism can efficiently allocate the resources with truthful and individual rational properties.The author proposed a strategy-proof incentive mechanism based on the VCG mechanism to deal with Mobile Crowdsourcing problem and achieved the desired design objectives.Le (13) presented two modifications of the Vickrey-Clark-Groves mechanism to accommodate bidders' budget constraints in the combinatorial auction setting.Conitzer (14) studied two related problems concerning the VCG mechanism: the problem of revenue guarantees, and that of collusion.They all studied the VCG mechanism and proved that it can satisfy the incentive compatible property and the over payment is modest.
Boughaci (15) presented a computational experience regarding four well-known meta-heuristics (stochastic local search, tabu search, genetic algorithms and memetic algorithms) for solving WDP.They showed that the metaheuristic approaches could provide competitive results comparing with the hybrid simulated annealing and Casanova.Parallel genetic algorithm uses two major modifications compared to the genetic algorithm (16) .They found solutions of very large problems, which are comparable or even better than any other solution found by other heuristics.An improved ant colony (IAC) algorithm considering the dynamic transition strategy and the Max-Min pheromone strategy was proposed for the allocation problem (17) .The study of approximate optimal solution to the WDP problem in combinatorial auctions can help the auctioneer to make a quick and efficient decision to increase the profits for the auctioneer. .We consider n users u1,…,un who request computing resources from the cloud provider specified as bundles of VM instances.A user uj requests VM instances by submitting a bid Bj = (r1 j ,…, rm j , vj) to the cloud provider, where ri j is the number of instances of type VMi and vj is the maximum price user j is willing to pay to use the requested bundle of VMs for a unit of time.We assume that the allocation and prices are decided periodically by the cloud provider and the interval between two such decisions is a unit of time.(1)

Dynamic VM Provision and Allocation Problem
The constraint in Equation (i) ensures that the total allocation should not exceed the number of available VM instances.Equation (ii) and (iii) are to make sure that the winners' payment should not exceed their valuations and the losers do not pay at all.The solution to this problem consists of allocation vector x and payment vector P. Since we know little about revenue maximization in the context of Combinatorial auctions (18) , trying to maximize the overall payment is not feasible.Usually we take maximizing the social welfare which is the sum of valuations of all winners as the most reasonable objective function.The allocation will determine the number of VMs of each type that needs to be provisioned as follows.We just need to compute for each type VMi and provision ki VM instances of type VMi.

Definition 2：Truthful (incentive-compatible)
A mechanism is truthful if the participants benefit most when they reveal their true valuation to the mechanism.
A truthful mechanism provides the access to find out the most suitable winners to utilize the resources.And it also helps the bidders in that they do not need compute a complex strategy or assume other users' strategies while making their own bids.

Definition 3：Individual Rationality
Individual Rationality means that each user's utility is non-negative, i.e., for each user j, the utility Uj = vj -pj is greater than or equal to 0. Obviously, user is willing to participate in the auction if the mechanism satisfies individual rationality.

DP-VMPA mechanism
We propose DP-VMPA Mechanism, that computes an optimal solution to the VMPA problem.That is, it determines the price each winner has to pay, and the set of VM instances that need to be provisioned to meet the winners' demand.We now describe the mechanism in detail.
DP-VMPA mechanism is given in Algorithm 1.The mechanism requires some information from the auctioneer such as the total amount of computing resources M expressed as the total number of VMs of type VM1 that can be provisioned by the cloud provider.The mechanism also requires as input the number of available VM types, m, and their weight vector w.
The mechanism works in three phases.In phase 1, it collects the users' bids, and all bids constitute the set BN.In phase 2, the mechanism use CA-DP allocation algorithm to determine the winning bidders and the VM configuration that needs to be provisioned by the cloud provider.In phase 3, the mechanism determines the payment of each user.For each winning bidder j, the VCG mechanism is used to price the requested bundle the social cost of her winning that is incurred by the rest of the users.We first calculate the maximal welfare BestValue′ with bidders other than uj, and then minus the total sum of winners′ valuation except uj.That is the payment of uj.Obviously all losing bidders pay zero.This type of payment is known in the mechanism design literature as the critical payment (18) .

CA-DP allocation algorithm
Combinatorial auction-based dynamic programming allocation algorithm (CA-DP) is given in algorithm 2. The algorithm has two input parameters: the vector of users's bids Bids and the total amount of VM resources M. It has two output parameters: the optimal winner set W and total sum of winners' valuation BestValue.
The structure of optimal solution for VMPA problem can be considered as a series of decision-making process, which decides weather each user should obtain the requested VM instances or not.If the optimal winner set contains the user un, that is, then the rest users x1, x2,…, xn-1 and computing resources M -sj constitute a new VMPA problem.And if the optimal solution do not contain un, then we just need to solve the VMPA problem with users x1, x2,…, xn-1 and resources M.
Then we can recursively find the optimal solution according to the structure properties.We denote by V[j][h] the maximum sum of winners' valuation where users participated are u1,…,uj and the amount of VM resource is h, then, When the amount of resources requested by the user uj is greater than that provider could provision, V[j][h] is determined by the rest users without uj and resource amount h; Otherwise we compute the maximal social welfare in which situation user uj get the requested resources

V[j-1][h-sj] + vj and that in which case uj is a loser V[j-1][h], and let V[j]
[h] equal to the higher social welfare of the two.

Obviously the ultimately we need to solve V[n][M].
After we find the optimal social welfare, we determine the winner set through tracing back, that is, comparing the maximal sum of winners' valuation V

[j-1][h] and V[j][h]
to test if user uj belongs to winner set W. We start to trace when j = n, h = M, and stop when j = 1 to find all the winners.
Proof: (Sketch) We first show that the proposed mechanism is monotone.Since the CA-DP allocation algorithm aims to find the optimal solution, a user can increase the chance of winning her requested bundle by increasing her valuation.Therefore the allocation is monotone.Secondly, we will prove the payment calculated by the VCG mechanism is the critical value.We all know that VCG mechanism uses the social cost of user's winning that incurred by the rest of the bidders to decide the payment.And for all losers, the payment is 0. Thus, monotone allocation and critical payment guarantee that our proposed mechanism is truthful.
For each winner uj, the payment pj = BestValue′ -(BestValue -vj), where BestValue′ ≤ BestValue because CA-DP algorithm decides the maximal the social welfare.Thus, we can easily prove that the utility Uj = vj -pj of uj is greater than or equal to 0. Utility of Ones who do not get the requested bundles is 0. So the claim is proved true.

Claim 3. Complexity
Next we analyze the complexity of the DP-VMPA mechanism.CA-DP allocation algorithm for the optimal solution use two loops to find out the optimal solution: for j = 0,…, n and for h = 0,…, M. The loops has a worst case complexity of O(nM).It also use a loop to search the winner set W by tracing back method and the execution time of the loop is O(n).Thus, the total time complexity of CA-DP is O(nM).When we use VCG mechanism to calculate the payment, for all winners we invoke the CA-DP algorithm again and the complexity is O(nnM).Hence, the overall worst time complexity is O(nnM).

CA-PROVISION mechanism
We compare our proposed mechanism with CA-PROVISION mechanism that computes an approximate solution to the VMPA problem.That is, it determines the price the winning users have to pay, and the set of VM instances that needs to be provisioned by the cloud provider.CA-PROVISION mechanism is given in Algorithm 3. The mechanism determines the winners by first setting a dummy user un+1 and ranking all users in decreasing order of their bid density (i.e., vj / sj), then discarding users for which dj < du+1 to prevent losses, finally greedily allocating them starting from the top of the list.For each winning bidder uj, it finds the losing bidder ul who would win if uj would not participate.User uj's payment is then calculated by multiplying her bundle size sj with the bid density dl of ul.Otherwise she pays zero.,..., , Each experiment consists of 5 sequential auctions.A total of about 1000 people are generated, that is, at the beginning 600 users are involved in the auction, after each round of the auction 100 new users are created to take part in the auction.Users are generated during that auction and all users from previous time slots that are still active.An active user is one whose task has not been finished or the task deadline has not been reached.

Experimental Setup
We assume that the cloud provider offers four types of VM instances: small, medium, large, and huge (VM1, VM2, VM3, VM4) and their relative weight vector is w = (1, 2, 4, 8).The total available resource (i.e., all VM1 instances) is 2000.Each user uj's bid is a 5-tuple (r1 j , r2 j , r3 j , r4 j , vj), where ri j is the number of instances of type VMi requested and vj is the valuation.User uj's task is characterized by the tuple (tj, dj), where tj is the of time the resources are requested for and dj is the time by which uj's job needs to be completed.
We list all the simulation parameters and their values in Table 1.These parameters ri j , vj, tj, and dj are randomly chosen from their respective minimum and maximum ranges.To create different instances of VMPA, we consider four values of vj, which give four ranges of valuations (0-1), (0-2), (0-5), and (0-10).Combining all these valuations with each other, our simulation experiment runs 50 different instances of VMPA.

Analysis of Results
Figure (1) shows the percent of users who finish their tasks with different ranges of user valuation.We see that the served users served by DP-VMAP mechanism are more than twice that served by CA-PROVISION mechanism.This is because CA-PROVISION gives priority to users which is related to bid density, while DP-VMPA fully considers all users' bids to maximize social welfare and this makes resources utilized efficiently and serves more users.Figure (3) shows the revenue generated for different ranges of user valuation.We can see that, the use of DP-VMPA mechanism can always make the cloud provider get higher revenue.This is determined by the nature of the two mechanisms.CA-PROVISION mechanism using greedy algorithm, selects the most suitable user with the highest bid density and allocates the VM bundles requested within resource capacity.This method is easy to implement but is not optimal.CA-DP allocation algorithm finds the optimal solution to maximize the social welfare.mechanism achieves the highest sum of winners' valuation and brings more benefits to the auctioneer.Furthermore, VCG mechanism can also help to bring more revenue for the cloud provider.

Conclusion
In order to solve the VMPA problem, we proposed dynamic programming based mechanism.This mechanism takes maximizing social welfare as the objective function, and recursively solves the optimal solution to determine the winner set, and uses the VCG mechanism to price the user for resources.Experiments comparing with the CA-PROVISION mechanism showed that the DP-VMPA mechanism can enable more users to complete the application, improve the allocation efficiency, and significantly increase the cloud provider's profits.However the mechanism is more complex, we have to limit the application of DP-VMPA to instances with a small number of users.DP-VMPA can also be a choice when auctions are run at longer intervals.Future work will focus on the optimization of CA-DP allocation algorithm, and improve the VCG mechanism to make the pricing mechanism more convenient and efficient.
unit computing resources requested by uj.In order to define the profit obtained by the cloud provider, we denote by P = {p1, p2,…, pn} the payment vector, where pj is the amount paid by the user uj for using her requested bundle of VMs; Let's denote by x = {x1, x2,…, xn} the allocation vector, where xj = 1 if the bundle uj requested was allocated to her and xj = 0, otherwise.We define the winner set as W={uj | 1≤ j ≤ n, xj = 1}.Definition 1：The VMPA problem in clouds is defined as follows set of simulation experiments, Each user takes part in two separate auctions which use CA-PROVISION mechanism and DP-VMPA mechanism respectively to decide the allocation and the payment.Users are randomly generated and they simultaneously take part in two set of experiments.Considering the time complexity of DP-VMPA mechanism, we cut the size of experiment by setting longer intervals and decreasing the experimental parameters.

Figure ( 2 )
Figure(2) describes utility of user who finished her task with respect to users' valuation.It shows that the two mechanisms can make users receive more utility when the valuation is larger, and CA-PROVISION mechanism has better performance.It also means that VCG mechanism used by our proposed mechanism charges more than CA-PROVISION mechanism, which will yield more revenue for the cloud provider.

Fig. 1 .
Fig. 1.Percent of user Served Virtualization technology allows the cloud computing providers to configure computational resources into virtually any combination of different types of VMs.A cloud provider offers computing services to users through m different types of VM instances VM1,…,VMm.The computing power of a VM instance of type VMi, i = 1,…, m is wi, where w1 = 1 and w1 ≤ w2 ≤ … ≤ wm.We denote the vector of computing powers of the m VMs as w = (w1,…,wm).To make this clear, we consider the types of instances currently offered by Microsoft Azure Platform: Small (CPU 1.6 GHz, Memory: 1.75 GB, Storage: 225 GB), Medium (CPU 2x1.6 GHz, Memory: 3.5 GB, Storage: 490GB), Large (CPU 4x1.6 GHz, Memory: 7 GB, Storage: 1TB), and Extra large (CPU 8x1.6 GHz, Memory: 14 GB, Storage: 14 GB).In this example, VM1, VM2, VM3, VM4 are the Small, Medium, Large and respectively Extra large VM instances.The weight vector characterizing the VM instances is w =(1, 2, 4, 8).We assume that the cloud provider has enough resources to create a maximum of M VM instances of the least powerful type, VM1.The cloud provider can provision the VM instances in several ways according to the specified types given by VM1,…,VMm.We denote the number of VMi instances provisioned by the cloud provider as ki.The cloud provider can provision any combination of instances given by the vector (k1, k2,…, km)