Experiment - 1
Aim: Install hypervisor with Linux or windows OS on top of host OS and bare-metal system.
Theory: Hypervisors are software programs that enable the use of Virtual Machines (VM) on a variety of
hardware platforms, allowing multiple operating systems to run on a single physical machine. There are
two varieties of hypervisors:
1. Type 1 (Native/Bare-metal): These run directly on the hardware (e.g., VMware ESXi, Microsoft
Hyper-V, Citrix XenServer). They are typically used in data centers for high performance.
2. Type 2 (Hosted): These run on top of an existing host operating system (e.g., Oracle VM
VirtualBox, VMware Workstation). They are commonly used for desktop development
environments.
Procedure:
1. Download Hypervisor: Download the installer for a Type 2 hypervisor like Oracle VM
VirtualBox or VMware Workstation from their official website .
2. Install Hypervisor: Run the installer (.exe for Windows), follow the setup wizard instructions
(accept license, choose location), and finish the installation .
3. Create VM: Launch the hypervisor, click "New", and configure the VM Name, Type
(Linux/Windows), RAM size, and Virtual Hard Disk size .
4. Mount ISO: In the VM settings, navigate to "Storage", select the empty optical drive, and
browse/attach the downloaded ISO image of the Guest OS (e.g., Ubuntu) .
5. Install Guest OS: Start the VM. It will boot from the ISO. Follow the on-screen prompts (e.g.,
"Install Ubuntu", setup username/password) to complete the OS installation .
Output: 1. The VirtualBox Dashboard,
Result:
The hypervisor was successfully installed, and a virtual machine running a Guest OS was created and
executed.
Conclusion:
In this experiment, we learned about virtualization concepts and successfully demonstrated the installation
of a Type 2 hypervisor (VirtualBox) to host a guest operating system on top of a host OS.
Experiment - 2
Aim: Set up CloudSim environment, create and run Virtual Machine (VM).
Theory: CloudSim is an open-source framework developed by the CLOUDS Lab organization, written in
Java . It is used for modeling and simulating cloud computing infrastructures and services, allowing
researchers to evaluate hypotheses without the need for physical hardware. It supports modeling of data
centers, service brokers, and scheduling policies.
Code: (Basic commands used for setup)
Bash
# Path Variable Setup
Procedure:
1. Prerequisites: Download and install the Java Development Kit (JDK) and unpack the CloudSim
toolkit (e.g., CloudSim 3.0.3) .
2. Environment Variables: Configure the system Path to include the JDK bin directory and create a
CLASSPATH variable pointing to the CloudSim jars and examples folders .
3. Compile Example: Open a command prompt and compile a sample simulation file using javac.
○ Command: javac Path\to\[Link] .
4. Run Simulation: Execute the compiled class using the java command.
○ Command: java [Link].CloudSimExample1 .
5. Analyze Output: Observe the console log showing the creation of Datacenters, Brokers, and the
successful execution of Cloudlets .
Output:
Result: The CloudSim environment was successfully set up, and a basic simulation creating a Data
Center and running a VM was executed.
Conclusion: We successfully configured the CloudSim framework and verified the installation by
running a sample simulation, demonstrating the creation of cloud entities like Datacenters and Brokers.
Experiment - 3
Aim: Create Data Centers, and allocate VMs on Data Centers.
Theory: A virtual data center in cloud simulation acts as a container for all inventory objects (storage,
networking, computing) required to operate virtual machines. It represents the hardware infrastructure
provided by the Cloud Service Provider. In environments like vSphere or CloudSim, we create data
centers to organize resources and allocate VMs to specific hosts based on availability and policy .
Procedure:
1. Initialize Datacenter: Access the management console (e.g., vSphere Client or CloudSim code).
Right-click the server object and select "New Datacenter" or initialize the Datacenter object in
code .
2. Create Folders (Optional): Create folders within the datacenter to group objects (like specific
clusters or storage types) for easier management and permission application .
3. Add Hosts: Right-click the datacenter or folder and select "Add Host". Enter the IP
address/Hostname and administrator credentials for the physical host .
4. Configure Host: Follow the wizard to assign licenses4 configure lockdown modes, and select
VM locations. Review the summary and finish adding the host .
5. Allocating VMs: Once the host is added to the Datacenter, new Virtual Machines can be created
and assigned to run on the specific resources (Hosts) within that Datacenter.
Output: (Paste screenshots of the Datacenter creation wizard, the list of added hosts, and the VM
allocation screen).
Result: A Data Center was created, hosts were added, and resources were successfully prepared for VM
allocation.
Conclusion: This experiment demonstrated the hierarchical structure of cloud infrastructure, showing
how Data Centers are created to aggregate physical resources (hosts) for the provisioning of Virtual
Machines.
Experiment - 4
Aim: Install Google App Engine (GAE). Create web applications using python/java.
Theory: Google App Engine (GAE) is a Platform as a Service (PaaS) offering that lets developers build
and run applications on Google's infrastructure. It supports standard environments (specific versions of
Java, Python, etc.) and flexible environments (Docker containers). Applications use the [Link] or
[Link] file for configuration.
Code: [Link]:
1. [Link]
(Configuration file)
YAML
runtime: python27
threadsafe: true
handlers:
- url: /
script: [Link]
2. [Link]
(The logic to fetch Post Office data)
Python
import os
import json
import urllib
import webapp2
from [Link] import template
class MainPage([Link]):
def get(self):
template_values = {}
path = [Link]([Link](__file__), '[Link]')
[Link]([Link](path, template_values))
def post(self):
pincode = [Link]('zipCode')
# Validate pin code length and numeric status
if not [Link]() or len(pincode) != 6:
template_values = {
"error": "Incorrect Pin Code (String / False Code entered)"
}
path = [Link]([Link](__file__), '[Link]')
return [Link]([Link](path, template_values))
# Fetch data from API
url = "[Link] + pincode
try:
data = [Link](url).read()
data = [Link](data)
if data[0]['Status'] == 'Success':
post_office = data[0]['PostOffice'][0]['State']
name = data[0]['PostOffice'][0]['Name']
block = data[0]['PostOffice'][0]['Block']
district = data[0]['PostOffice'][0]['District']
template_values = {
"post_office": post_office,
"name": name,
"block": block,
"district": district
}
path = [Link]([Link](__file__), '[Link]')
[Link]([Link](path, template_values))
else:
template_values = {}
path = [Link]([Link](__file__), '[Link]')
[Link]([Link](path, template_values))
except:
template_values = {}
path = [Link]([Link](__file__), '[Link]')
[Link]([Link](path, template_values))
app = [Link]([('/', MainPage)], debug=True)
3. [Link]
(The Input Form)
HTML
<!DOCTYPE html>
<html>
<head>
<title>Post Office Finder</title>
<style>
.weatherText {
font-family: 'Lato', 'sans-serif';
font-size: 24px;
text-align: center;
}
#weatherForm {
padding: 20px;
}
#weatherSubmit {
color: white;
background-color: #083375;
padding: 5px 20px;
border-radius: 5px;
margin-top: 20px;
cursor: pointer;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.card {
border: 2px solid black;
width: 50%;
justify-content: center;
align-items: center;
text-align: center;
padding-bottom: 20px;
}
</style>
</head>
<body>
<div class="card">
<h2 class="weatherText">Post Office Finder Using WebApp</h2>
{% if error %}
<h1 style="color: red;">{{ error }}</h1>
<script>alert('Please Enter the Valid Pin Code!');</script>
{% endif %}
<form class="weatherText" id="weatherForm" action="/" method="post">
Location Zip Code:<br/>
<input class="weatherText" id="weatherInput" type="text" name="zipCode"/><br />
<input class="weatherText" id="weatherSubmit" type="submit" value="Submit"/>
<button type="button" id="weatherSubmit" class="weatherText"
onclick="[Link]('weatherInput').value = ''">Clear</button>
</form>
</div>
</body>
</html>
4. [Link]
(The Green Success Box)
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Post Office Information</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
#weatherResults {
background-color: #83e9c2;
font-family: 'Lato', sans-serif;
font-size: 24px;
padding: 30px;
display: inline-block;
text-align: center;
margin: 20px;
border: 2px solid black;
border-radius: 5px;
}
h3 { margin: 10px; }
</style>
</head>
<body>
<div id="weatherResults">
<table>
<tr>
<td><h3>State of Post Office :</h3></td>
<td><h3>{{ post_office }}</h3></td>
</tr>
<tr>
<td><h3>Name of Post Office :</h3></td>
<td><h3>{{ name }}</h3></td>
</tr>
<tr>
<td><h3>Block of Post Office:</h3></td>
<td><h3>{{ block }}</h3></td>
</tr>
<tr>
<td><h3>District of Post Office:</h3></td>
<td><h3>{{ district }}</h3></td>
</tr>
</table>
<a href="/"><h4>Back to the Home page</h4></a>
</div>
</body>
</html>
5. [Link]
(The Error Page)
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Error page</title>
<style>
body { text-align: center; padding-top: 50px; font-family: sans-serif; }
</style>
</head>
<body>
<div style="text-align: center">
<h2>No such pin exists or API Error</h2>
<a href="/"><h3>Back to the Home page</h3></a>
</div>
</body>
</html>
Procedure:
1. Install SDK: Download and install the Google Cloud SDK. Initialize it using gcloud init and
install specific components (e.g., app-engine-java) .
2. IDE Setup: In Eclipse, install "Google Cloud Tools". Create a new "Google App Engine
Standard Java Project" .
3. Develop App: Write the application logic (e.g., a Servlet in Java or a script in Python) and
configure the deployment descriptors ([Link] or [Link]) .
4. Run Locally: Use the local development server to test the application.
○ Command: dev_appserver.py "path_to_app" or "Run As > App Engine" in Eclipse.
5. Verify: Open a web browser and navigate to [Link] to see the running application.
Output:
Result: A Google App Engine environment was established, and web applications in Java and Python
were successfully created and deployed locally.
Conclusion: We learned how to set up the Google App Engine SDK and develop scalable web
applications using PaaS tools, handling configuration and local testing.
Experiment - 5
Aim: Assigning cloudlets and analyzing the scheduling parameters for various scenarios.
Theory: CloudSim allows the simulation of workload scheduling. A Cloudlet represents a task or
application service to be executed. The Broker acts on behalf of the user to submit VMs and Cloudlets to
the Datacenter. Scheduling policies (like TimeShared or SpaceShared) determine how resources are
allocated to these Cloudlets. In this experiment, we implement a Shortest Job First (SJF) scheduler logic.
Code: (Snippet from SJF_Scheduler.java)
Java
// Create VMs
Vm[] vm = new Vm[vms];
for (int i=0; i < vms; i++) {
vm[i] = new Vm(datacenter[i].getId(), userId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerSpaceShared());
[Link](vm[i]);
}
// Create Cloudlets
for (int i = 0; i < cloudlets; i++) {
// Calculation of length based on matrix
cloudlet[i] = new Cloudlet(idShift + i, length, pesNumber, fileSize, outputSize, utilizationModel,
utilizationModel, utilizationModel);
[Link](cloudlet[i]);
}
Procedure:
1. Initialize Simulation: Initialize the CloudSim package using [Link]().
2. Create Resources: Create Datacenters with defined characteristics (architecture, OS, cost) and a
Datacenter Broker .
3. Define Entities: Create a list of Virtual Machines (VMs) and a list of Cloudlets (tasks) with
specific lengths and file sizes .
4. Submit & Schedule: Submit the VM and Cloudlet lists to the broker. The broker (implementing
SJF logic) sorts tasks based on length and assigns them to VMs .
5. Run & Analyze: Start the simulation using [Link](). Stop it after execution
and print the results (Start Time, Finish Time, Makespan).
PROGRAM:
package [Link];
import [Link].*;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class SJF_Scheduler {
private static List<Cloudlet> cloudletList;
private static List<Vm> vmList;
private static Datacenter[] datacenter;
private static double[][] commMatrix;
private static double[][] execMatrix;
private static List<Vm> createVM(int userId, int vms) {
// Creates a container to store VMs. This list is passed to the broker later
LinkedList<Vm> list = new LinkedList<Vm>();
// VM Parameters
long size = 10000; // image size (MB)
int ram = 512; // vm memory (MB)
int mips = 250;
long bw = 1000;
int pesNumber = 1; // number of cpus
String vmm = "Xen"; // VMM name
// create VMs
Vm[] vm = new Vm[vms];
for (int i = 0; i < vms; i++) {
vm[i] = new Vm(datacenter[i].getId(), userId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerSpaceShared());
[Link](vm[i]);
return list;
private static List<Cloudlet> createCloudlet(int userId, int cloudlets, int idShift) {
// Creates a container to store Cloudlets
LinkedList<Cloudlet> list = new LinkedList<Cloudlet>();
// cloudlet parameters
long fileSize = 300;
long outputSize = 300;
int pesNumber = 1;
UtilizationModel utilizationModel = new UtilizationModelFull();
Cloudlet[] cloudlet = new Cloudlet[cloudlets];
for (int i = 0; i < cloudlets; i++) {
int dcId = (int) ([Link]() * Constants.NO_OF_DATA_CENTERS);
long length = (long) (1e3 * (commMatrix[i][dcId] + execMatrix[i][dcId]));
cloudlet[i] = new Cloudlet(idShift + i, length, pesNumber, fileSize, outputSize, utilizationModel,
utilizationModel, utilizationModel);
// setting the owner of these Cloudlets
cloudlet[i].setUserId(userId);
cloudlet[i].setVmId(dcId + 2);
[Link](cloudlet[i]);
return list;
public static void main(String[] args) {
[Link]("Starting SJF Scheduler...");
// NOTE: GenerateMatrices class is required here as per manual
new GenerateMatrices();
execMatrix = [Link]();
commMatrix = [Link]();
try {
int num_user = 1; // number of grid users
Calendar calendar = [Link]();
boolean trace_flag = false; // mean trace events
[Link](num_user, calendar, trace_flag);
// Second step: Create Datacenters
datacenter = new Datacenter[Constants.NO_OF_DATA_CENTERS];
for (int i = 0; i < Constants.NO_OF_DATA_CENTERS; i++) {
datacenter[i] = [Link]("Datacenter_" + i);
}
// Third step: Create Broker
SJFDatacenterBroker broker = createBroker("Broker_0");
int brokerId = [Link]();
// Fourth step: Create VMs and Cloudlets and send them to broker
vmList = createVM(brokerId, Constants.NO_OF_DATA_CENTERS);
cloudletList = createCloudlet(brokerId, Constants.NO_OF_TASKS, 0);
[Link](vmList);
[Link](cloudletList);
// Fifth step: Starts the simulation
[Link]();
// Final step: Print results when simulation is over
List<Cloudlet> newList = [Link]();
[Link]();
printCloudletList(newList);
[Link](SJF_Scheduler.[Link]() + " finished!");
} catch (Exception e) {
[Link]();
[Link]("The simulation has been terminated due to an unexpected error");
}
private static SJFDatacenterBroker createBroker(String name) throws Exception {
return new SJFDatacenterBroker(name);
private static void printCloudletList(List<Cloudlet> list) {
int size = [Link]();
Cloudlet cloudlet;
String indent = " ";
[Link]();
[Link]("OUTPUT");
[Link]("Cloudlet ID" + indent + "STATUS" + indent + "Data center ID" + indent + "VM ID"
+ indent + "Time" + indent + "Start Time" + indent + "Finish Time");
DecimalFormat dft = new DecimalFormat("###.##");
[Link](2);
for (int i = 0; i < size; i++) {
cloudlet = [Link](i);
[Link](indent + [Link]([Link]()) + indent + indent);
if ([Link]() == [Link]) {
[Link]("SUCCESS");
[Link](indent + indent + [Link]([Link]()) + indent + indent + indent
+ [Link]([Link]()) + indent + indent + [Link]([Link]()) + indent +
indent + [Link]([Link]()) + indent + indent + indent +
[Link]([Link]()));
}
}
double makespan = calcMakespan(list);
[Link]("Makespan using SJF: " + makespan);
private static double calcMakespan(List<Cloudlet> list) {
double makespan = 0;
double[] dcWorkingTime = new double[Constants.NO_OF_DATA_CENTERS];
for (int i = 0; i < Constants.NO_OF_TASKS; i++) {
int dcId = [Link](i).getVmId() % Constants.NO_OF_DATA_CENTERS;
if (dcWorkingime[dcId] != 0) --dcWorkingTime[dcId];
dcWorkingTime[dcId] += execMatrix[i][dcId] + commMatrix[i][dcId];
makespan = [Link](makespan, dcWorkingTime[dcId]);
return makespan;
}
Output:
Result: Cloudlets were assigned to VMs, and the scheduling parameters (SJF) were analyzed, resulting in
a specific makespan for the workload.
Conclusion: This experiment demonstrated how to implement and analyze custom scheduling algorithms
(like SJF) within CloudSim to optimize task execution in a cloud environment.
Experiment - 6
Aim: Implement a procedure to transfer the files from one virtual machine to another virtual machine.
Theory: File transfer between a Host and Guest OS or between VMs is crucial for data sharing.
VirtualBox provides a "Shared Folders" feature. There are two types:
1. Machine Folders: Permanent shares that persist after VM restart.
2. Transient Folders: Temporary shares that disappear after shutdown . Guest Additions must be
installed to enable this feature.
Procedure:
1. Install Guest Additions: In the running VM window, go to Devices > "Insert Guest Additions
CD image" and install the software inside the Guest OS .
2. Open Settings: Go to Machine > Settings > Shared Folders in VirtualBox .
3. Add Share: Click the "Add" button. Select the "Folder Path" (on Host PC) and provide a "Folder
Name" (for Guest).
4. Configure Options: Check "Auto-mount" (to mount automatically at boot) and "Make
Permanent" .
5. Access File: Reboot the VM. The shared folder will appear in the Guest OS (usually under
/media/sf_FolderName or as a network drive), allowing file transfer .
Output: (Paste screenshots of the Shared Folders settings window in VirtualBox and the File Explorer in
the Guest OS showing the shared files).
Result: A shared folder was successfully configured, enabling file transfer between the host system and
the virtual machine.
Conclusion: We successfully implemented file sharing mechanisms in a virtualized environment,
facilitating easy data exchange between the host and guest operating systems.
Experiment - 7
Aim: Install Hadoop node cluster and run basic applications.
Theory: Hadoop is an open-source framework for distributed storage and processing of big data. It
consists of HDFS (Hadoop Distributed File System) for storage and YARN for resource management.
Configuration involves editing XML files ([Link], [Link], [Link], [Link]) to
define the namenode, datanode, and replication factors .
Code: (Configuration Sample - [Link])
XML
<configuration>
<property>
<name>[Link]</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
Procedure:
1. Setup Environment: Install Java and extract Hadoop. Set HADOOP_HOME and JAVA_HOME
environment variables .
2. Configure Hadoop: Edit the configuration XML files ([Link], [Link],
[Link], [Link]) to set paths for namenode/datanode folders and YARN settings .
3. Format Namenode: Open a command prompt and initialize the HDFS file system using the
command: hdfs namenode -format.
4. Start Services: Navigate to the sbin directory and run [Link] to start the Namenode,
Datanode, and YARN Resource Manager.
5. Run Application: Create an input directory in HDFS, upload a text file, and run the MapReduce
WordCount jar.
○ Command: hadoop jar [Link] wordcount /input_dir /output_dir .
Output:
Result: A Hadoop Single Node Cluster was installed, configured, and tested successfully by running a
WordCount MapReduce job.
Conclusion: We verified the installation of a Big Data processing environment using Hadoop and YARN,
demonstrating the ability to process data using the MapReduce programming model.
Experiment - 8
Aim: Run various Cloud-based web services and evaluate their performances.
Theory: This experiment involves deploying applications using three different cloud computing models
to understand their deployment workflows and performance characteristics:
1. Static Hosting (Storage-as-a-Service): Using AWS S3 to host static HTML/CSS/JS files
without a web server.
2. Dynamic Web App (Platform-as-a-Service): Using Heroku to deploy a dynamic application
(e.g., [Link] or Python) where the platform manages the underlying infrastructure.
3. Serverless API (Function-as-a-Service): Using AWS Lambda to deploy code that runs in response
to events (HTTP requests via API Gateway) without provisioning servers.
Performance is evaluated using metrics like Latency (Response Time), Throughput (Requests per
second), and Uptime.
Procedure:
Step 1: Deploy Static Website on AWS S3
1. Log in to the AWS Console and navigate to the S3 service.
2. Create Bucket: Create a new S3 bucket (ensure the name is globally unique) and uncheck "Block
all public access" to allow public read access.
3. Upload Files: Upload your static [Link], [Link], and [Link] files to the bucket.
4. Enable Hosting: Go to the "Properties" tab, scroll to "Static website hosting," click "Edit," and
select "Enable". Specify [Link] as the index document.
5. Endpoint: Note the generated Endpoint URL (e.g.,
[Link]
Step 2: Deploy Dynamic Web App on Heroku
1. Create App: Create a simple dynamic application (e.g., using [Link] or Flask).
2. Configuration: Create necessary files like Procfile (tells Heroku how to run the app) and
[Link] (for Python) or [Link] (for Node).
Deploy: Push the code to GitHub or use the Heroku CLI commands:
heroku login
heroku create myapp-unique-name
git push heroku main
3. Access: Open the app via the provided Heroku domain (e.g.,
[Link]
Step 3: Deploy Serverless REST API on AWS Lambda
1. Create Function: Go to AWS Lambda console and click "Create function".
2. Runtime: Select "Author from scratch" and choose a runtime (e.g., Python 3.9 or [Link]).
3. Code: Define a sample handler function that returns a JSON response.
○ Python Code:
def lambda_handler(event, context):
return {
'statusCode': 200,
'body': 'Hello from Lambda'
4. Trigger: Click "Add trigger", select API Gateway, create a new HTTP API, and click "Add".
5. Deploy: Note the API Endpoint URL provided by API Gateway.
Step 4: Evaluate Performance
Use the following commands in a terminal to measure performance metrics for the URLs obtained in
Steps 1, 2, and 3.
Latency (Response Time):
curl -o /dev/null -s -w "%{time_total}\n" [Link]
1. Throughput (Requests per Second):
(Using Apache Benchmark ab)
Bash
ab -n 500 -c 50 [Link]
2. Uptime: Monitor the services using a free tool like UptimeRobot for 24 hours (optional).
Step 5: Compare and Analyze
Record the observed values in the table below.
Output:
● Public static website URL: [Link]
● Heroku App URL: [Link]
● AWS Lambda API URL: [Link]
Comparison Table: