Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Finald

150 views

Published on

dfgh

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Finald

  1. 1. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 1 M.Tech 1. INTRODUCTION: Cloud computing allows business customers to scale up and down their resource usage based on needs. Many of the touted gains in the cloud model come from resource multiplexing through virtualization technology. In this, we present a system that uses virtualization technology to allocate data center resources dynamically based on application demands and support green computing by optimizing the number of servers in use 2. SYSTEM ANALYSIS 2.1 EXISTING SYSTEM: • Virtual machine monitors (vmms) like xen provide a mechanism for mapping virtual machines (vms) to physical resources. • This mapping is largely hidden from the cloud users. • It is up to the cloud provider to make sure the underlying physical machines (pms) have sufficient resources to meet their needs. • Vm live migration technology makes it possible to change the mapping between vms and pms while applications are running. 2.2 PROPOSED SYSTEM:  We present the design and implementation of an automated resource management system that achieves a good balance between overload avoidance and green computing  Overload avoidance: the capacity of a pm should be sufficient to satisfy the resource needs of all vms running on it. Otherwise, the pm is overloaded and can lead to degraded performance of its vms.  Green computing: the number of pms used should be minimized as long as they can still satisfy the needs of all vms. Idle pms can be turned off to save energy.  We develop a resource allocation system that can avoid overload in the system effectively while minimizing the number of servers used.
  2. 2. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 2 M.Tech 2.3 Module Description: Number of modules- After suspicious analysis, the system has been identified to have the following modules 1. Cloud computing module 2. Resource Management Module 3. Virtualization Module 1. Cloud computing module: Cloud computing refers to applications and services offered over the Internet. These services are offered from data centers all over the world, which collectively are referred to as the "cloud." Cloud computing is a movement away from applications needing to be installed on an individual's computer towards the applications being hosted online. Cloud resources are usually not only shared by multiple users but as well as dynamically re-allocated as per demand. This can work for allocating resources to users in different time zones. 2. Resource Management Module: Dynamic resource management has become an active area of research in the Cloud Computing paradigm. Cost of resources varies significantly depending on configuration for using them. Hence efficient management of resources is of prime interest to both Cloud Providers and Cloud Users. The success of any cloud management software critically de-pends on the flexibility; scale and efficiency with which it can utilize the underlying hardware resources while pro-viding necessary performance isolation. Successful resource management solution for cloud environments, needs to provide a rich set of resource controls for better isolation, while doing initial placement and load balancing for efficient utilization of underlying resources. 3. Virtualization Module Virtualization, in computing, is the creation of a virtual (rather than actual) Version of something, such as a hardware platform, operating system, and a storage device or network resources widely used technique for dynamic resource allocation in a virtualized environment.
  3. 3. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 3 M.Tech The process of running two or more logical computer system so on one set of physical hardware. Dynamic placement of virtual servers to minimize SLA(Service level agreement) violations. 3. SYSTEM REQUIREMENTS AND SPECIFICATIONS 3.1SOFTWARE REQUIREMENTS  Operating System : Windows XP and higher versions  User Interface : HTML, CSS  Client-side Scripting : JavaScript  Programming Language : Java  Web components : JSP  Other technologies : JDBC,  IDE/Workbench : Net Beans8.1  SERVER : APACHE TOMCAT 8.0.27  Database : MYSQL 3.2 HARDWARE REQUIREMENTS  Hard Disk : 40GB  RAM : 1GB  Processor : Core2duo And Above 4Feasibility Study: The feasibility of the project is analyzed in this phase and business proposal is put forth with a very general plan for the project and some cost estimates. During system analysis the feasibility study of the proposed system is to be carried out. This is to ensure that the proposed system is not a burden to the company.
  4. 4. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 4 M.Tech Three key considerations involved in the feasibility analysis are  ECONOMICAL FEASIBILITY  TECHNICAL FEASIBILITY  SOCIAL FEASIBILITY 4.1 Economic Feasibility: This study is carried out to check the economic impact that the system will have on the organization. The amount that the company can pour into the development of the system is limited. The expenditures must be justified. Thus the developed system as well within the budget and this was achieved because most of the technologies used are freely available. Only the customized products had to be purchased. 4.2 Technical Feasibility: This study is carried out to check the technical requirements of the system. Any system developed must not have a high demand on the available technical resources. The developed system must have a modest requirement, as only minimal or null changes are required for implementing this system. 4.3 SOCIAL FEASIBILITY The aspect of study is to check the level of acceptance of the system by the user. This includes the process of training the user to use the system efficiently. The level of acceptance by the users solely depends on the methods that are employed to educate the user about the system and to make user familiar with it. 5UML DIAGRAMS The Unified Modeling Language (UML) is used to specify, visualize, modify, construct and document the artifacts of an object-oriented software intensive system under development.
  5. 5. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 5 M.Tech UML describes the real time systems it is very important to make a conceptual model and then proceed gradually. Conceptual model of UML can be mastered by learning the following three major elements: 3. UML building blocks 4. Rules to connect the building blocks 5. Common mechanisms of UML The building blocks of UML can be defined as: a) Things b) Relationships c) Diagrams (a) Things: Things are the most important building blocks of UML. Things can be: 1.Structural 2.Behavioral 3.Grouping 4.Annotational 1. Structural things:TheStructural things define the static part of the model. They represent physical and conceptual elements. Following are the brief descriptions of the structural things. A) Class: Class represents set of objects having similar responsibilities.
  6. 6. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 6 M.Tech B) Interface: Interface defines a set of operations which specify the responsibility of a class. C) Collaboration: Collaboration defines interaction between elements. D) Use case: Use case represents a set of actions performed by a system for a specific goal. E) Component: Component describes physical part of a system. F) Node: A node can be defined as a physical element that exists at run time.
  7. 7. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 7 M.Tech 2. Behavioral things:A behavioral thing consists of the dynamic parts of UML models. Following are the behavioral things: A) Interaction: Interaction is defined as a behavior that consists of a group of messages exchanged among elements to accomplish a specific task. b) State machine: State machine is useful when the state of an object in its life cycle is important. It defines the sequence of states an object goes through in response to events. Events are external factors responsible for state change. 3. Grouping things: Grouping things can be defined as a mechanism to group elements of a UML model together. There is only one grouping thing available: Package: Package is the only one grouping thing available for gathering structural and behavioral things.
  8. 8. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 8 M.Tech 4. Annotational things: Annotational things can be defined as a mechanism to capture remarks, descriptions, and comments of UML model elements. Note is the only one Annotational thing available. Note: A note is used to render comments, constraints etc of an UML element. (2) Relationship: Relationship is another most important building block of UML. It shows how elements are associated with each other and this association describes the functionality of an application. There are four kinds of relationships available. A)Dependency: Dependency is a relationship between two things in which change in one element also affects the other one. b) Association: Association is basically a set of links that connects elements of an UML model. It also describes how many objects are taking part in that relationship.
  9. 9. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 9 M.Tech c) Generalization: Generalization can be defined as a relationship which connects a specialized element with a generalized element. It describes inheritance relationship in the world of objects. D)Realization: Realization can be defined as a relationship in which two elements are connected. One element describes some responsibility which is not implemented and the other one implements them. This relationship exists in case of interfaces. UML Diagrams: UML diagrams are the ultimate output of the entire discussion. All the elements, relationships are used to make a complete UML diagram and the diagram represents a system.The visual effect of the UML diagram is the most important part of the entire process. All the other elements are used to make it a complete one. UML includes the following nine diagrams and the details are described in the following chapters. 1. Class diagram: It describes the structure of a system by showing the system's classes, their attributes, and the relationships among the classes. 2. Object diagram: It shows a complete or partial view of the structure of a modeled system at a specific time. 3. Use case diagram: It shows the functionality provided by a system in terms of actors, their goals represented as use cases, and any dependencies among those use cases.
  10. 10. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 10 M.Tech 4. Sequence diagram: It shows how objects communicate with each other in terms of a sequence of messages. Also indicates the lifespan of objects relative to those messages 5. Collaboration diagram: It is a specific type of interaction diagram, where the focus is on timing constraints. 6. Activity diagram: It represents the business and operational step-by-step workflows of components in a system. An activity diagram shows the overall flow of control. 7. State chart diagram: It is standardized notation to describe many systems, from computer programs to business processes. 8. Deployment diagram: It serves to model the hardware used in system implementations, and the execution environments and artifacts deployed on the hardware. 9. Component diagram: It depicts how a software system is split up into components and shows the dependencies among these components. 6 . Use case Diagram: It shows the functionality provided by a system in terms of actors, their goals represented as use cases, and any dependencies among those use cases. The complete use case diagram for the project is given as:
  11. 11. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 11 M.Tech Use case Diagram for service-provider module Register Login viewCloudUserRequests viewCloudSites viewServerStatus resourceGraph serviceProvider logOut
  12. 12. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 12 M.Tech Use case Diagram for cloud computing module login register domain register cloud user details domain details create site site status cloud computing module view hosted sites
  13. 13. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 13 M.Tech 6 Sequence diagram: It shows how objects communicate with each other in terms of a sequence of messages. Also indicates the lifespan of objects relative to those messages. serviceProvider Register Login viewCloudUser Requests viewCloudSites vieServerStatus viewResource Graph Amazon S23(Database) enterRegistrationDetails store in DB registered registeredSuccessfully enter uname&password verify verifiedloginSuccessfully views cloud user request retrive form DB views websites hosted in the cloud retrive from DB viewing the status of servers i.e memory alloted or availablememory get from DB views Memory alloxcation Status in Graphical format retrive from DB
  14. 14. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 14 M.Tech Activity Diagram: It represents the business and operational step-by-step workflows of components in a system. An activity diagram shows the overall flow of control. Activity diagram for cloud computing provider: Activity diagram for cloud computing module: user request cloud sites site hosting servers view users details logout login
  15. 15. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 15 M.Tech 6.TECHNOLOGY DESCRIPTION register domain register cloud use details domain details create site logout login register site status
  16. 16. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 16 M.Tech 6.1. Software Description:  HTML: Hyper Text Markup Language (HTML) is a language used to create hypertext documents that have hyper links embedded in them. It consists of tags embedded in the text of a document with HTML. We can build web pages or web documents. It is basically a formatting language and not a programming language. The browser reading the document interprets mark up tags to help format the document for subsequent display to a reader. HTML is a language for describing structured documents. HTML is a platform independent. WWW (World Wide Web) pages are written using HTML. HTML tags control in part the representation of the WWW page when view with web browser. The browser interprets HTML tags in the web document and displays it. Different browsers show data differently. Examples of browsers used to be web pages include: 1. Netscape 2. Internet Explorer  JAVA: Java was developed by James Gosling, Patrick Naught on, Chris Wrath, Ed Frank and Mike Sheridan at SUN Micro Systems Incorporation in 199I.It took 18 months to develop the first working version .This language initially called "OAK", but was renamed " JAVA " In 1995.Before the initial implementation of OAK in 1992 and the public announcement of Java in 1995, many more contributed to the design and evolution of the language. The Java programming language is a high-level language that can be characterized by all of the following buzzwords:  Simple  Architecture neutral  Object oriented  Portable  Distributed  High performance  Interpreted  Multithreaded  Robust
  17. 17. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 17 M.Tech  Dynamic  Secure With most programming languages, you either compile or interpret a program so that you can run it on your computer. The Java programming language is unusual in that a program is both compiled and interpreted. With the compiler, first you translate a program into an intermediate language called Java byte codes —the platform-independent codes interpreted by the interpreter on the Java platform. The interpreter parses and runs each Java byte code instruction on the computer. The following figure illustrates how this works. Fig Java Flow You can think of Java byte codes as the machine code instructions for the Java Virtual Machine (Java VM). Every Java interpreter, whether it’s a development tool or a Web browser that can run applets, is an implementation of the Java VM. Java byte codes help make “write once, run anywhere” possible. The byte codes can then be run on any implementation of the Java VM. That means that as long as a computer has a Java VM, the same program written in the Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac.
  18. 18. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 18 M.Tech Fig. Some OS Supporting Java The Java Platform A platform is the hardware or software environment in which a program runs. We’ve already mentioned some of the most popular platforms like Windows 2000, Linux, Solaris, and MacOS. Most platforms can be described as a combination of the operating system and hardware. The Java platform differs from most other platforms in that it’s a software-only platform that runs on top of other hardware-based platforms. The Java platform has two components:  The Java Virtual Machine (JVM)  The Java Application Programming Interface (Java API) You’ve already been introduced to the Java VM. It’s the base for the Java platform and is ported onto various hardware-based platforms. The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages.The following figure depicts a program that’s running on the Java platform. As the figure shows, the Java API and the virtual machine insulate the program from the hardware Fig 4.1.3. Java Platform Native code is code that after you compile it, the compiled code runs on a specific hardware platform. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time byte code compilers can bring performance close to that of native code without threatening portability.
  19. 19. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 19 M.Tech Java is a powerful but lean object oriented programming language. Lt has generated a lot of excitement because it makes it possible to program for internet by creating applets programs that can be embedded in a web page. The context of an apple is limited only by one’s imagination. Java is more than programming language for writing applets. It is being used more and more for writing standalone application as well. 3.2. Database Description:  JAVA Database Connectivity: (JDBC) JDBC is an API developed by Sun Microsystems that provides a standard way to access data using the Java programming language. Using JDBC, an application can access a variety of databases and run on any platform with a Java Virtual Machine. It isn’t necessary to write separate applications to access different database systems, JDBC allows you to write one application that can send SQL statements to different database systems.  How Does JDBC Work? JDBC makes it possible to do the following things within a Java application:  Establish a connection with a data source  Send queries and update statements to the data source  Process the results
  20. 20. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 20 M.Tech Fig 4.2.1. JDBC Architecture Features of JDBC  Retrieval of auto-generated keys  Multiple open result sets JDBC Performance  Retrieving only required data  Selecting functions that optimize performance  Managing connections and updates Establishing a Connection The first thing to do, of course, is to install Java, JDBC and the DBMS on your working machines. Since we want to interface with an MySql database, we would need a driver for this specific database as well. To access a database, a connection must be opened between our program (client) and the database (server). This involves a step: Class.forName("com.mysql.jdbc.Driver");
  21. 21. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 21 M.Tech Creating JDBC Statements A JDBC Statement object is used to send your SQL statements to the DBMS, and should not to be confused with an SQL statement. A JDBC Statement object is associated with an open connection, and not any single SQL Statement. You can think of a JDBC Statement object as a channel sitting on a connection, and passing one or more of your SQL statements to the DBMS. The following code snippet, using our Connection object con, does it for you: Statement stmt = con.createStatement() ; What is JSP? Java Server Pages (JSP) is a technology that lets you mix regular, static HTML with dynamically-generated HTML. Many Web pages that are built by CGI programs are mostly static, with the dynamic part limited to a few small locations. But most CGI variations, including servlets, make you generate the entire page via your program, even though most of it is always the same. JSP lets you create the two parts separately Handling Errors with Exceptions The truth is errors always occur in software programs. Often, database programs are critical applications, and it is imperative that errors be caught and handled gracefully. Programs should recover and leave the database in a consistent state. Rollback-s used in conjunction with Java exception handlers is a clean way of achieving such a requirement. The client (program) accessing a server (database) needs to be aware of any errors returned from the server. JDBC give access to such information by providing two levels of error conditions: SQLException and SQLWarning. SQLExceptions are Java exceptions, which, if not handled, will terminate the application.
  22. 22. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 22 M.Tech SQLWarnings are subclasses of SQLException, but they represent nonfatal errors or unexpected conditions, and as such, can be ig JAVA SERVER PAGES (JSP) A server side technology, Java Server Pages are an extension to the Java servlet technology that was developed by Sun.JSPs have dynamic scripting capability that works in tandem with HTML code, separating the page logic from the static elements – the actual design and display of the page – to help make the HTML more functional (i.e. dynamic database queries). A JSP is translated into Java servlet before being run and it processes HTTP requests and generates responses like any servlet. However, JSP technology provides a more convenient way to code a servlet. Translation occurs the first time the application is run. A JSP translator is triggered by the .jsp file name extension in a URL. JSPs are fully interoperable with servlets. You can include output from a servlet or forward the output to a servlet and a servlet can include output from a JSP or forward output to a JSP. Advantages of JSP  Vs. Active Server Pages (ASP). ASP is a similar technology from Microsoft. The advantages of JSP are twofold. First, the dynamic part is written in Java, not Visual Basic or other MS-specific language, so it is more powerful and easier to use. Second, it is portable to other operating systems and non-Microsoft Web servers.  Vs. Pure Servlets. JSP doesn’t give you anything that you couldn’t in principle do with a servlet. But it is more convenient to write (and to modify!) regular HTML than to have a
  23. 23. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 23 M.Tech zillion println statements that generate the HTML. Plus, by separating the look from the content you can put different people on different tasks: your Web page design experts can build the HTML, leaving places for your servlet programmers to insert the dynamic content.  Vs. JavaScript. JavaScript can generate HTML dynamically on the client. This is a useful capability, but only handles situations where the dynamic information is based on the client’s environment. With the exception of cookies, HTTP and form submission data is not available to JavaScript. And, since it runs on the client, JavaScript can’t access server- side resources like databases, catalogs, pricing information, and the like.  Vs. Static HTML. Regular HTML, of course, cannot contain dynamic information. JSP is so easy and convenient that it is quite feasible to augment HTML pages that only benefit marginally by the insertion of small amounts of dynamic data. Previously, the cost of using dynamic data would preclude its use in all but the most valuable instances. JSP Directives JSP pages use JSP directives to pass instructions to the JSP engine. These may include the following:  JSP page directives communicate page-specific information, such as buffer and thread information or error handling.  Language directives specify the scripting language, along with any extensions.  The include directive (shown in the example above) can be used to include an external document in the page. A good example is a copyright file or company information, file – it is easier to maintain this file in one central location and include it in several pages than to update it in each JSP page. However, the included file can also be another JSP file.  A taglib directive indicates a library of custom tags that the page can invoke.
  24. 24. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 24 M.Tech JSP Tags: Most JSP processing will be implemented through JSP-specific XML-based tags. JSP 1.0 includesa number of standard tags, referred to as the core tags. These include: jsp:useBeanThis tag declares the usage of an instance of a JavaBeans component. If the Bean does not already exist, then the JavaBean component instantiates and registers the tag. Jsp:setProperty This sets the value of a property in a Bean. Jsp:getPropertyThis tag gets the value of a Bean instance property, converts it to a string, and puts It in the implicit object “out”. The advantage of tags is that they are easy to use and share between applications. The real power of a tag-based syntax comes with the development of custom tag libraries, in which tool vendors or others can create and distribute tags for specific purposes. MVC-1 ARCHITECTURE: The main aim of the MVC architecture is to separate the business logic and application data from the presentation data to the user. 1). Model: The model object knows about all the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed to the browser. 2)View: The view represents the presentation of the application. The view object refers to the model. It uses the query methods of the model to obtain the contents and renders it. The view is not dependent on the application logic. It remains same if there is any modification in the business logic. In other words, we can say that it is the responsibility of the of the view’s to maintain the consistency in its presentation when the model changes. 3)Controller: Whenever the user sends a request for something then it always go through the controller. The controller is responsible for intercepting the requests from view and passes it to the model for the appropriate action. After the action has been taken on the data, the controller is responsible for directing the appropriate view to the user. In GUIs, the views and the controllers often work very closely together
  25. 25. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 25 M.Tech Fig 4.2.3: MVC1 Architecture APACHE TOMCAT SERVER: Introduction For administrators and web developers alike, there are some important bits of information you should familiarize yourself with before starting out. This document serves as a brief introduction to some of the concepts and terminology behind the Tomcat container. As well, where to go when you need help. Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations.Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files. Directories and Files Throughout the docs, you’ll notice there are numerous references to $CATALINA_HOME. This represents the root of your Tomcat installation. When we say, “This information can be found in your $CATALINA_HOME/README.txt file” we mean to look at the README.txt file at the root of your Tomcat install
  26. 26. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 26 M.Tech  These are some of the key tomcat directories, all relative to $CATALINA_HOME:  /bin – Startup, shutdown, and other scripts. The *.sh files (for Unix systems) are functional duplicates of the *.bat files (for Windows systems). Since the Win32 (10) command-line lacks certain functionality, there are some additional files in here.  /conf – Configuration files and related DTDs. The most important file in here is server.xml. It is the main configuration file for the container.  /logs – Log files are here by default.  /webapps – This is where your webapps go with their root folder. Components of Tomcat:  Catalina Catalina is Tomcat’s servlet container. Catalina implements Sun Microsystems’ specifications for servlet and Java Server (JSP). In Tomcat, a Realm element represents a “database” of usernames, passwords, and roles (similar to Unix groups) assigned to those users. Different implementations of Realm allow Catalina to be integrated into environments where such authentication information is already being created and maintained, and then use that information to implement Container Managed Security as described in the Servlet Specification.  Coyote Coyote is Tomcat’s HTTP Connector component that supports the HTTP1.1 protocol for the web server or application container. Coyote listens for incoming connections on a specificTCP port on the server and forwards the request to the Tomcat Engine to process the request and send back a response to the requesting client.  Jasper Jasper is Tomcat’s JSP Engine. Tomcat 5.x uses Jasper 2, which is an implementation of the Sun Microsystems’s JavaServer Pages 2.0 specification. Jasper parses JSP files to compile them into Java code as servlets (that can be handled by Catalina). At runtime, Jasper detects changes to JSP files and recompiles them.
  27. 27. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 27 M.Tech  Jasper 2 From Jasper to Jasper 2, important features were added: JSP Tag library pooling – Each tag markup in JSP file is handled by a tag handler class. Tag handler class objects can be pooled and reused in the whole JSP servlet. Background JSP compilation – While recompiling modified JSP Java code, the older version is still available for server requests. The older JSP servlet is deleted once the new JSP servlet has finished being recompiled. Recompile JSP when included page changes – Pages can be inserted and included into a JSP at runtime. The JSP will not only be recompiled with JSP file changes but also with included page changes. JDT Java compiler – Jasper 2 can use the Eclipse JDT (Java Development Tools) Java compiler instead of Ant and javac. Deployment Descriptor: Java web applications use a deployment descriptor file to determine how URLs map to servlets, which URLs require authentication, and other information. This file is named web.xml, and resides in the app’s WAR under the WEB-INF/ directory. Web.xml is part of the servlet standard for web applications. A web application’s deployment descriptor describes the classes, resources and configuration of the application and how the web server uses them to serve web requests. When the web server receives a request for the application, it uses the deployment descriptor to map the URL of the request to the code that ought to handle the request. Here is a simple web.xml example that maps all URL paths (/*) to the servlet class ‘mysite.server.ComingSoonServlet’ : <web-app xmlns=”http://java.sun.com/xml/ns/javaee” version=”2.5”> <servlet> <servlet-name>comingsoon</servlet-name> <servlet-class>mysite.server.ComingSoonServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>comingsoon</servlet-name>
  28. 28. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 28 M.Tech <url-pattern>/*<url-pattern> </servlet-mapping> </web-app> Fig 2.5.5.1: Apache Tomcat Server
  29. 29. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 29 M.Tech Fig 2.5.5.2: Tomcat Application Manager 2.5.6.Database Management System (DBMS) A Database is an integrated collection of user related data stored with minimum redundancy, serves many users/application quickly and efficiency. A Database system is basically a computerized record keeping system, i.e. it is a computerized system whose coverall purpose is to maintain information and make that information available on demand.DBMS is a collection of inter-related data and set of provide users with an abstract view of the data, i.e. the system hides certain details of how the data is stored and maintained. Database Management System is divided into 4 main components. 3. Database: It consists of collection of persistent data that is used by the application system. 2. Hardware: The processor (s) and associated main memory that are used to support the execution of database system software. 3. Software:The layer between the physical database and the users that handle all requests from the user for access to the database.
  30. 30. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 30 M.Tech 4.User: There are three types of users Application Programmers  End User  Database Administrator (DBA) NET BEANS Net Beans a Java-based development environment(IDE) and platform originally developed by sun.It includes user interface functions, source code editor , GUI editor , version control as well as support fordistributed application (COBRA,RMI,etc.,) and web Applications(JSPs,servlets,etc.,). In 1999, sun acquired NetBeans Developer from NetBeans and rebranded it as Forte for java community Edition(sun acquired Forte in 1999).In 2000, sun made the NetBeans IDE open source. 1.GUI: The major requirement of today’s developers is to have a good User Interface for their users.They can provide whatever functionality they need but it’s the GUI that lets the user better know the existence of that particular functionality and its easier for them to click and select than type something on black boring screens.Thus, today’s developers need IDE’s such as NetBeans that develop readymade windows forms with all the required buttons, labels, text boxes and like that can be tailor made for program in question. 2.Database Integration: Database based program developers know how hard it is to interface your back-end database to your front-end program. This is where NetBeans packs the punch by providing you a CRUD(create, read, update, delete) application shell. 5. Coding and Implementation The goal of the coding or programming phase is to translate the design of the system produced during the design phase into code in a given programming language, which can be executed by a computer and that performs the computation specified by the design. The coding phase affects both testing and maintenance. The goal of coding is not to reduce the implementation cost but the goal should be to reduce the cost of later phases. In
  31. 31. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 31 M.Tech other words the goal is not to simplify the job of programmer. Rather the goal should be to simplify the job of the tester and maintainer. Coding Approach There are two major approaches for coding any software system. They are Top- Down approach and Bottom up approach. Bottom-up approach can be best suitable for developing the object oriented systems. During system design phase to reduce the complexity, we decompose the system into an appropriate number of subsystems, for which objects can be modeled independently. These objects exhibit the way the subsystems perform their operations. Once objects have been modeled they are implemented by means of coding. Even though related to the same system as the objects are independent of each other the Bottom up approach is more suitable for coding these objects. In this approach we first do the coding of objects independently and then we integrate these modules into one system to which they belong.
  32. 32. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 32 M.Tech Sample Project Coding
  33. 33. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 33 M.Tech index.jsp <!DOCTYPE html> <html> <head> <title>index page</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="css/style.css"> </head> <body> <div id="root_div"> <div id="Menu"> <%@include file="header.jsp" %> </div> <div id="image_div"> <img src="images/Picture1.png" alt="Project title image" width="1062px" height="150px;" style="border:2px solid #ddd;"> </div> <div id="content_div"> <div> <img src="images/in.png" alt="image here" height="100px;"> </div> <%@include file="InfoHeader.jsp" %> <div id="image_div1"> <img src="images/cloud provider.png" alt="system view" height="auto" width="auto"> </div> <div style="position:absolute;width:200px;height:200px;margin:- 367px 0px 0px 850px;background-color:#ddd;"> <%@include file="slideheader.jsp" %> </div>
  34. 34. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 34 M.Tech </div> </div> </body> </html> header.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>header</title> </head> <body> <ul> <li> <a href="index.jsp">HOME</a></li> <li> <a href="aboutus.jsp">A bout Us</a> </li> <li> <a href="userLogin.jsp">Cloud Users Login</a></li> <li> <a href="serviceProviderLogin.jsp">Service Provider Login</a></li> <li> <a href="contact.jsp">Contact</a></li> <li>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li> </ul> </body> </html>
  35. 35. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 35 M.Tech InfoHeader.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <p id="p_div"> <b style="font-size:20px;">you can create a new website along with hosing hear</b><br> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p> </body> </html> sliderheader.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  36. 36. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 36 M.Tech <title>slider menu</title> </head> <body> <p style="color:skyblue;font-weight:bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Main Menu</p> <ul style="list-style-type:none" > <a href="index.jsp"><li style="color: black">&raquo;Home</li></a> <a href="aboutus.jsp"><li style="color: black">&raquo;aboutus</li></a> <a href="userLogin.jsp"><li style="color: black">&raquo;cloud user login</li></a> <a href="serviceProviderLogin.jsp"><li style="color: black">&raquo;Service provider Login</li></a> <a href="contact.jsp"><li style="color: black">&raquo;contact</li></a> <!--<a href="link.jsp"><li style="color: black">&raquo;Linkes</li></a>--> </ul> </body> </html>
  37. 37. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 37 M.Tech DoRegisterCollect.java package cloud; public class DoRegisterCollect { String name; String email; String password; String gender; String qualification; String phone_number; int memory_allocation; public DoRegisterCollect() { } public DoRegisterCollect(String name, String email, String password, String gender, String qualification, String phone_number) { this.name = name; this.email = email; this.password = password; this.gender = gender; this.qualification = qualification; this.phone_number = phone_number; this.memory_allocation=memory_allocation; } public String getName() { return name; } public void setName(String name) { this.name = name; }
  38. 38. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 38 M.Tech public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public String getQualification() { return qualification; } public void setQualification(String qualification) { this.qualification = qualification;
  39. 39. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 39 M.Tech } public String getPhone_number() { return phone_number; } public void setPhone_number(String phone_number) { this.phone_number = phone_number; } public int getMemory_allocation() { return memory_allocation; } public void setMemory_allocation(int memory_allocation) { this.memory_allocation = memory_allocation; } @Override public String toString() { return "DoRegisterCollect{" + "name=" + name + ", email=" + email + ", password=" + password + ", gender=" + gender + ", qualification=" + qualification + ", phone_number=" + phone_number + ", memory_allocation=" + memory_allocation + '}'; } }
  40. 40. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 40 M.Tech LoginTableBean.java package cloud; public class LoginTableBean { String email; String password; String desig; String status; public LoginTableBean(String email, String password, String desig, String status) { this.email = email; this.password = password; this.desig = desig; this.status = status; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; }
  41. 41. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 41 M.Tech public String getDesig() { return desig; } public void setDesig(String desig) { this.desig = desig; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } } DAO.java package cloud; import java.sql.Connection; import java.sql.DriverManager; import static java.lang.System.*; import java.net.HttpURLConnection; import java.net.InetAddress; import java.net.URL; import java.net.UnknownHostException; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.text.SimpleDateFormat;
  42. 42. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 42 M.Tech import java.util.ArrayList; import java.util.Calendar; public class DAO { public Connection con; public DAO() { try { Class.forName("com.mysql.jdbc.Driver"); // Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("Driver Loaded"); // con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","cloud","clou d"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/cloud","root",""); /* cloud is database name root mysql userid root mysql password */ System.out.println("Connection is Established"); } catch(Exception e) { e.printStackTrace(); } } // regsitaration details
  43. 43. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 43 M.Tech public boolean DoregisterDetails(DoRegisterCollect regiterDetails) { int i=0; boolean flag=false; // ResultSet rs=null; try{ PreparedStatement pstmt=con.prepareStatement("insert into register values(?,?,?,?,?,?,?)"); pstmt.setString(1,regiterDetails.getName()); pstmt.setString(2,regiterDetails.getEmail()); pstmt.setString(3,regiterDetails.getPassword()); pstmt.setString(4,regiterDetails.getGender()); pstmt.setString(5,regiterDetails.getQualification()); pstmt.setString(6,regiterDetails.getPassword()); pstmt.setInt(7,regiterDetails.getMemory_allocation()); i=pstmt.executeUpdate(); if(i>0) { try{ PreparedStatement pstmt1=con.prepareStatement("insert into login values(?,?,?,?,null)"); pstmt1.setString(1,regiterDetails.getEmail()); pstmt1.setString(2,regiterDetails.getPassword()); pstmt1.setString(3,"user"); pstmt1.setString(4,"InActive"); int j=pstmt1.executeUpdate(); if(j>0) { flag=true;
  44. 44. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 44 M.Tech System.out.println("user registered succssfully"); } }catch(Exception e) { e.printStackTrace(); } } }catch(Exception e) {out.println(e); } return flag; } public ArrayList<String> loginVerifi(String email,String password) { ArrayList<String> al=new ArrayList<String>(); ResultSet rs=null; try{ PreparedStatement pstmt=con.prepareStatement("select desig,status from login where email=? and password=?"); String sql="select desig,status from login where email='"+email+"' and password='"+password+"'"; System.out.println(sql); pstmt.setString(1,email); pstmt.setString(2,password); rs=pstmt.executeQuery(); if(rs.next()) { al.add(rs.getString("desig")); al.add(rs.getString("status"));
  45. 45. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 45 M.Tech out.println("**********************************************"); out.println(al.get(0)); out.println(al.get(1)); out.println("**********************************************"); } } catch(Exception e) { System.out.println("ERROR OCUURED WHILE LOGIN DETAILS STORED"+e); e.printStackTrace(); } return al; } public boolean StoreDomainregisterDetails(String customer_name,String domain_name,String sla_plane,String memory,String company_name,String street_address,String city,String country,String phone,String card_no,String card_exp) { int i=0; boolean flag=false; // ResultSet rs=null; try{ PreparedStatement pstmt=con.prepareStatement("insert into domainregister values(null,?,?,?,?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP,?)"); pstmt.setString(1,customer_name); pstmt.setString(2,domain_name); pstmt.setString(3,sla_plane); pstmt.setString(4,memory); pstmt.setString(5,company_name); pstmt.setString(6,street_address);
  46. 46. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 46 M.Tech pstmt.setString(7,city); pstmt.setString(8,country); pstmt.setString(9,phone); pstmt.setString(10,card_no); pstmt.setString(11,card_exp); pstmt.setString(12,"Processing" ); pstmt.setString(13,"Processing" ); i=pstmt.executeUpdate(); if(i>0) { flag=true; } }catch(Exception e) {out.println(e); } return flag; } public boolean StoreUploadedImage(String fullfile,String email,String pm,long image_size) { boolean flag=false; try{ PreparedStatement pstmt=con.prepareStatement("insert into StoreUploadedImage values(?,?,?,?,null)"); pstmt.setString(1,fullfile); pstmt.setString(2,email); pstmt.setString(3,pm); pstmt.setLong(4,allImageSize(email,image_size)); int i=pstmt.executeUpdate();
  47. 47. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 47 M.Tech if(i>0) { flag=true; } } catch(Exception e) { System.out.println("ERROR OCUURED WHILE STOREUPLOADEDIMAGE"+e); e.printStackTrace(); } return flag; } // public long allImageSize(String email,long image_size) { long imagesize=0; /*to store image size that preset at last record in database*/ try{ PreparedStatement pstmt=con.prepareStatement("select image_size from storeuploadedimage where user_mail=?",ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONL Y); pstmt.setString(1, email); ResultSet rs=pstmt.executeQuery(); if(rs.next()) { if(rs.last()) { imagesize=rs.getLong("image_size")+image_size; /*image_size argument contains present uploaded image size*/ out.println(imagesize);
  48. 48. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 48 M.Tech } } else{ imagesize=image_size; } } catch(Exception e) { out.println("ERROR OCCURED WHILE CALCULATING TOTAL USED MEMORY FOR IMAGES"+e); e.printStackTrace(); } return imagesize; } // public long getSize(String email) { long imagesize=0; try{ PreparedStatement pstmt=con.prepareStatement("select image_size from storeuploadedimage where user_mail=?",ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONL Y); pstmt.setString(1,email); ResultSet rs=pstmt.executeQuery(); if(rs.next()) { if(rs.last()) { imagesize=rs.getLong("image_size"); /*image_size argument contains present uploaded image size*/
  49. 49. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 49 M.Tech out.println(imagesize); } } } catch(Exception e) { e.printStackTrace(); } System.out.println("********** get size method return value "+imagesize+"*************"); return imagesize; } public long getServerUsage(String servername) { long imagesize=0; try{ PreparedStatement pstmt=con.prepareStatement("select image_size from storeuploadedimage where Server_name=?",ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_O NLY); pstmt.setString(1,servername); ResultSet rs=pstmt.executeQuery(); if(rs.next()) { if(rs.last()) { imagesize=rs.getLong("image_size"); /*image_size argument contains present uploaded image size*/ // out.println(imagesize);
  50. 50. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 50 M.Tech } } } catch(Exception e) { e.printStackTrace(); } System.out.println("********** get size method return value "+imagesize+"*************"); return imagesize; } // // to Get servers Details and image names // // public long getSeverNamesAndImageNames(String email) // { // long imagesize=0; /*to store image size that preset at last record in database*/ // try{ // PreparedStatement pstmt=con.prepareStatement("select distinct Server_name,filename from storeuploadedimage where user_mail=?",ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONL Y); // pstmt.setString(1, email); // ResultSet rs=pstmt.executeQuery(); // if(rs.next()) // { // // } // else{ //
  51. 51. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 51 M.Tech // } // } // catch(Exception e) // { // out.println("ERROR OCCURED WHILE RETRIVING SERVERNAMES AND IMAGENAMES "+e); // e.printStackTrace(); // } // return imagesize; // } public String getNameByEmail(String email) { String name="null"; try{ PreparedStatement pstmt=con.prepareStatement("select name from register where email=?"); pstmt.setString(1,email); ResultSet rs=pstmt.executeQuery(); if(rs.next()) { name=rs.getString("name"); } } catch(Exception e) { e.printStackTrace(); } System.out.println("name of user get based on login email"+name); return name; }
  52. 52. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 52 M.Tech // // to update user status i.e InActive to Active public ArrayList<LoginTableBean> makeUserActive() { ArrayList<LoginTableBean> outer_al=new ArrayList<LoginTableBean>(); ResultSet rs=null; try { PreparedStatement pstmt=con.prepareStatement("select * from login where status=?"); pstmt.setString(1,"InActive"); rs=pstmt.executeQuery(); ResultSetMetaData rsmd=rs.getMetaData(); int column_count=rsmd.getColumnCount(); while(rs.next()) { LoginTableBean gltd=new LoginTableBean(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)); outer_al.add(gltd); } } catch(Exception e) { System.out.print("Error Occured at MakeUSerActive()"+e.getMessage()); e.printStackTrace(); } return outer_al; } //change domain Status public ResultSet DomainRegisterDetailsView()
  53. 53. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 53 M.Tech { ResultSet rs=null; try { PreparedStatement pstmt=con.prepareStatement("select * from domainregister where status=? or status like 'P%'"); pstmt.setString(1,"Processing"); // pstmt.setString(2,"e%"); rs=pstmt.executeQuery(); } catch(Exception e) { System.out.print("Error Occured at MakeUSerActive()"+e.getMessage()); e.printStackTrace(); } return rs; } public ResultSet getDomainRegisterStatus(String customer_name) { ResultSet rs=null; try { PreparedStatement pstmt=con.prepareStatement("select * from domainregister where customer_name=?"); // pstmt.setString(1,"enable"); pstmt.setString(1,customer_name); rs=pstmt.executeQuery(); } catch(Exception e) {
  54. 54. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 54 M.Tech System.out.print("Error Occured at MakeUSerActive()"+e.getMessage()); e.printStackTrace(); } return rs; } // public boolean changeStatus(String email,String desig,String status) { boolean flag=false; ResultSet rs=null; try{ PreparedStatement pstmt=con.prepareStatement("update login set desig=?,status=? where email=?"); pstmt.setString(1, desig); pstmt.setString(2, status); pstmt.setString(3, email); int i=pstmt.executeUpdate(); if(i>0) { flag=true; } } catch(Exception e) { System.out.println("ERROR IN CHAGE STATUS METHOD "+e.getMessage()); e.printStackTrace(); } return flag; }
  55. 55. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 55 M.Tech // public boolean enableDomainStatus(String status,int id) { boolean flag=false; try{ PreparedStatement pstmt=con.prepareStatement("update domainregister set status=? where id=?"); pstmt.setString(1,status); pstmt.setInt(2,id); int i=pstmt.executeUpdate(); if(i>0) { flag=true; } } catch(Exception e) { System.out.println("ERROR IN CHAGE STATUS METHOD "+e.getMessage()); e.printStackTrace(); } return flag; } // public boolean checkRegister(DoRegisterCollect regiterDetails) { boolean flag=false; ResultSet rs=null; try{ PreparedStatement pstmt=con.prepareStatement("select * from register where email=?");
  56. 56. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 56 M.Tech pstmt.setString(1,regiterDetails.getEmail()); rs=pstmt.executeQuery(); if(rs.next()) { flag=true; } } catch(Exception e) { System.out.println("Error at CHECKREGISTER()"+e.getMessage()); e.printStackTrace(); } System.out.println("before retun flag in checkRegiste()"+flag); return flag; } public ResultSet getDomainNames() { ResultSet rs=null; try{ PreparedStatement pstmt=con.prepareStatement("select domain_name from domainregister where Host_In_Server=?" ); pstmt.setString(1,"Processing"); rs=pstmt.executeQuery(); } catch(Exception e) { System.out.println("Error at getDomainNames()"+e.getMessage()); e.printStackTrace(); } return rs;
  57. 57. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 57 M.Tech } // here i am changing host_in_server field to server names according to domain name ,In domainregister public boolean ChangeHostStatus(String domain_name,String servers_name) { boolean flag=false; try{ PreparedStatement pstmt=con.prepareStatement("update domainregister set host_in_server=? where domain_name=?"); pstmt.setString(1,servers_name); pstmt.setString(2,domain_name); int i=pstmt.executeUpdate(); if(i>0) { flag=true; } } catch(Exception e) { System.out.println("ERROR IN ChangeHostStatus "+e.getMessage()); e.printStackTrace(); } return flag; } // Getting all cloud user Details public ResultSet getCloudUserDetails() { ResultSet rs=null; try{
  58. 58. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 58 M.Tech PreparedStatement pstmt=con.prepareStatement("select * from domainregister"); rs=pstmt.executeQuery(); }catch(Exception e) { System.out.println(e); } return rs; } // Getting Hosted Server Name public String getHostedServerName(String email) { String server="no"; try{ PreparedStatement pstmt =con.prepareStatement("select host_in_server from domainregister where customer_name=?"); pstmt.setString(1,email); ResultSet rs=pstmt.executeQuery(); if(rs.next()) { server=rs.getString(1); } }catch(Exception e) { out.print(e); } return server; }
  59. 59. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 59 M.Tech } 6.Output screens: Home page
  60. 60. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 60 M.Tech Aboutus page
  61. 61. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 61 M.Tech Login page Register page
  62. 62. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 62 M.Tech Cloud service provider login User home page
  63. 63. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 63 M.Tech Domain register viewDomain details
  64. 64. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 64 M.Tech User-Activation Cloud site view
  65. 65. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 65 M.Tech Site host 7. TESTING: 7.1. Testing technologies: Testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding. Testing is the process where that test data is prepared and is used for testing the modules individually and later the validations given for the fields. Then the testing takes place, which make sure that all components of the system properly function as a unit by actually trying to force the system to fail. Testing is best performed when user departments are asked to assist in identifying all possible situations that might arise. Any engineered product can be tested in one of the two ways. Black Box Testing: Knowing the specified function that has been designed to perform, tests can be conducted that demonstrate each function is fully operational, at the same time searching for errors in each function. When computer software is considered, black box testing alludes to tests that are conducted at the software interface. Black Box Testing attempts to find errors in following categories,  In-correct or missing errors  Interface errors
  66. 66. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 66 M.Tech  Errors in data structures or external database access.  Performance errors that Initialization and termination errors. White Box Testing: While box testing of software is predicated on close examination of procedural detail.Providing test cases that exercise specific assets of conditions and/or loops tests logical paths through the software. The “Status of the program” may be examined at various points to determine if the expected are asserted status corresponds to the actual status. White box testing should not however be dismissed as impartial. A limited number of important logical paths can be selected and exercise. Important data structure can be probed for validity. It also called glass- box testing is a test case design method that uses the control structure of the procedural design to derive test cases. Using this method, the software engineer derives test cases. User Interface Testing: The value of the data should fall on the given range of value.The following are some of the testing strategies that are carried out during the testing period: Code Testing: This examines the logic of the program. For example, the logic for calculating profit, rate taking the percentages entered by user was tested and verified with the data that was carried out by manual methods. Specification Testing: Executing the specification starting what the program should do and how it should perform under various conditions. Test cases for various situations and combination of condition in all the modules were tested. Module Testing: To locate errors, focus is given on the modules, independent of other modules. This is known as module testing. This enables us to detect error and correct it without affecting any other modules. Whenever the program was not executing the required function, it was corrected to get
  67. 67. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 67 M.Tech required results. Thus all the modules are tested from bottom to up starting with the smallest and lowest level modules and proceeding to next level. Individual like purchase order rising was done successfully for connection to the next modules. System Testing: Once individual module testing is completed, modules are assembled and integrated to perform as a system. Then the top-down testing begins from upper-level to lower-level module testing was carried out to check whether the entire system is performing satisfactorily. This is the test done for the whole system integration after completion of the module testing. Acceptance Testing: When the user fined no major problems with its accuracy, the system passes through a final acceptance test. This test confirms that the system meets the original goals, objectives and requirements established during analysis. The responsibility for requirements, it is finally acceptable and ready for operation. Unit Testing: Unit testing focuses verification efforts on the smallest unit of software design the module. The unit test is always white box oriented and the step conducted in parallel for multiple modules. Integration Testing: Integration testing is a systematic technique for constructing the program structure while at the same time conducting tests to uncover errors associated with interfacing. The objective is to take unit tested modules and build a program structure that has been dictated by the design. Top-Down Integration: It is an incremental approach to the construction of program structure. Modules are integrated by moving down ward through the control hierarchy, beginning with main control. Modules subordinate to the main control modules are incorporated into the structure in either depth first or breadth first manner.
  68. 68. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 68 M.Tech Bottom-Up Integration: Bottom up integration, as suggests, begins construction and testing atomic modules. Since modules are integrated from bottom up, processing required for modules subordinates to a given level is always available and the need for stubs is eliminated. Validation Testing: At the culmination of integration testing, software is completely assembled as a package, interfacing errors have been uncovered and corrected, and a final series of software testing validation testing may begin. Validation succeeds when the software function in a manner that can be reasonably accepted by a customer. Software validation is achieved through a series of black box tests that demonstrate conformity with requirements. After each validation testing, one of the two possible conditions exit. Acceptance Testing: Acceptance test is conducted to enable the customer to validate all requirements. It can range from an informal test drive to a planned and systematically executed series of tests. Alpha and beta testing at the developer site. The software is used in a natural setting with the developer looking over the shoulder of the user and recording errors and usage problems. These tests are conducted sites by the software in an environment, which cannot be controlled by the developer. Testing is a process, which reveals errors in the program. It is the major quality measure employed during software development. During testing, the program is executed with a set of test cases and the output of the program for the test cases is evaluated to determine if the program is performing as it is expected to perform. In order to make sure that the system does not have errors, the different levels of testing strategies that are applied at differing phases of software development are: System Testing Itinvolves in-house testing of the entire system before delivery to the user. Its aim is to satisfy the user the system meets all requirements of the client's specifications. Acceptance Testing
  69. 69. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 69 M.Tech It is a pre-delivery testing in which entire system is tested at client's site on real world data to find errors Validation Testing: The system has been tested and implemented successfully and thus ensured that all the requirements as listed in the software requirements specification are completely fulfilled. In case of erroneous input corresponding error messages are displayed. Security Testing Attempts to verify the protection mechanisms built into the system. Performance testing This method is designed to test runtime performance of software within the context of an integrated system. UNIT TESTING MODULE TESTING SUB-SYSTEM TESTING SYSTEM TESTING ACCEPTANCE TESTING Component Testing Integration Testing User Testing
  70. 70. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 70 M.Tech 7.2Test cases: Test Units:- In this project we will perform three levels of testing: Unit testing, integrity testing and system testing. The basic units to be tested as follows: Modulus for processing input details. Modulus for generating the routing details. Progress Update module Modulus for generating reports. Features to be tested :- All the functional features specified in the requirements documents will be tested. No testing is done for the performance requirements like response time. Approach for testing :- For unit testing structural testing based on the branch coverage criteria will be used. The goal is to achieve branch coverage of more than 95% . System testing will be largely functional in nature. Test Deliverables :- The following documents are required: Unit Test Report for each unit Test case specification for system testing Test report for system testing Error reports Unit test reports: The above is the testing report for one unit .Individual module is chosen and tested. This module is tested thoroughly for errors and faults found during this phase of testing have been fixed.
  71. 71. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 71 M.Tech Testing process: The testing process that is followed for each object of the system is discussed below in detailed object wise. Object name: Query Form Test Criteria: Query Validity Testing Approach: Black Box Testing Test cases: Cloud service provider Test Case: Testcase1 1. Test case ID Login for admin 2. Precondition  Enter login id  Enter password 3. Description If login and password match, the admin page has to displayed 4. Test Steps 1.Enter login id 2.Enter password 3.Click “login button 5. Expected Output Displays the admin page 6. Actual Output Admin page is displayed 7. Status Pass 8. Remarks
  72. 72. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 72 M.Tech Testcase2 1. Test case ID Login failure for admin 2. Precondition  Enter wrong ID.  Enter wrong password 3. Description If login and password mismatch, a error message is displayed 4. Test Steps 1.Enter login id 2.Enter password 3.Click “login button 5. Expected Output Invalid user message has to be displayed. 6. Actual Output Displays a message saying ”Invalid User id/password” 7. Status Pass 8. Remarks
  73. 73. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 73 M.Tech Testcase3 1. Test case ID Login for user 2. Precondition  enter userid in mail format  Enter password  Click submit button. 3. Description If login id and password mismatch, a error message is displayed 4. Test Steps 4.Enter user id in email format 5.enter password 6. Click submit button. 5. Expected Output Authenticates and navigates to next page. 6. Actual Output Displays users page 7. Status Pass 8. Remarks
  74. 74. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 74 M.Tech Testcase 4 1. Test case ID Login failure for user 2. Precondition  Enter wrong user id in email format  Enter wrong password  Click submit button 3. Description If user id in email format not present in database a error message is displayed 4. Test Steps Enter user id in email format Click submit button 5. Expected Output Invalid user message has to be displayed. 6. Actual Output Displays a message saying ”Invalid User name /password” 7. Status Pass 8. Remarks VALIDATION CHECKS: Client Side Validation: Various client side validations are used to ensure on the client side that only valid data is entered. Client side validation saves server time and load to handle invalid data. Some checks imposed are: JavaScript in used to ensure those required fields are filled with suitable data only. Maximum lengths of the fields of the forms are appropriately defined. Forms cannot be submitted without filling up the mandatory data so that manual mistakes of submitting empty fields that are mandatory can be sorted out at the client side to save the server time and load.
  75. 75. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 75 M.Tech Server Side Validation: Some checks cannot be applied at client side. Server side checks are necessary to save the system from failing and intimating the user that some invalid operation has been performed or the performed operation is restricted. Some of the server side checks imposed is: Server side constraint has been imposed to check for the validity of primary key and foreign key. A primary key value cannot be duplicated. Any attempt to duplicate the primary value results into a message intimating the user about those values through the forms using foreign key can be updated only of the existing foreign key values. User is intimating through appropriate messages about the successful operations or exceptions occurring at server side. Various Access Control Mechanisms have been built so that one user may not agitate upon another. Access permissions to various types of users are controlled according to the organizational structure. Only permitted users can log on to the system and can have access according to their category. User- name, passwords and permissions are controlled on the server side. 1 User Id String Required 2 Password String Authentication 3 E-mail id String Validating e-mail id pattern 4 Question id Number Auto 5 Answer id Number Auto 6 Likes Number Validation against Number of likes
  76. 76. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 76 M.Tech 5.4 IMPLEMENTATION AND MAINTAINANCE: Implementation and maintenance: Implementations is the process of having systems personal checking and put new equipment into use, train areas, installs the new applications and construct any files of data needed to use it. Regardless of implementation strategy used, developers strive to ensure that the system initially use is trouble free. Implementation is an ongoing process. Implementation is the stage is not carefully planned and controlled, it can be chosen. Thus it can be considered to be the most crucial stage in achieving a successfully new system and in the giving the users confidence that the new system will work effectively. The implementation stage involves careful planning and preparation. The following points are to be considered for the implementation of new system.  The implementation of the system environment.  Resource available such as equipment.  Alternatively method of change over. 9.FUTURE SCOPE AND FURTHER ENHANCEMENT: Maintenance is the last phase in the software engineering process. As more programs are developed, a distributing trend has emerged the amount of effort and a resource expended on software maintenance is growing. In total project development maintenance takes 65% of effort. So we will take lead on this and Strive to Produce More better Experience to Users according to the Changing Technology. Benefits: The project is identified by the merits of the system offered to the user. The merits of this project are as follows: -  It’s a web-enabled project.  It is easy to use, since it uses the GUI provided in the user dialog.  User-friendly screens are provided.  The usage of software increases the efficiency, decreases the effort.
  77. 77. Dynamic Resource Allocation Using Virtual Machines Acharya Nagarjuna University 77 M.Tech 8. CONCLUSION We have presented the design and evaluation of a resource management system for cloud computing services. Our system multiplexes virtual to physical resources adaptively based on the changing demand. We use the skewness metric to combine vms with different resource characteristics appropriately so that the capacities of servers are well utilized. our algorithm achieves both overload avoidance and green computing for systems with multi-resource constraints. 10. BIBILIOGRAPHY (i) Allamraju Subhramanyam, ” Professional Java Server Programming” (ii) Herbet Schildt, Patric Naughton “Java Complete Reference “ (iii)James A.senn, “System Analysis and Design” (iv)Pressman RS, “Software Engineering “ (v) R. Fairly, “Software Engineering Concepts” (vi)R.Nageswara Rao, ” Core Java Black Book” (vii) Steven Holster, “HTML Black Book” (viii) .Sheng-Yuan Yang, Chun-Liang Hsu, “An Ontology-Supported Web Focused-Crawler for Java Programs” Sites visited: W3schools Javatpoint Stackoverflow Jenkov tutori

×