0% found this document useful (0 votes)
35 views16 pages

experiments_cloud Computing

Uploaded by

Kartikey Pal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views16 pages

experiments_cloud Computing

Uploaded by

Kartikey Pal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Cloud Computing Lab Manual

RAJIV GANDHI PROUDYOGIKI VISHWAVIDYALAYA, BHOPAL New Scheme


Based On AICTE Flexible Curricula Information Technology, VII- semester IT 704
Cloud Computing Lab

Course Objective:
The objective of this course is to make students understand Cloud computing concepts and
the installation of different cloud simulation tools/ cloud setup tools.

Experiment List Linked with Course Outcomes


Related
S.No Experiment Title
CO
1 Study of cloud computing concepts CO1
2 Using Eucalyptus or Open Nebula or equivalent to set up the cloud CO4
3 Find procedure to run the virtual machine of different configuration CO1
4 Check how many virtual machines can be utilized at a particular time CO1
5 Install a C compiler in the virtual machine and execute a sample program CO1
Show the virtual machine migration based on certain conditions from one
6 CO4
node to another
7 To develop web applications in cloud CO2
To learn the design and development process involved in creating a cloud-
8 CO2
based application
9 To learn to implement and use parallel programming using Hadoop CO5
Install Virtualbox/VMware Workstation with different flavours of Linux or
10 CO1
Windows OS on top of Windows 7 or 8
Install a C compiler in the virtual machine created using VirtualBox and
11 CO1
execute Simple Programs
Install Google App Engine. Create hello world app and other simple web
12 CO2
applications using Python/Java
13 Use GAE launcher to launch the web applications CO2
14 Simulate a cloud scenario using CloudSim CO3
Implementation of various scheduling mechanisms using open source cloud
15 CO3
simulator
Find a procedure to transfer the files from one virtual machine to another
16 CO1
virtual machine
Find a procedure to launch virtual machine using Trystack (Online
17 CO4
OpenStack Demo Version)
Install Hadoop single node cluster and run simple applications like word
count
18 CO5
List :
 Study of Cloud Computing Concepts

 Description: Research and understand the fundamental concepts of cloud computing.


 Tools Needed: Internet access for research.
 Cost: Free

 Find Procedure to Run the Virtual Machine of Different Configuration

 Description: Research and document the steps required to run virtual machines with
different configurations on various cloud platforms.
 Tools Needed: Internet access for research.
 Cost: Free

 To Develop Web Applications in Cloud

 Description: Develop simple web applications using Google Colab or other free-tier
cloud services and deploy them.
 Tools Needed: Google Colab, free-tier cloud service (e.g., Heroku).
 Cost: Free

 Install Google App Engine. Create Hello World App and Other Simple Web
Applications Using Python/Java

 Description: Follow tutorials to set up Google App Engine (GAE) and deploy simple
applications.
 Tools Needed: Google Cloud account with free-tier.
 Cost: Free within free-tier limits.

 Use GAE Launcher to Launch the Web Applications

 Description: Use Google App Engine launcher to deploy and manage web
applications.
 Tools Needed: Google Cloud account with free-tier.
 Cost: Free within free-tier limits.

 Simulate a Cloud Scenario Using CloudSim

 Description: Use CloudSim to model and simulate cloud computing environments.


 Tools Needed: CloudSim toolkit (can be run in Colab with some setup).
 Cost: Free

 Implementation of Various Scheduling Mechanisms Using Open Source Cloud


Simulator

 Description: Research and implement scheduling mechanisms using CloudSim.


 Tools Needed: CloudSim toolkit.
 Cost: Free
 Find a Procedure to Transfer the Files from One Virtual Machine to Another
Virtual Machine

 Description: Research and document the steps for transferring files between virtual
machines on different cloud platforms.
 Tools Needed: Internet access for research.
 Cost: Free

 Find a Procedure to Launch Virtual Machine Using Trystack (Online OpenStack


Demo Version)

 Description: Research and document the procedure to launch a virtual machine using
Trystack.
 Tools Needed: Internet access for research, Trystack account.
 Cost: Free

 To Learn the Design and Development Process Involved in Creating a Cloud-Based


Application

 Description: Study the process of designing and developing a cloud-based


application.
 Tools Needed: Internet access for research, free-tier cloud service (optional for
practical application).
 Cost: Free

Experiment Descriptions

Experiment 1: Study of Cloud Computing Concepts

Objective: To understand the fundamental concepts of cloud computing, including its


architecture, service models, deployment models, and key technologies.

Related CO: CO1

Procedure:

1. Introduction to Cloud Computing:


o Define cloud computing and understand its characteristics such as on-demand self-
service, broad network access, resource pooling, rapid elasticity, and measured
service.

2. Cloud Architecture:
o Study the basic architecture of cloud computing which includes the front-end (client
devices and applications) and back-end (servers, storage, databases, etc.)
components.

3. Service Models:
o Understand the three primary service models:
 Infrastructure as a Service (IaaS): Provides virtualized computing resources
over the internet.
 Platform as a Service (PaaS): Offers hardware and software tools over the
internet.
 Software as a Service (SaaS): Delivers software applications over the
internet.

4. Deployment Models:
o Study the four main deployment models:
 Public Cloud: Services are delivered over a network that is open for public
use.
 Private Cloud: Services are maintained on a private network.
 Hybrid Cloud: Combines public and private clouds.
 Community Cloud: Shared by several organizations with common concerns.

5. Key Technologies:
o Explore technologies that enable cloud computing such as virtualization, service-
oriented architecture (SOA), grid computing, and utility computing.

6. Advantages and Disadvantages:


o Discuss the benefits (e.g., cost savings, scalability, flexibility) and challenges (e.g.,
security, compliance, downtime) of cloud computing.

7. Case Studies:
o Review case studies of organizations that have successfully implemented cloud
computing solutions.

Code/Commands:

 This experiment primarily involves theoretical study and understanding. However, setting up
and using cloud services can be demonstrated using various cloud platforms like AWS, Azure,
and Google Cloud.

Example Setup on AWS:

1. Create AWS Account:


o Sign up for an AWS account at AWS Signup.

2. Explore AWS Management Console:


o Access the AWS Management Console to explore various services offered by AWS.

3. Create an EC2 Instance (IaaS):


o Launch a virtual server (EC2 instance) and configure its settings.

# Example using AWS CLI to create an EC2 instance


aws ec2 run-instances --image-id ami-0abcdef1234567890 --count 1 --
instance-type t2.micro --key-name MyKeyPair --security-group-ids sg-
123abc12 --subnet-id subnet-6e7f829e
Deploy a Simple Web Application on AWS Elastic Beanstalk (PaaS):

 Use AWS Elastic Beanstalk to deploy a simple web application.

# Install Elastic Beanstalk CLI


pip install awsebcli

# Initialize and deploy an application


eb init -p python-3.7 my-app
eb create my-env

Use AWS S3 for Storage (SaaS):

 Store and retrieve files using Amazon S3.

# Example using AWS CLI to create an S3 bucket and upload a file


aws s3 mb s3://my-bucket
aws s3 cp my-file.txt s3://my-bucket/

Conclusion:

This experiment provides a comprehensive understanding of cloud computing concepts,


enabling students to grasp the fundamental principles and practical applications of cloud
technologies. By studying these concepts and exploring cloud services, students will be well-
prepared for more advanced cloud computing tasks.

Experiment 2: Using Eucalyptus or Open Nebula or Equivalent to Set Up the


Cloud

Objective: To set up a cloud environment using Eucalyptus or Open Nebula.

Related CO: CO4

Procedure:

1. Install Required Software:


o Download and install Eucalyptus or Open Nebula on your system.
o Ensure all dependencies are met.
2. Configure the Cloud Environment:
o Set up the management server.
o Configure the nodes to be part of the cloud.
3. Deploy Virtual Machines:
o Create and deploy virtual machines (VMs) on the cloud setup.
4. Verification:
o Verify that the VMs are running and accessible.

Code/Commands:

# Install Open Nebula


sudo apt-get update
sudo apt-get install opennebula opennebula-sunstone

# Start Open Nebula services


sudo systemctl start opennebula
sudo systemctl start opennebula-sunstone

# Access Open Nebula Sunstone web interface


# URL: http://<your-ip>:9869

Experiment 3: Find Procedure to Run the Virtual Machine of Different


Configuration

Objective: To understand and execute the procedure to run VMs with different
configurations.

Related CO: CO1

Procedure:

1. Access Cloud Management Console:


o Log in to the cloud management console (Eucalyptus/Open Nebula).

2. Create Virtual Machines:


o Select the desired configurations (CPU, RAM, Storage).
o Deploy the VM.

3. Verify VM Configuration:
o Ensure the VM runs with the specified configurations.

# Example using Open Nebula


onetemplate create --name "ExampleVM" --cpu 2 --vcpu 2 --memory 4096 --disk
20
onetemplate instantiate "ExampleVM"

Experiment 4: Check How Many Virtual Machines Can Be Utilized at a


Particular Time

Objective: To determine the maximum number of VMs that can be utilized simultaneously.

Related CO: CO1

Procedure:
1. Deploy Multiple VMs:
o Deploy VMs until the resources are fully utilized.

2. Monitor Resource Usage:


o Use the cloud management tools to monitor CPU, RAM, and Storage utilization.

3. Determine Limits:
o Identify the point at which additional VMs cannot be deployed.

# Monitor resource usage in Open Nebula


onehost list
onevm list

# Deploy additional VMs until resources are exhausted


onetemplate instantiate "ExampleVM"

Experiment 5: Install a C Compiler in the Virtual Machine and Execute a


Sample Program

Objective: To install a C compiler in a VM and run a sample C program.

Related CO: CO1

Procedure:

1. Access the VM:


o SSH into the deployed VM.

2. Install C Compiler:
o Install GCC or any other C compiler.

3. Run Sample Program:


o Write and compile a sample C program.
o Execute the program.

# SSH into the VM


ssh user@vm-ip-address

# Install GCC
sudo apt-get update
sudo apt-get install gcc

# Write a sample C program


echo '#include <stdio.h>\nint main() { printf("Hello, World!\\n"); return
0; }' > hello.c

# Compile the C program


gcc hello.c -o hello

# Run the C program


./hello
Experiment 6: Show the Virtual Machine Migration Based on Certain
Condition from One Node to the Other

Objective: To demonstrate VM migration based on specified conditions.

Related CO: CO4

Procedure:

1. Set Up Migration Conditions:


o Define the conditions under which migration should occur (e.g., CPU usage
threshold).

2. Configure Migration:
o Use the cloud management tools to set up migration policies.

3. Trigger and Observe Migration:


o Trigger the condition and observe the migration process.

# Example using Open Nebula


# Set up migration conditions in the Open Nebula configuration files
# Trigger migration
onemigrate <vm-id> <target-host-id>

Experiment 7: To Develop Web Applications in Cloud

Objective: To develop and deploy web applications in a cloud environment.

Related CO: CO2

Procedure:

1. Set Up Development Environment:


o Choose a web development framework (e.g., Django, Flask, Node.js).
o Set up the development environment.

2. Develop Web Application:


o Create a simple web application.

3. Deploy Application to Cloud:


o Deploy the web application to a cloud platform (e.g., AWS, GCP).

# Example using Flask (Python)


# Install Flask
pip install Flask

# Write a simple Flask application


echo 'from flask import Flask\napp = Flask(__name__)\n@app.route("/")\ndef
hello(): return "Hello, Cloud!"\nif __name__ == "__main__": app.run()' >
app.py
# Run the application locally
python app.py

Experiment 8: To Learn the Design and Development Process Involved in


Creating a Cloud-Based Application

Objective: To understand the design and development process of a cloud-based application.

Related CO: CO2

Procedure:

1. Requirement Analysis:
o Identify the requirements for the cloud-based application.

2. Architecture Design:
o Design the architecture of the application.

3. Development and Deployment:


o Develop and deploy the application following the designed architecture.

# Design and development steps can vary based on the application


requirements
# Example using Django (Python)
# Install Django
pip install django

# Create a Django project


django-admin startproject myproject

# Navigate to project directory


cd myproject

# Run the development server


python manage.py runserver

Experiment 9: To Learn to Implement and Use Parallel Programming Using


Hadoop

Objective: To implement and use parallel programming with Hadoop.

Related CO: CO5

Procedure:

1. Set Up Hadoop Cluster:


o Install and configure Hadoop.

2. Write a Hadoop Job:


o Write a simple Hadoop job (e.g., word count).
3. Execute Hadoop Job:
o Run the Hadoop job on the cluster.

# Example Hadoop job (Word Count)


# Create input file
echo 'Hello Hadoop\nHello World' > input.txt

# Copy input file to HDFS


hdfs dfs -put input.txt /input

# Run Hadoop word count job


hadoop jar /usr/lib/hadoop/hadoop-streaming.jar \
-input /input -output /output \
-mapper /bin/cat -reducer /usr/bin/wc

# View output
hdfs dfs -cat /output/part-00000

Experiment 10: Install VirtualBox/VMware Workstation with Different


Flavours of Linux or Windows OS on Top of Windows 7 or 8

Objective: To install VirtualBox/VMware Workstation and create VMs with different OS


flavors.

Related CO: CO1

Procedure:

1. Install VirtualBox/VMware:
o Download and install VirtualBox or VMware Workstation.

2. Create Virtual Machines:


o Create VMs with different OS (e.g., Ubuntu, Fedora, Windows).

3. Verify Installation:
o Ensure the VMs are running correctly.

Code/Commands:

# VirtualBox example
# Create a new VM using VirtualBox GUI or CLI
VBoxManage createvm --name "UbuntuVM" --ostype Ubuntu_64 --register

# Modify VM settings
VBoxManage modifyvm "UbuntuVM" --memory 2048 --cpus 2 --nic1 nat

# Attach installation ISO


VBoxManage storagectl "UbuntuVM" --name "SATA Controller" --add sata --
controller IntelAhci
VBoxManage storageattach "UbuntuVM" --storagectl "SATA Controller" --port 0
--device 0 --type dvddrive --medium /path/to/ubuntu.iso

# Start VM
VBoxManage startvm "UbuntuVM"
Experiment 11: Install a C Compiler in the Virtual Machine Created Using
VirtualBox and Execute Simple Programs

Objective: To install a C compiler in a VM created with VirtualBox and run simple C


programs.

Related CO: CO1

Procedure:

1. Create VM in VirtualBox:
o Follow steps from Experiment 10.

2. Install C Compiler:
o SSH into the VM and install GCC or another C compiler.

3. Run Sample Program:


o Write, compile, and execute a sample C program.

Code/Commands:

# SSH into the VM

ssh user@vm-ip-address

# Install GCC

sudo apt-get update

sudo apt-get install gcc

# Write a sample C program

echo '#include <stdio.h>\nint main() { printf("Hello, World!\\n"); return


0; }' > hello.c

# Compile the C program

gcc hello.c -o hello

# Run the C program

./hello

Experiment 12: Install Google App Engine. Create Hello World App and
Other Simple Web Applications Using Python/Java
Objective: To install Google App Engine (GAE) and create simple web applications.

Related CO: CO2

Procedure:

1. Install GAE SDK:


o Download and install the GAE SDK.

2. Create Hello World Application:


o Write a simple Hello World application in Python/Java.

3. Deploy Application:
o Deploy the application to GAE.

# Example using Python

# Install Google Cloud SDK

curl https://sdk.cloud.google.com | bash

# Initialize Google Cloud SDK

gcloud init

# Create a simple Flask app for GAE

mkdir hello_world

cd hello_world

echo 'from flask import Flask\napp = Flask(__name__)\n@app.route("/")\ndef hello(): return "Hello,


World!"\nif __name__ == "__main__": app.run()' > main.py

# Create app.yaml file

echo 'runtime: python38\nentrypoint: python main.py' > app.yaml

# Deploy the application

gcloud app deploy

Experiment 13: Use GAE Launcher to Launch the Web Applications


Objective: To use GAE Launcher for deploying web applications.

Related CO: CO2

Procedure:

1. Set Up GAE Launcher:


o Install and configure GAE Launcher.

2. Deploy Web Application:


o Use GAE Launcher to deploy the application.

# Follow the steps to create and deploy using GAE Launcher GUI

# Deploy command example

gcloud app deploy

Experiment 14: Simulate a Cloud Scenario Using CloudSim

Objective: To simulate a cloud scenario using CloudSim.

Related CO: CO3

Procedure:

1. Install CloudSim:
o Download and set up CloudSim.

2. Create Simulation:
o Write a CloudSim simulation scenario.

3. Run Simulation:
o Execute the simulation and analyze results.

// Example Java code for CloudSim

import org.cloudbus.cloudsim.core.CloudSim;

public class CloudSimExample {

public static void main(String[] args) {

// Initialize CloudSim

int numUser = 1;

Calendar calendar = Calendar.getInstance();

boolean traceFlag = false;


CloudSim.init(numUser, calendar, traceFlag);

// Create data centers, brokers, and VMs here

// Start simulation

CloudSim.startSimulation();

// Stop simulation

CloudSim.stopSimulation();

Experiment 15: Implementation of Various Scheduling Mechanisms Using


Open Source Cloud Simulator

Objective: To implement and analyze different scheduling mechanisms.

Related CO: CO3

Procedure:

1. Select Scheduler:
o Choose a scheduling mechanism to implement.

2. Modify CloudSim:
o Modify CloudSim code to implement the chosen scheduler.

3. Run Simulation:
o Execute the simulation and compare results.

// Example Java code for custom scheduler in CloudSim

public class CustomScheduler extends DatacenterBroker {

// Implement custom scheduling logic here

Experiment 16: Find a Procedure to Transfer Files from One Virtual Machine
to Another Virtual Machine
Objective: To transfer files between VMs.

Related CO: CO1

Procedure:

1. Set Up VMs:
o Ensure both VMs are running and accessible.

2. Transfer Files:
o Use SCP or any other file transfer method.

# Example using SCP

scp /path/to/local/file user@vm2-ip-address:/path/to/remote/directory

Experiment 17: Find a Procedure to Launch Virtual Machine Using Trystack


(Online OpenStack Demo Version)

Objective: To launch VMs using Trystack.

Related CO: CO4

Procedure:

1. Access Trystack:
o Sign up and log in to Trystack.

2. Launch VM:
o Follow the Trystack interface to launch a VM.

3. Verify VM:
o Ensure the VM is running.

# Follow Trystack web interface steps to launch and manage VMs

Experiment 18: Install Hadoop Single Node Cluster and Run Simple
Applications Like Word Count

Objective: To set up a Hadoop single-node cluster and run a Word Count application.

Related CO: CO5

Procedure:
1. Install Hadoop:
o Download and install Hadoop.

2. Configure Hadoop:
o Configure the Hadoop environment for single-node operation.

3. Run Word Count:


o Execute the Word Count application on the cluster.

# Example setup for Hadoop single-node cluster

# Download and extract Hadoop

wget https://downloads.apache.org/hadoop/common/hadoop-3.3.1/hadoop-3.3.1.tar.gz

tar -xzvf hadoop-3.3.1.tar.gz

mv hadoop-3.3.1 /usr/local/hadoop

# Configure Hadoop environment variables in ~/.bashrc

echo 'export HADOOP_HOME=/usr/local/hadoop' >> ~/.bashrc

echo 'export PATH=$PATH:$HADOOP_HOME/bin' >> ~/.bashrc

source ~/.bashrc

# Configure Hadoop files (core-site.xml, hdfs-site.xml, mapred-site.xml, yarn-site.xml)

# Start Hadoop

start-dfs.sh

start-yarn.sh

# Run Word Count example

hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.3.1.jar


wordcount /input /output

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy