Final Report

Share Embed Donate


Short Description

Project report...

Description

EFFICIENT PRIORITY BASED LOAD BALANCING IN CLOUD COMPUTING ENVIRONMENT A PROJECT REPORT Submitted by

KARTHIGA. J PURVISHA. P. S SWETHA MAHALAKSHMI. P in partial fulfillment for the award of the degree of

BACHELOR OF TECHNOLOGY in

INFORMATION TECHNOLOGY

SRI SAIRAM ENGINEERING COLLEGE, CHENNAI – 44

ANNA UNIVERSITY : CHENNAI 600 025 APRIL 2013

ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE Certified that this project report “EFFICIENT PRIORITY BASED LOAD BALANCING IN CLOUD COMPUTING ENVIRONMENTS” is the bonafide work of KARTHIGA. J

(41909205042)

PURVISHA. P. S

(41909205067)

SWETHA MAHALAKSHMI. P (41909205092)

who carried out the project work under my supervision.

SIGNATURE

SIGNATURE

DR.T.SHEELA, Ph.D.

MS. S. SUSILA SAKTHY.

HEAD OF THE DEPARTMENT

SUPERVISOR Assistant Professor

Department of Information Technology Sri Sairam Engineering College West Tambaram Chennai – 600044

Submitted for VIVA VOCE held on ………………..

Department of Information Technology Sri Sairam Engineering College West Tambaram Chennai - 600044

INTERNAL EXAMINER

EXTERNAL EXAMINER

ACKNOWLEDGEMENTS We t a k e i m m e n s e p l e a s u r e t o thank our beloved Chairman MJF. Ln. LEO MUTHU for his commendable supports to the successful project achievement.

We thank our secretary Sri M.VASU and our CEO Mr. J. SAI PRAKASH for creating an atmosphere where we could develop our academic skills.

We are privileged to thank our beloved Director Prof. V.R.RAJAMANICKAM for his constant support towards the project.

We take this opportunity to thank our Principal Dr.C.V.JAYAKUMAR, for the facilities extended to us during this course.

We express our sincere gratitude to Dr. T. SHEELA, Head of Department of IT for her encouragement and invaluable motivation throughout the period of our project work.

We extend our heartfelt gratitude to our Project Coordinators Ms. V. NARMADHA and Ms. P. KALAICHELVI for their constant guidance to our project.

We feel indebted to our Internal Guide Ms. S. SUSILA SAKTHY, who has done all the needful for the successful completion of our project.

We thank the

STAFF MEMBERS

(TEACHING AND NON-TEACHING)

of

DEPARTMENT OF INFORMATION TECHNOLOGY for their help and assistance that had been given throughout the project work.

We thank the MANAGEMENT and all the STAFF MEMBERS of the college for their valuable support for the completion of the project.

Finally we thank almighty for his blessings to make this project a success.

ABSTRACT

Cloud computing is a fast growing area in computing research and industry today. Cloud computing enables a wide range of users to access distributed, scalable, virtualized hardware and/or software infrastructure over the Internet. With the advancement of the Cloud, there are new possibilities opening up on how applications can be built and how different services can be offered to the end user through Virtualization, on the internet. There are the cloud service providers who provide large scaled computing infrastructure defined on usage, and provide the infrastructure services in a very flexible manner which the users can scale up or down at will. Load balancing is a methodology to distribute workload across multiple computers, or other resources over the network links to achieve optimal resource utilization, maximize throughput, minimum response time, and avoid overload. The establishment of an effective load balancing algorithm and how to use Cloud computing resources efficiently for effective and efficient cloud computing is one of the Cloud computing service providers‟ ultimate goals. In this project a new VM load balancing algorithm has been proposed for an IaaS framework in Simulated cloud computing environment; i.e. „Priority Weighted Active Monitoring Load Balancing Algorithm‟ using CloudSim tools, for the Datacenter to effectively load balance requests by prioritizing them and assigning/allocating them between the available virtual machines assigning a weight, in order to achieve better performance parameters such as response time and Data processing time.

Keywords Cloudsim, Virtualization, Virtual Machine, Cloudlets, Load Balancing

iv

Chapter no

1

2

Title

Page no.

Abstract

iv

List of tables

viii

List of figures

ix

INTRODUCTION

1

1.1 Introduction

1

1.2 Motivation

2

1.3 Objectives

2

1.4 Conclusion

3

CLOUD COMPUTING 2.1 Introduction

4

2.2 Cloud components

4

2.2.1 Clients

5

2.2.2 Datacenter

5

2.2.3 Distributed Servers

5

2.3 Type of clouds

5

2.4 Virtualization

6

2.4.1 Full Virtualization

6

2.4.2 Para Virtualization

7

2.5 Services provided by cloud computing

8

2.5.1 Software as a Service (SaaS)

8

2.5.2 Platform as a Service (PaaS)

9

2.5.3 Hardware as a Service (HaaS)

9

2.6 Simulation in cloud: CloudSim

10

2.6.1 Importance of simulation

11

2.6.2 Cloud Simulator

11

3

4

5

2.6.3 Modeling the cloud

14

2.6.4 Modeling the VM allocation

16

LOAD BALANCING

20

3.1 Introduction

20

3.2 Goals of Load Balancing

21

3.3 Types of Load Balancing Algorithms

21

3.4 Goals of Load Balancing Algorithms

22

3.5 Conclusion

22

VIRTUALIZATION

23

4.1 Introduction to virtualization

23

4.2 Modeling the VM allocation

23

4.3 Load Balancing Algorithms

25

4.3.1 Token Routing

25

4.3.2 Round Robin

25

4.3.3 Randomized

25

4.3.4 Central Queuing

26

4.3.5 Connection Mechanism

26

4.4 Metrics for Load Balancing

27

4.5 Contemporary VM Load Balancers

28

4.5.1 Round Robin Load Balancer

29

4.5.2 Throttled Load balancer

30

4.5.3 Active Monitoring Load Balancer

30

4.6 Conclusion

31

PROPOSED SYSTEM

32

5.1 Introduction

32

5.2 Priority weighted Load Balancing Algorithm

32

6

7

8

5.3 Conclusion

34

PROPOSED EXECUTION ENVIRONMENT

35

6.1 Introduction

35

6.2 Class diagram of components in CloudSim

35

6.3 Implementation

36

6.4 Steps in implementation

37

6.5 Conclusion

46

IMPLEMENTATION RESULTS

47

7.1 Introduction

47

7.2 Processing Cost

47

7.3 Response time

48

7.4 Average Response Time

49

7.5 Conclusion

50

REFERENCES

51

LIST OF TABLES

SL. NO

TABLE NAME

PAGE NO.

1

Comparison of load balancing algorithms

27

2

Datacenter parameters

36

3

Datacenter characteristics

36

4

Processing element characteristics

37

5

Comparison of Processing cost

47

6

Comparison of response time

48

7

Comparison of average response time

49

viii

LIST OF FIGURES SL.NO

FIGURE

PG NO

1

Internet

1

2

Cloud components

4

3

Full virtualization

6

4

Para virtualization

7

5

SaaS

8

6

PaaS

9

7

IaaS

10

8

Cloudsim architecture

12

9

VM Provisioning policies

17

10

Round robin load balancer

30

11

Class diagram of cloudsim components

35

12

Chart for processing cost

47

13

Chart for average processing cost

48

14

Chart for response time

49

15

Chart for average response time

49

ix

1. INTRODUCTION 1.1 INTRODUCTION Cloud computing is an on demand service in which shared resources, information, software and other devices are provided according to the clients requirement at specific time. It is a term which is generally used in case of Internet. The whole Internet can be viewed as a cloud. Capital and operational costs can be cut using cloud computing.

Figure 1: A cloud is used in network diagrams to depict the Internet.

Load balancing in cloud computing systems is really a challenge now. Always a distributed solution is required. Because it is not always practically feasible or cost efficient to maintain one or more idle services just as to fulfill the required demands. Jobs can‟t be assigned to appropriate servers and clients individually for 1

efficient load balancing as cloud is a very complex structure and components are present throughout a wide spread area. Here some uncertainty is attached while jobs are assigned. This paper considers some of the methods of load balancing in large scale Cloud systems. Our aim is to provide an evaluation and comparative study of these approaches, demonstrating different distributed algorithms for load balancing and to improve the different performance parameters like throughput, latency etc. for the clouds of different sizes. As the whole Internet can be viewed as a cloud of many connection-less and connection-oriented services, thus concept of load balancing in Wireless sensor networks (WSN) can also be applied to cloud computing systems as WSN is analogous to a cloud having no. of master computers (Servers) and no. of slave computers (Clients) joined in a complex structure.

1.2 MOTIVATION Cloud computing is a vast concept. Many of the algorithms for load balancing in cloud computing have been proposed. Some of those algorithms have been overviewed in this project. The whole Internet can be considered as a cloud of many connection-less and connection-oriented services. So the divisible load scheduling theory for Wireless networks can also be applied for clouds. The performance of various algorithms have been studied.

1.3 OBJECTIVES 1. To study the performance of some of the existing load balancing algorithms.

2. To design and develop a new VM load balancing algorithm by prioritizing tasks and efficiently balancing load across virtual machines.

2

3. To evaluate the performance of the proposed scheme using CloudSim, an abstract cloud computing environment using java language.

1.4 CONCLUSION This chapter gives a brief idea about Cloud Computing and load balancing. It also gives an overall idea about the objectives, motivation and organization of this report.

3

2 CLOUD COMPUTING 2.1 INTRODUCTION In case of Cloud computing services can be used from diverse and widespread resources, rather than remote servers or local machines. There is no standard definition of Cloud computing. Generally it consists of a bunch of distributed servers known as masters, providing demanded services and resources to different clients known as clients in a network with scalability and reliability of datacenter. The distributed computers provide on-demand services. Services may be of software resources (e.g. Software as a Service, SaaS) or physical resources (e.g. Platform as a Service, PaaS) or hardware/infrastructure (e.g. Hardware as a Service, HaaS or Infrastructure as a Service, IaaS ). Amazon EC2 (Amazon Elastic Compute Cloud) is an example of cloud computing services. 2.2 CLOUD COMPONENTS A Cloud system consists of 3 major components such as clients, datacenter, and distributed servers. Each element has a definite purpose and plays a specific role.

Figure 2: Three components make up a cloud computing solution 4

2.2.1 Clients

End users interact with the clients to manage information related to the cloud. Clients generally fall into three categories as given in [1]: _ Mobile: Windows Mobile Smartphone, smartphones, like a Blackberry, or an iPhone. _ Thin: They don‟t do any computation work. They only dispaly the information. Servers do all the works for them. Thin clients don‟t have any internal memory. _ Thick: These use different browsers like IE or mozilla Firefox or Google Chrome to connect to the Internet cloud. 2.2.2 Datacenter

Datacenter is nothing but a collection of servers hosting different applications. A end user connects to the datacenter to subscribe different applications. A datacenter may exist at a large distance from the clients. Now-a-days a concept called virtualisation is used to install a software that allow multiple instances of virtual server applications. 2.2.3 Distributed Servers

Distributed servers are the parts of a cloud which are present throughout the Internet hosting different applications. But while using the application from the cloud, the user will feel that he is using this application from its own machine. 2.3 TYPE OF CLOUDS Based on the domain or environment in which clouds are used, clouds can be divided into 3 categories : _ Public Clouds _ Private Clouds _ Hybrid Clouds (combination of both private and public clouds)

5

2.4 VIRTUALIZATION It is a very useful concept in context of cloud systems. Virtualization means ”something which isn‟t real”, but gives all the facilities of a real. It is the software implementation of a computer which will execute different programs like a real machine. Virtualization is related to cloud, because using virtualization an end user can use different services of a cloud. The remote datacenter will provide different services in a fully or partial virtualized manner. 2 types of virtualization are found in case of clouds as given in [1] : _ Full virtualization _ Para virtualization 2.4.1 Full Virtualization

In case of full virtualization a complete installation of one machine is done on another machine. It will result in a virtual machine which will have all the software‟s that are present in the actual server.

Figure 3: Full Virtualization (adopted from [1]).

Here the remote datacenter delivers the services in a fully virtualized manner. Full virtualization has been successful for several purposes as pointed out in [1]:  Sharing a computer system among multiple users  Isolating users from each other and from the control program  Emulating hardware on another machine 6

2.4.2 Para virtualization

In para vitualization, the hardware allows multiple operating systems to run on single machine by efficient use of system resources such as memory and processor. e.g. VMware software. Here all the services are not fully available, rather the services are provided partially.

Figure 4: Paravirtualization (adopted from [1]).

Paravirtualization has the following advantages as given in [1]:  Disaster recovery: In the event of a system failure, guest instances are moved to another hardware until the machine is repaired or replaced.  Migration: As the hardware can be replaced easily, hence migrating or moving the different parts of a new machine is faster and easier.  Capacity management: In a virtalised environment, it is easier and faster to add more hard drive capacity and processing power. As the system parts or hardwares can be moved or replaced or repaired easily, capacity management is simple and easier.

7

2.5 SERVICES PROVIDED BY CLOUD COMPUTING Service means different types of applications provided by different servers across the cloud. It is generally given as ”as a service”. Services in a cloud are of 3 types as given in [1] :  Software as a Service (SaaS)  Platform as a Service (PaaS)  Hardware as a Service (HaaS) or Infrastructure as a Service (IaaS) 2.5.1 Software as a Service (SaaS)

In SaaS, the user uses different software applications from different servers through the Internet. The user uses the software as it is without any change and do not need to make lots of changes or doen‟t require integration to other systems. The provider does all the upgrades and patching while keeping the infrastructure running.

Figure 5: Software as a service (SaaS) The client will have to pay for the time he uses the software. The software that does a simple task without any need to interact with other systems makes it an ideal candidate for Software as a Service. Customer who isn‟t inclined to perform software development but needs high-powered applications can also be benefitted from SaaS. Some of these applications include (taken from [1]): 8

 Customer resource management (CRM)  Video conferencing  IT service management  Accounting 2.5.2 Platform as a Service (PaaS)

PaaS provides all the resources that are required for building applications and services completely from the Internet, without downloading or installing a software. PaaS services are software design, development, testing, deployment, and hosting. Other services can be team collaboration, database integration, web service integration, data security, storage and versioning etc.

Figure 6: Platform as a service (PaaS) (adopted from [1]) Downfall :  Lack of portability among different providers.  If the service provider is out of business, the user‟s applications, data will be lost. 2.5.3 Hardware as a Service (HaaS) It is also known as Infrastructure as a Service (IaaS). It offers the hardware as a service to a organisation so that it can put anything into the hardware according to its will. HaaS allows the user to “rent” resources (taken from [1]) as 9

 Server space  Network equipment  Memory  CPU cycles  Storage space

Figure 7: Hardware as a service (HaaS) Cloud computing provides a Service Oriented Architecture (SOA) and Internet of Services (IoS) type applications, including fault tolerance, high scalability, availability, flexibility, reduced information technology overhead for the user, reduced cost of ownership, on demand services etc. Central to these issues lies the establishment of an effective load balancing algorithm. 2.6 SIMULATION IN CLOUD : CLOUDSIM Resources and software are shared on the basis of client‟s demand in cloud environment. Essentially, dynamic utilization of resources is achieved under different conditions with various previous established policies. Sometime it is very much difficult and time consuming to measure performance of the applications in real cloud environment. In this consequence, simulation is very much helpful to allow users or developers with practical feedback in spite of having real environment. 10

This section portrays the importance of simulation technique and simulation in cloud. In this project, simulation is carried out with a specific cloud simulator, CloudSim [2]. 2.6.1 Importance of simulation technique: Simulation means mimicking the actual environment towards benefit of the research. The user or researcher can actually analyze the proposed design or existing algorithms through simulation. They can check the efficiency and merit of the design before the actual system is constructed. Simulation is advantageous to the users, as they can explore the benefit of that design repeatedly. This actually reduces the cost of reconstruct as changes have been made during design time. Simulation technique provides lots of advantages as the experiments can be carried out with voluminous data in different abstraction level. Simulators easily make available various kind of virtual environment for verification and performance evaluation of the experimented system. Even most of the time researchers could carry out benchmark experiments repeatedly in scalable environment for evaluating different aspects. 2.6.2 Cloud Simulator- CloudSim Users are capable of accessing shared resources through utilizing available public cloud platform. However, accessing real cloud environment or public cloud is not always handy. Instead of the real environment, cloud simulator could facilitate the experiments. Simulation environment allows customers or users to tune the performance bottlenecks or evaluates different kinds of features under varying load distributions[2]. Different kinds of functionalities of CloudSim are presented in the following [3]. • support for modeling and simulation of large scale cloud computing data centers • support for modeling and simulation of virtualized server hosts, with customizable policies for provisioning host resources to virtual machines 11

• support for modeling and simulation of energy-aware computational resources • support for modeling and simulation of datacenter network topologies and message-passing applications • support for modeling and simulation of federated clouds • support for dynamic insertion of simulation elements, stop and resume of simulation • support for user-defined policies for allocation of hosts to virtual machines and policies for allocation of host resources to virtual machines Besides these above-mentioned functionalities, while developers or researchers, uses CloudSim features, need not to think about the lower level details of cloud based infrastructure and services. The architecture of CloudSim comprises of four layers, as shown in Figure 7. User code Simulation Specification

Cloud Scenario

User Requirements

Scheduling Policy

Application Configuration



User or Data Center Broker

CloudSim User Interface Structures

Cloudlet

Virtual Machine

VM Services

Cloudlet Execution

VM Management

Cloud Services Cloud Resources Network

VM Provisioning

CPU Allocation

Events Handling

Sensor

Network Topology

Memory Allocation

Storage Allocation

Cloud Coordinator

Bandwidth Allocation

Data Center

Message delay Calculation

CloudSim core simulation engine

Fig 8. CloudSim architecture

12

At the bottom most layer, cloud resources (hosts, datacenters) are managed. During the simulation period, these core entities are instantiated and executed. On top of this layer, cloud services, like allocation of CPU, memory, storage and bandwidth are provided as dedicated management interfaces. Another two top most layers are virtual machine services and user interface structures. Virtual machine in user interface structures layer is responsible for physical host specifications such as number of machines and their configurations. CloudSim facilitates a specific host to be concurrently shared among different VMs based on user-defined QoS specifications [3]. This chapter gives a general idea about the basic concepts of cloud computing along with the services provided by cloud computing systems. In addition to that, a brief description of these components and the working relationship between them is presented in the following: Datacenter: Datacenter encompasses a number of hosts in homogeneous or heterogeneous configurations (memory, cores, capacity, and storage). It also creates the bandwidth, memory, and storage devices allocation. Virtual Machine (VM): VM characteristics comprise of memory, processor, storage, and VM scheduling policy. Multiple VM can run on single hosts simultaneously and maintain processor sharing policies. Host: This experiment considers VM need to handle a number of cores to be processed and host should have resource allocation policy to distribute them in these VMs. So host can arrange sufficient memory and bandwidth to the process elements to execute them inside VM. Host is also responsible for creation and destruction of VMs. Cloudlet: Cloudlet is an application component which is responsible to deliver the data in the cloud service model. So the length, and output file sizes parameter of Cloudlet should be greater than or equal to 1. It also contains various ids for data transfer and application hosting policy. 13

2.6.3 Modeling the Cloud The infrastructure-level services (IaaS) related to the clouds can be simulated by extending the Datacenter entity of CloudSim. The Data Center entity manages a number of host entities. The hosts are assigned to one or more VMs based on a VM allocation policy that should be defined by the Cloud service provider. Here, the VM policy stands for the operations control policies related to VM life cycle such as: provisioning of a host to a VM, VM creation, VM destruction, and VM migration. Similarly, one or more application services can be provisioned within a single VM instance, referred to as application provisioning in the context of Cloud computing. In the context of CloudSim, an entity is an instance of a component. A CloudSim component can be a class (abstract or complete), or set of classes that represent one CloudSim model (data center, host). A Datacenter can manage several hosts that in turn manage VMs during their life cycles. Host is a CloudSim component that represents a physical computing server in a Cloud: it is assigned a pre-configured processing capability (expressed in millions of instructions per second – MIPS), memory, storage, and a provisioning policy for allocating processing cores to virtual machines. The Host component implements interfaces that support modeling and simulation of both single-core and multi-core nodes. VM allocation (provisioning) [9] is the process of creating VM instances on hosts that match the critical characteristics (storage, memory), configurations (software environment), and requirements (availability zone) of the SaaS provider. CloudSim supports the development of custom application service models that can be deployed within a VM instance and its users are required to extend the core Cloudlet object for implementing their application services. Furthermore, CloudSim does not enforce any limitation on the service models or provisioning 14

techniques that developers want to implement and perform tests with. Once an application service is defined and modeled, it is assigned to one or more preinstantiated VMs through a service specific allocation policy. Allocation of application-specific VMs to Hosts in a Cloud-based data center is the responsibility of

a

Virtual

Machine

Allocation

controller

component

(called

VmAllocationPolicy). This component exposes a number of custom methods for researchers and developers that aid in implementation of new policies based on optimization goals (user centric, system centric or both). By default, VmAllocationPolicy implements a straightforward policy that allocates VMs to the Host in First-Come-First-Serve (FCFS) basis. Hardware requirements such as the number of processing cores, memory and storage form the basis for such provisioning. Other policies, including the ones likely to be expressed by Cloud providers, can also be easily simulated and modeled in CloudSim. However, policies used by public Cloud providers (Amazon EC2, Microsoft Azure) are not publicly available, and thus a pre-implemented version of these algorithms is not provided with CloudSim. For each Host component, the allocation of processing cores to VMs is done based on a host allocation policy. This policy takes into account several hardware characteristics such as number of CPU cores, CPU share, and amount of memory (physical and secondary) that are allocated to a given VM instance. Hence, CloudSim supports several simulation scenarios that assign specific CPU cores to specific VMs (a space-shared policy) or dynamically distribute the capacity of a core among VMs (time-shared policy); and assign cores to VMs on demand. (check this sentence). Each Host component also instantiates a VM scheduler component, which can either implement the space-shared or the time-shared policy for allocating cores to VMs. Cloud system/application developers and researchers, can further 15

extend the VM scheduler component for experimenting with custom allocation policies. In the next section, the finer level details related to the time-shared and space-shared policies are described. Fundamental software and hardware configuration parameters related to VMs are defined in the VM class. Currently, it supports modeling of several VM configurations offered by Cloud providers such as the Amazon EC2. 2.6.4 Modeling the VM Allocation One of the key aspects that make a Cloud computing infrastructure different from a Grid computing infrastructure is the massive deployment of virtualization tools and technologies. Hence, as against Grids, Clouds contain an extra layer (the virtualization layer) that acts as an execution, management, and hosting environment for application services. Hence, traditional application provisioning models that assign individual application elements to computing nodes do not accurately represent the computational abstraction, which is commonly associated with Cloud resources. For example, consider a Cloud host that has a single processing core, there is a requirement of concurrently instantiating two VMs on that host. Even though in practice VMs are contextually (physical and secondary memory space) isolated, still they need to share the processing cores and system bus. Hence, the amount of hardware resources available to each VM is constrained by the total processing power and system bandwidth available within the host. This critical factor must be considered during the VM provisioning process, to avoid creation of a VM that demands more processing power than is available within the host. In order to allow simulation of different provisioning policies under varying levels of performance isolation, CloudSim supports VM provisioning at two levels: first, at the host level and second, at the VM level. At 16

the host level, it is possible to specify how much of the overall processing power of each core will be assigned to each VM. At the VM level, the VM assigns a fixed amount of the available processing power to the individual application services (task units) that are hosted within its execution engine. For the purpose of this paper, we consider a task unit as a finer abstraction of an application service being hosted in the VM. At each level, CloudSim implements the time-shared and space-shared provisioning policies. To clearly illustrate the difference between these policies and their effect on the application service performance, in Figure 4 we show a simple VM provisioning scenario. In this figure, a host with two CPU cores receives request for hosting two VMs, such that each one requires two cores and plans to host four tasks units. More specifically, tasks t1, t2, t3 and t4 to be hosted in VM1, while t5, t6, t7, and t8 to be hosted in VM2.

(a)

(c)

(b)

(d)

Figure 9. Effects of different provisioning policies on task unit execution: (a) Space-shared provisioning for VMs and tasks, (b) Space-shared provisioning for VMs and time-shared provisioning for tasks, (c) Time-shared provisioning for VMs, space-shared provisioning for tasks, and (d) Time-shared provisioning for VMs and tasks.

Figure 9(a) presents a provisioning scenario, where the space-shared policy is applied for both VMs and task units. As each VM requires two cores, in spaceshared mode only one VM can run at a given instance of time. Therefore, VM2 can 17

only be assigned the core once VM1 finishes the execution of task units. The same happens for provisioning tasks within the VM1: since each task unit demands only one core, therefore both of them can run simultaneously. During this period remaining tasks (2 and 3) wait in the execution queue. By using a space-shared policy, the estimated finish time of a task p managed by a VM i is given by: eft(p)=est +

where est(p) is the Cloudlet (cloud task) estimated start time and rl is the total number of instructions that the Cloudlet will need to execute on a processor. The estimated start time depends on the position of the Cloudlet in the execution queue, because the processing unit is used exclusively (space-shared mode) by the Cloudlet. Cloudlets are put in the queue when there are free processing cores available that can be assigned to the VM. In this policy, the total capacity of a host having np processing elements is given by: capacity=∑ where cap(i) is processing strength of individual elements. In Figure 9(b), a space-shared policy is applied for allocating VMs to hosts and a time-shared policy forms the basis for allocating task units to processing core within a VM. Hence, during a VM lifetime, all the tasks assigned to it are dynamically context switched during their lifecycle. By using a time-shared policy, the estimated finish time of a Cloudlet managed by a VM is given by Eft(p)= where eft(p) is the estimated finish time, ct is the current simulation time, and cores(p) is the number of cores (processing elements) required by the Cloudlet. In 18

time-shared mode, multiple Cloudlets (task units) can simultaneously multi-task within a VM. In this case, we compute the total processing capacity of Cloud host as capacity=

∑ ∑

where cap(i) is processing strength of individual elements. In Figure 9(c), a time-shared provisioning is used for VMs, while task units are provisioned based on a space-shared policy. In this case, each VM receives a time slice on each processing core, which then distributes the slices among task units on a space-shared basis. As the cores are shared, the amount of processing power available to a VM is variable. This is determined calculating VMs that are active on a host. As the task units are assigned based on a space-shared policy, which means that at any given instance of time only one task can be actively using the processing core. Finally, in Figure 9(d) a time-shared allocation is applied for both VMs and task units. Hence, the processing power is concurrently shared by the VMs and the shares of each VM are simultaneously divided among its task units. In this case, there are no queuing delays associated with task units. CONCLUSION: In this chapter the basics of Cloud computing, virtualization, simulation techniques and a java based cloud simulator CloudSim was discussed. The way in which CloudSim models the cloud and Virtual Machines and different policies for scheduling is studied.

19

3 LOAD BALANCING 3.1 INTRODUCTION It is a process of reassigning the total load to the individual nodes of the collective system to make resource utilization effective and to improve the response time of the job, simultaneously removing a condition in which some of the nodes are over loaded while some others are under loaded. A load balancing algorithm which is dynamic in nature does not consider the previous state or behavior of the system, that is, it depends on the present behavior of the system. The important things to consider while developing such algorithm are:  estimation of load,  comparison of load,  stability of different system, 

performance of system,

 interaction between the nodes,  nature of work to be transferred,  selecting of nodes and many other ones. This load considered can be in terms of CPU load, amount of memory used, delay or Network load.

Load balancing in cloud computing is the process of distributing the load among various resources in any system. Thus load need to be distributed over the resources in cloud-based architecture, so that each resources does approximately the equal amount of task at any point of time. Basic need is to provide some techniques to balance requests to provide the solution of the application faster.

20

Cloud vendors are based on automatic load balancing services, which allow clients to increase the number of CPUs or memories for their resources to scale with increased demands. This service is optional and depends on the clients business needs. So load balancing serves two important needs, primarily to promote availability of Cloud resources and secondarily to promote performance.

3.2 GOALS OF LOAD BALANCING The goals of load balancing are:  To improve the performance substantially  To have a backup plan in case the system fails even partially  To maintain the system stability  To accommodate future modification in the system

3.3 TYPES OF LOAD BALANCING ALGORITHMS Depending on who initiated the process, load balancing algorithms can be of three Categories:  Sender Initiated: If the load balancing algorithm is initialised by the sender  Receiver Initiated: If the load balancing algorithm is initiated by the receiver  Symmetric: It is the combination of both sender initiated and receiver initiated Depending on the current state of the system, load balancing algorithms can be divided into 2 categories:  Static: It does not depend on the current state of the system. Prior knowledge of the system is needed  Dynamic: Decisions on load balancing are based on current state of the system. No prior knowledge is needed. So it is better than static approach. 21

There are also other load balancing mechanisms like  Centralized load balancing  De-centralized load balancing  Periodic load balancing  Non-Periodic load balancing. 3.4 GOALS OF LOAD BALANCING ALGORITHMS:  Cost effectiveness: primary aim is to achieve an overall improvement in system performance at a reasonable cost.  Scalability and flexibility: the distributed system in which the algorithm is implemented may change in size or topology. So the algorithm must be scalable and flexible enough to allow such changes to be handled easily.  Priority: prioritization of the resources or jobs need to be done on before hand through the algorithm itself for better service to the important or high prioritized jobs in spite of equal service provision for all the jobs regardless of their origin. 3.5 CONCLUSION This chapter explains the concept of load balancing, types of load balancing algorithms, general idea about load balancing algorithms and the different policies that can be used in it.

22

4. VIRTUALIZATION 4.1 INTRODUCTION TO VIRTUALIZATION: The virtualization forms the foundation of cloud technology where Virtualization is an emerging IT paradigm that separates computing functions and technology implementations from physical hardware. Cloud computing, for example, is the Virtualization of computer programs through an internet connection rather than installing applications on every office computer. Using virtualization, users can access servers or storage without knowing specific server or storage details. The virtualization layer will execute user request for computing resources by accessing appropriate resources. Virtualization can be applied to many types of computer resources: Infrastructure such as Storage, Network, Compute (CPU / Memory etc.), Platform (such as Linux/ Windows OS) and Software as Services. Cloud computing in computing research and industry today has the potential to make the new idea of „computing as a utility‟ in the near future. The Internet is often represented as a cloud and the term “Cloud Computing”. Cloud computing is the dynamic provisioning of IT capabilities/IT services (hardware, software, or services) from third parties over a network. These IT services are delivered on demand and they are delivered elastically, in terms of „able to scale out‟ and „scale in‟. The sections below briefly details different types of cloud computing and how Virtual Machines (VMs) can be provided as cloud Infrastructure as a Service(Iaas).

4.2 MODELING THE VM ALLOCATION Cloud computing infrastructure is the massive deployment of virtualization tools and techniques as it has an extra layer i.e. Virtualization layer that acts as an

23

creation, execution, management, and hosting environment for application services. The modeled VMs in the above virtual environment are contextually isolated but still they need to share computing resources- processing cores, system bus etc. Hence, the amount of hardware resources available to each VM is constrained by the total processing power ie. CPU, the memory and system bandwidth available within the host. The choice of virtual machine, meaning that you can select a configuration of CPU, memory, storage, bandwidth etc. that is optimal for an application. CloudSim supports VM provisioning at two levels: At the host level – It is possible to specify how much of the overall processing power of each core will be assigned to each VM. Known as VM policy Allocation  At the VM level – the VM assigns a fixed amount of the available processing power to the individual application services (task units) that are hosted within its execution engine. Known as VM Scheduling.

Note that at each level CloudSim implements the time-shared and space-shared provisioning policies. In this project, we have implemented the VM load Balancing algorithm at the VM level and a comparison is made between time-shared and space-shared provisioning policies, where, individual application services is assigned varying (different) amount of the available processing power of VMs based on priority of task units. This is because- in the real world, it‟s not necessary all the VMs in a DataCenter has fixed amount of processing powers but it can vary with different computing nodes at different ends. And then to these VMs of different processing powers, the tasks/requests (application services) based on priority are assigned or allocated to the most 24

powerful VM and then to the lowest and so on. Hence, the performance parameters such as overall response time and data processing time are optimized. 4.3 SOME LOAD BALANCING ALGORITHMS: Brief reviews of few existing load balancing algorithms are presented in the following: 4.3.1 Token Routing: The main objective of the algorithm is to minimize the system cost by moving the tokens around the system. But in a scalable cloud system agents cannot have the enough information of distributing the work load due to communication bottleneck. So the workload distribution among the agents is not fixed. The drawback of the token routing algorithm can be removed with the help of heuristic approach of token based load balancing. This algorithm provides the fast and efficient routing decision. In this algorithm agent does not need to have an idea of the complete knowledge of their global state and neighbor‟s working load. To make their decision where to pass the token they actually build their own knowledge base. This knowledge base is actually derived from the previously received tokens. So in this approach no communication overhead is generated. 4.3.2. Round Robin: In round robin algorithm, the processes are divided between all processors. Each process is assigned to the processor in a round robin order. The process allocation order is maintained locally independent of the allocations from remote processors. Though the work load distributions between processors are equal but the job processing time for different processes are not same. So at any point of time some nodes may be heavily loaded and others remain idle. This algorithm is mostly used in web servers where Http requests are of similar nature and distributed equally.

25

4.3.3. Randomized: Randomized algorithm is of type static in nature. In this algorithm a process can be handled by a particular node n with a probability p. The process allocation order is maintained for each processor independent of allocation from remote processor. This algorithm works well in case of processes are of equal loaded. However, problem arises when loads are of different computational complexities. Randomized algorithm does not maintain deterministic approach. It works well when Round Robin algorithm generates overhead for process queue. 4.3.4. Central queuing: Central queuing algorithm works on the principal of dynamic distribution. Each new activity arriving at the queue manager is inserted into the queue. When request for an activity is received by the queue manager it removes the first activity from the queue and sends it to the requester. If no ready activity is present in the queue the request is buffered, until a new activity is available. But in case new activity comes to the queue while there are unanswered requests in the queue the first such request is removed from the queue and new activity is assigned to it. When a processor load falls under the threshold then the local load manager sends a request for the new activity to the central load manager. The central manager then answers the request if ready activity is found otherwise queues the request until new activity arrives. 4.3.5. Connection mechanism: Load balancing algorithm can also be based on least connection mechanism which is a part of dynamic scheduling algorithm. It needs to count the number of connections for each server dynamically to estimate the load. The load balancer records the connection number of each server. The number of connection increases when a new connection is dispatched to it, and decreases the number when connection finishes or timeout happens. 26

Table 1 presents a comparative study of the above-mentioned load balancing algorithms:

Algorithm

Nature migration

Environment Process migration

Resource Utilization

Steadiness

Token Routing

dynamic

decentralized

possible

more

unstable

Round Robin

static

decentralized

not possible

Less

stable

Randomized

static

decentralized

not possible

Less

stable

Central Queuing

dynamic

centralized

not possible

Less

unstable

Least Connection

dynamic

centralized

not possible

Less

stable

Table 1: Comparative Study of Load Balancing Algorithms 4.4. METRICS FOR LOAD BALANCING IN CLOUDS: The existing load balancing techniques in clouds, consider various parameters like performance, response time, scalability, throughput, resource utilization, fault tolerance, migration time and associated overhead. But, for an energy-efficient load balancing, metrics like energy consumption and carbon emission should also be considered. • Overhead Associated - determines the amount of overhead involved while implementing a load-balancing algorithm. It is composed of overhead due to movement of tasks, inter-processor and inter-process communication. This should be minimized so that a load balancing technique can work efficiently. • Throughput - is used to calculate the no. of tasks whose execution has been completed. It should be high to improve the performance of the system. • Performance – is used to check the efficiency of the system. It has to be improved at a reasonable cost e.g. reduce response time while keeping acceptable delays. 27

• Resource Utilization - is used to check the utilization of resources. It should be optimized for an efficient load balancing. • Scalability - is the ability of an algorithm to perform load balancing for a system with any finite number of nodes. This metric should be improved. • Response Time - is the amount of time taken to respond by a particular load balancing algorithm in a distributed system. This parameter should be minimized. • Fault Tolerance - is the ability of an algorithm to perform uniform load balancing in spite of arbitrary node or link failure. The load balancing should be a good fault-tolerant technique. • Migration time - is the time to migrate the jobs or resources from one node to other. It should be minimized in order to enhance the performance of the system. • Energy Consumption (EC) - determines the energy consumption of all the resources in the system. Load balancing helps in avoiding overheating by balancing the workload across all the nodes of a Cloud, hence reducing energy consumption. • Carbon Emission (CE) - calculates the carbon emission of all the resources in the system. As energy consumption and carbon emission go hand in hand, the more the energy consumed, higher is the carbon footprint. So, for an energy-efficient load balancing solution, it should be reduced.

4.5 CONTEMPORARY VM LOAD BALANCERS Virtual machine enables the abstraction of an OS and Application running on it from the hardware. The interior hardware infrastructure services interrelated to the Clouds is modeled in the Cloudsim simulator by a Datacenter element for handling service requests. These requests are application elements sandboxed within VMs, which need to be allocated a share of processing power on Datacenter‟s host components. DataCenter object manages the data center 28

management activities such as VM creation and destruction and does the routing of user requests received from User Bases via the Internet to the VMs. The Data Center Controller, uses a VmLoadBalancer to determine which VM should be assigned the next request for processing. The contemporary Vmloadbalancer are Round Robin, throttled and active monitoring load balancing algorithms. 4.5.1. Round Robin Load Balancer (RRLB) The datacenter controller assigns the requests to a list of VMs on a rotating basis. The first request is allocated to a VM- picked randomly from the group and then the DataCenter controller assigns the subsequent requests in a circular order. Once the VM is assigned the request, the VM is moved to the end of the list.

In this RRLB; there is a better allocation concept known as Weighted Round Robin Allocation in which one can assign a weight to each VM so that if one VM is capable of handling twice as much load as the other, the powerful server gets a weight of 2. In such cases, the DataCenter Controller will assign two requests to the powerful VM for each request assigned to a weaker one.

The major issue in this allocation is this that it does not consider the advanced load balancing requirements such as processing times for each individual requests.

29

Fig 10: Round Robin Load Balancer

4.4.2. Throttled Load Balancer (TLB) The TLB maintains a record of the state of each virtual machine (busy/idle). If a request arrived concerning the allocation of virtual machine, the TLB sends the ID of ideal virtual machine to the data center controller and data center controller allocates the ideal virtual machine.

4.4.3. Active Monitoring Load Balancer (AMLB) The AMLB maintains information about each VMs and the number of requests currently allocated to which VM. When a request to allocate a new VM arrives, it identifies the least loaded VM. If there are more than one, the first 30

identified is selected. ActiveVmLoadBalancer returns the VM id to the Data Center Controller. The data Center Controller sends the request to the VM identified by that id. DataCenterController notifies the ActiveVmLoadBalancer of the new allocation and cloudlet is sent to it. 4.5 CONCLUSION This chapter focuses on virtualization, an overview of virtual machines and how CloudSim supports Load balancing algorithms. Contemporary load balancing algorithms are also introduced to get a clear idea about the proposed system.

31

5. PROPOSED SYSTEM 5.1 INTRODUCTION The „Priority Weighted Load Balancing Algorithm‟ is implemented; modifying the Active Monitoring Load Balancer by assigning a weight to each VM as discussed in Weighted Round Robin Algorithm of cloud computing and providing priority to requests in order to achieve better response time and processing time. In this proposed Load balancing algorithm using the concept of weights in active monitoring, the VM are assigned varying (different) amount of the available processing power of server/ physical host to the individual application services and also applying priority to requests provide better performance. To these VMs of different processing powers; the tasks/requests (application services) are prioritized and assigned or allocated to the most powerful VM and then to the lowest and so on according to its weight and its availability. Hence optimizing the given performance parameters. 5.2 PRIORITY WEIGHTED LOAD BALANCING ALGORITHM (Algorithm) STEP 1: Create VM‟s of different Datacenter according to computing power of host/physical server in terms of its core processor, processing speed, memory, storage etc. STEP 2: Allocate weighted count according to the computing power of the VM‟s in Datacenter. If one VM is capable of having twice as much load as the other, the powerful server gets a weight of „2‟ or if it can take four times load then server gets a weight of „4‟ and so on. For example: A. Host server with single core processor, 1GB of memory, 1TB of Storage space, 1000000 bandwidth will have weighted count=1 32

B. Host server with 2 core processor, 4GB of memory, 2TB of Storage space and 1000000 bandwidth will have weighted count=2 C. Host server with quard core processor, 8GB of memory 4TB of Storage space and 1000000 bandwidth will have weighted count=4 and so on.. STEP 3: PriorityWeightedActiveVmLoadBalancer maintains an index table of VMs, associated weighted count and the number of requests currently allocated to the VM. At start all VM's have 0 allocations. STEP 4: The requests are prioritized based on the applications from which they arrive from. STEP 5: When a request to allocate a new VM from the DataCenterController arrives, it gets the priority of the request and then parses the table to find the most powerful VM. If there are more than one, then the one which is least loaded is selected. STEP 6: PriorityWeightedActiveVmLoadBalancer returns the VM id to the DataCenterController. STEP 7: The DataCenterController sends the request to the VM identified by that id. STEP 8: DataCenterController notifies the Priority Weighted Active Vm Load Balancer of the new allocation. STEP9: PriorityWeightedActiveVmLoadBalancer updates the allocation table increasing the allocations count for that VM. STEP 10: When the VM finishes processing the request, and the DataCenterController

receives

the

response

cloudlet,

it

notifies

the

PriorityWeightedActiveVmLoadBalancer of the VM de-allocation. STEP 11:The Priority Weighted Active Vm Load Balancer updates the allocation table by decreasing the allocation count for the VM by one. STEP 12: Continue from step 5. 33

The purpose of algorithm is to find the expected Response Time of each Virtual Machine because virtual machine are of heterogeneous capacity with regard to its processing performance, the expected response time can be found with the help of the following formulas: Response Time = Fint - Arrt + TDelay (1) Where, Arrt is the arrival time of user request and Fint is the finish time of user request and the transmission delay can be determined by using the following formulas: TDelay = T + T(2)latencytransfer Where, TDelay is the transmission delay Tlatency is the network latency and T transfer is the time taken to transfer the size of data of a single request (D) from source location to destination. Ttransfer = D / Bwperuser (3) Bwperuser = Bwtotal / Nr (4) Where, Bwtotal is the total available bandwidth and Nr is the number of user requests currently in transmission. The Internet Characteristics also keeps track of the number of user requests in-flight between two regions for the value of Nr.

5.3 CONCLUSION In this chapter, our new algorithm for load balancing has been proposed. The various formulas to calculate response time, delay and processing time are defined.

34

6. PROPOSED EXECUTION ENVIRONMENT 6.1 INTRODUCTION This chapter discusses about implementing the proposed environment in CloudSim, a java based cloud simulator. The components of the simulator, implementation, coding and comparisons will be discussed in the next sections of this chapter. 6.2 CLASS DIAGRAM OF COMPONENTS OF CLOUDSIM

Fig 11: Class diagram of CloudSim components 35

6.3 IMPLEMENTATION The proposed algorithm is implemented through simulation package CloudSim based tool [7][10][11]. Java language is used for develop and implement the new „Priority Weighted VM load balancing Algorithm‟. Assuming that the applications are deployed in 3 datacenters having 2 virtual machines each running on 6 physical hosts, then the parameter values are as follows: Parameter

Value

Datacenter OS

Linux

Datacenter Architecture

X86

Service Broker Policy

Optimize response time

Physical hardware units(hosts)

6

No. of VM‟s

6 Table 2 : Datacenter Parameters

The datacenter characteristics of the three datacenters are as follows: Characteristics

Datacenter 1

Datacenter 2

Datacenter 3

Cost*

5.0

3.0

4.0

CostPerMem#

0.5

0.3

0.4

CostPerStorage$

0.05

0.05

0.04

costPerBw**

0.0

0.0

0.0

Table 3: Datacenter Characteristics * The cost of using processing in this resource # The cost of using memory in this resource $ The cost of using storage in this resource ** The cost of using bw in this resource

36

The detail of the processing element in each host is given below: No of processors

Processor speed(MIPS)

VM policy

1

900

Space-shared

2

2000

Space- shared

Table 4: Processing element characteristics 6.4 STEPS IN IMPLEMENTING THE ALGORITHM IN CLOUDSIM: The following are the steps to implement the algorithm in CloudSim. 6.4.1 First step: Initialize the CloudSim package. It should be called

before

creating any entities. int num_user = 1; // number of cloud users Calendar calendar = Calendar.getInstance(); boolean trace_flag = false; // mean trace events

Initialize the GridSim library CloudSim.init(num_user, calendar, trace_flag); 6.4.2 Second step: Create Datacenters. Datacenters are theCreate resource providers in CloudSim. We need at list one of them to run a CloudSim simulation. We are creating 3 datacenters in the above given specification. Datacenter datacenter0 = createDatacenter("Datacenter_0"); Datacenter datacenter1 = createDatacenter("Datacenter_1"); Datacenter datacenter2 = createDatacenter("Datacenter_2"); Method implementing specifications to create Datacenter. private static Datacenter createDatacenter(String name){ // Here are the steps needed to create a PowerDatacenter: // 1. We need to create a list to store our machine List hostList = new ArrayList(); 37

// 2. A Machine contains one or more PEs or CPUs/Cores. List peList = new ArrayList(); List peList1 = new ArrayList(); int mips = 1000; // 3. Create PEs and add these into a list. peList.add(new Pe(0, new PeProvisionerSimple(900))); peList1.add(new Pe(0, new PeProvisionerSimple(mips))); peList1.add(new Pe(1, new PeProvisionerSimple(mips))); //4. Create Host with its id and list of PEs and add them to the list of machines int hostId=0; int ram = 1024*2; //host memory (MB) long storage = 1000000; //host storage int bw = 100000; //in this example, the VMAllocatonPolicy in use is SpaceShared. It means that //only one VM is allowed to run on each Pe. hostList.add( new Host( hostId, new RamProvisionerSimple(ram), new BwProvisionerSimple(bw), storage, peList, new VmSchedulerSpaceShared(peList)) ); // This is our first machine hostId++; hostList.add( new Host( hostId, 38

new RamProvisionerSimple(ram), new BwProvisionerSimple(bw), storage, peList1, new VmSchedulerSpaceShared(peList)) );

// 5. Create a DatacenterCharacteristics object that stores the properties of a //data center: architecture, OS, list of Machines, allocation policy: time- or //space-shared, time zone and its price (G$/Pe time unit). String arch = "x86";

// system architecture

String os = "Linux";

// operating system

String vmm = "Xen"; double time_zone = 10.0;

// time zone this resource located

double cost = 3.0;

// the cost of using processing in this resource

double costPerMem = 0.05; // the cost of using memory in this resource double costPerStorage = 0.001; // the cost of using storage in this resource double costPerBw = 0.0; // the cost of using bw in this resource LinkedList storageList = new LinkedList(); DatacenterCharacteristics characteristics = new DatacenterCharacteristics( arch, os, vmm, hostList, time_zone, 5.0, 0.5,0.05, costPerBw); DatacenterCharacteristics characteristics1 = new DatacenterCharacteristics( arch, os, vmm, hostList, time_zone, 3.0, 0.3,0.05, costPerBw); DatacenterCharacteristics characteristics2 = new DatacenterCharacteristics( arch, os, vmm, hostList, time_zone, 4.0, 0.4,0.04, costPerBw);

39

// 6. Finally, we need to create a PowerDatacenter object. Datacenter datacenter = null; try { if(name == "Datacenter_0") datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0); else if (name== "Datacenter_1") datacenter = new Datacenter(name, characteristics1, new VmAllocationPolicySimple(hostList), storageList, 0); else datacenter = new Datacenter(name, characteristics2, new VmAllocationPolicySimple(hostList), storageList, 0); } catch (Exception e) {e.printStackTrace();} return datacenter; } 6.4.3 Third step: Create Broker. DatacenterBroker represents a broker acting on behalf of a user. It hides VM management, as vm creation, sumbission of cloudlets to this VMs and destruction of VMs.

DatacenterBroker broker = createBroker(); int brokerId = broker.getId();

40

Method to create datacenterBroker private static DatacenterBroker createBroker(){

DatacenterBroker broker = null; try { broker = new DatacenterBroker("Broker"); } catch (Exception e) { e.printStackTrace(); return null; } return broker; } 6.4.4 Fourth step: Create Virtual machines Vm represents a VM: it runs inside a Host, sharing hostList with other VMs. It processes cloudlets. This processing happens according to a policy, defined by the CloudletScheduler. Each VM has a owner, which can submit cloudlets to the VM to be executed vmlist = new ArrayList(); //VM description int vmid = 0; int mips = 250; long size = 100000; //image size (MB) int ram = 512; //vm memory (MB) long bw = 1000; int pesNumber = 1; //number of cpus String vmm = "Xen"; //VMM name

41

//create any number of VMs Vm vm1 = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerSpaceShared());

//the second VM will have twice the priority of VM1 and so will receive twice //CPU time and so on vmid++;

Vm vm2 = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerSpaceShared()); . . . //add the VMs to the vmList vmlist.add(vm1); vmlist.add(vm2); //submit vm list to the broker broker.submitVmList(vmlist); 6.4.5 Fifth step: Create two CloudletLists. Each list can contain any number of cloudlets of different lengths. Submit the lists to the broker. cloudletList1 = new ArrayList(); cloudletList2 = new ArrayList(); cloudletList1 = createCloudlet(brokerId, 10, 0); // creating 10 cloudlets cloudletList2 = createCloudlet1(brokerId, 10, 0); // creating 10 cloudlets //submit cloudlet list to the broker broker.submitCloudletList(cloudletList1); broker.submitCloudletList(cloudletList2) 42

METHOD TO CREATE CLOUDLETS FOR LIST1 private static List createCloudlet(int userId, int cloudlets, int idShift){ // Creates a container to store Cloudlets LinkedList list1 = new LinkedList();

//cloudlet parameters long length = 40000; long fileSize = 300; long outputSize = 300; int pesNumber = 1; UtilizationModel utilizationModel = new UtilizationModelFull(); Cloudlet[] cloudlet = new Cloudlet[cloudlets]; for(int i=0;i
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF