Cloud Record
Cloud Record
Cloud Record
----------------------------------------------------------------------------------------------------------
REGISTER NO:
-----------------------------------------------------------------------------------------------------------
External Examiner: _
REG.NO:
Vision of Institution
Mission of Institution
M3 To equip students with values, ethics and life skills needed to enrich their
lives and enable them to meaningfully contribute to the progress of society
M4 To prepare students for higher studies and lifelong learning, enrich them
with the practical and entrepreneurial skills necessary to excel as future
professionals and contribute to Nation’s economy
Vision of Department
Mission of Department
OBJECTIVES:
Course Objective:
• To learn the design and development process involved in creating a cloud based application
Exercises:
1. Install Virtualbox/VMware Workstation with different flavours of linux or
windows OS on top of windows7 or 8.
2. Install a C compiler in the virtual machine created using virtual box and execute
Simple Programs
3. Install Google App Engine. Create hello world app and other simple web applications using
python/java.
4. Use GAE launcher to launch the web applications.
5. Simulate a cloud scenario using CloudSim and run a scheduling algorithm that is not
present in CloudSim.
6. Find a procedure to transfer the files from one virtual machine to another virtual
machine.
7. Find a procedure to launch virtual machine using trystack (Online Openstack
Demo Version)
8. Install Hadoop single node cluster and run simple applications like wordcount.
Course Outcome:
• Install and use a generic cloud environment that can be used as a private cloud.
TOTAL: 45 PERIODS
INDEX PAGE
MARKS
COUR SE PA
SIGN
COMPLE ASSESSMENT PARTI
S.NO DATE CYCLE TITLE GE
(5+5+5)
TION(20) CIP NO
ATION (5) .
1 Install Virtualbox/VMware
Workstation with different
OS on top
of windows7 or 8.
2
Install a C compiler in the
virtual machine created using
1 Programs
3
Install Google App Engine.
Create hello world app and
present in
CloudSim
6 Find a procedure to transfer the
files from one virtual machine
2
to another virtual machine
Version)
AIM:
To install the VMware Workstation and to create and run virtual machine with
different flavours of Linux on top of Windows 10.
PROCEDURE:
InstallVirtualBox
1. Visit http://www.virtualbox.org/wiki/downloads
2. DownloadVirtualBox platform packages for your OS
3. Open the Installation Package by double clicking
4. Click continue and finish installingVirtualBox
P
C
OUTPUT:
RESULT:
Thus, the Ubuntu Virtual Machine has been successfully created using
VIRTUALBOX.
AIM:
PROGRAM:
PROCEDURE:
STEP 1: OPEN VIRTUAL MACHINE
⚫ Right click and select Open Terminal .The terminal windows opens.
⚫ Type the following command to install the C Compiler: sudo apt-get install gcc
⚫ Type the password to allow the installation.
Open the terminal and open the gedit editor using the command : gedit filename.c
Type the C program and save the file.
Compile the C program using the following command : gcc filename.c
Run the C program using the command : ./a.out
OUTPUT:
RESULT:
Thus, the C compiler has been successfully installed in the Virtual Machine and
the programs are executed and outputs are verified.
EX.NO: 3a INSTALL GOOGLE APP ENGINE AND CREATE SIMPLE
WEB APPLICATIONS USING PYTHON/JAVA.
AIM :
TOOLS REQUIRED :
PROGRAM :
Test.py
import webapp2
class
MainPage(webapp2.RequestH
andler): def get(self):
self.response.write("Hello World")
app=webapp2.WSGIApplication([('/',MainPage),],deb
ug=True)
App.yaml
runtime:
python27
api_version: 1
threadsafe: true
handlers:
- url: /
script: test.app
PROCEDURE:
1. Install Python of any version and download cloud SDK for python.
7. After logged in, create a cloud project (or) use the project which was already
created.
10. Your project will be created and again process from step 5 to step 7.
11. After choosing the project which you have created, type the command:
google-cloud-
the python program file). In that python file, type “HelloWorld” program and
save it.
12. After setting the path, the components from version 316.0.0 will get installed.
13. After all these installations, open the any browser of your choice and type in
localhost : 8000
14. Then, in browser “Hello World” will be produced as output.
OUTPUT :
RESULT :
Thus, the execution of Hello World using cloud SDK and python has been
installed, executed and output was verified.
EX.NO: 3.b DEVELOP CELSIUS TO FAHRENHEIT WEB
APPLICATION USING PYTHON / JAVA
AIM:
To install the Google app engine and using it to develop Celsius to Fahrenheit
web application using python/java.
PROCEDURE:
1. First install python for executing the web application.
2. Download Google Cloud SDK and install it.
3. Click Next, Next and select the installation folder and click install.
4. Click Next and make sure all the checkbox is selected and click Finish.
5. After installing, Google Cloud SDK Shell is opened and gcloud is initailzed
by “gcloud init” command while finishing the setup automaticlly.
6. If we manually open the Google Cloud SDK Shell, we have to initialize
gcloud by “gcloud init” command.
7. Since I already logged in to my account, I only need to select the account for
the Google cloud. If you are using it for the first time it asks for login, login
with your Gmail account for authentication purpose.
8. So, in this process select Re-initialize this configuration [default] with new
settings.
10. And it asks for Account selection for this configuration. Select your account if
you already logged in. If not select Log in with a new account.
11. Select cloud project to use. If there is no projects then create a new project by
using “gcloud projects create project name” command.
12. After selecting the project create a new folder called ‘test’ anywhere in the
computer. Create a Python file and yaml file inside this folder.
13. Create a text document and type the python code and save it as test1.py.
test1.py:
import webapp
def convert_temp(cel_temp):
''' convert Celsius temperature to Fahrenheit
temperature ''' if cel_temp == "":
return
"" try:
far_temp = float(cel_temp) * 9 / 5 + 32
far_temp = round(far_temp, 3) # round to three
decimal places return str(far_temp)
except ValueError: # user entered non-numeric
temperature return "invalid input"
class
MainPage(webapp2.RequestHandl
er): def get(self):
cel_temp =
self.request.get("cel_temp")
far_temp =
convert_temp(cel_temp)
self.response.headers["Content-Type"] =
"text/html" self.response.write("""
<html>
<head><title>Temperature Converter</title></head>
<body>
<form action="/" method="get">
Celsius temperature: <input type="text"
name="cel_temp" value={}>
<input type="submit"
value="Convert"><br>
Fahrenheit temperature: {}
</form>
</body>
</html>""".format(cel_temp,
far_temp)) routes = [('/',
MainPage)]
my_app = webapp2.WSGIApplication(routes, debug=True)
14. Create a text document and type the yaml file code and save it as app.yaml.
app.yaml:
runtime:
python27
api_version: 1
threadsafe: true
handlers:
- url: /
script: test1.my_app
15. After creating both .yaml and .py file, now we have to execute this python file
by running dev_appserver.py file in bin folder by using this command :google-
cloud-sdk\bin\dev_appserver.py “C:\Users\CHRISTILLA\Desktop\test"
16. Select ‘Y’ if you want to install the components. And automatically after installing
the components the python file is executed and hosted.
OUTPUT:
RESULT :
Thus, the execution of celsius to fahrenheit program using cloud SDK and
python has been executed and output was verified.
EX.NO : 4 GAE LAUNCHER TO LAUNCH THE WEB
APPLICATIONS
AIM :
To use GAE Launcher to launch the web applications.
PROCEDURE :
Step 1:
Download the original App Engine SDK for Python 2
Step 2 :
⚫ Install the AppEngine SDK .Make sure that python 2.7 is installed.
Click Next
⚫ Accept the terms and conditions for the installation. Click Next.
⚫ Choose the destination folder to install.Click Next.
RESULT:
AIM :
TOOLS REQUIRED :
Windows OS.
NetBeans.
PROCEDURE :
Open NetBeans => create new project as Cloudsim => set file location to a
In cloudsim-3.0.3, open sources => org , copy this org and add it inside the
source of cloudsim-3.0.
Now, jar file will be added inside the library of the project cloudsim.
Also, download common-math-3.33 jar file and add it to the library to avoid
some errors.
PROGRAM:
package org.cloudbus.cloudsim.examples;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.LinkedList; import java.util.List;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; import
org.cloudbus.cloudsim.Datacenter;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.DatacenterCharacteristics; import org.cloudbus.cloudsim.Host;
import org.cloudbus.cloudsim.Log; import org.cloudbus.cloudsim.Pe; import
org.cloudbus.cloudsim.Storage;
import org.cloudbus.cloudsim.UtilizationModel; import
org.cloudbus.cloudsim.UtilizationModelFull; import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.VmAllocationPolicySimple; import
org.cloudbus.cloudsim.VmSchedulerSpaceShared; import
org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple;
import org.cloudbus.cloudsim.provisioners.PeProvisionerSimple; import
org.cloudbus.cloudsim.provisioners.RamProvisionerSimple;
public class CloudSimExample5 {
private static List<Cloudlet> cloudletList1;
private static List<Cloudlet> cloudletList2;
private static List<Vm> vmlist1;
private static List<Vm> vmlist2;
public static void main(String[] args) {
Log.printLine("Starting CloudSimExample5...");
try {
int num_user = 2;
Calendar calendar = Calendar.getInstance();
@SuppressWarnings("unused")
Datacenter datacenter0 = createDatacenter("Datacenter_0");
@SuppressWarnings("unused")
Datacenter datacenter1 = createDatacenter("Datacenter_1");
DatacenterBroker broker1 = createBroker(1);
int brokerId1 = broker1.getId();
int vmid = 0;
int mips = 250;
long size = 10000;
int ram = 512;
long bw = 1000;
int pesNumber = 1;
String vmm = "Xen";
vmlist1.add(vm1);
vmlist2.add(vm2);
broker1.submitVmList(vmlist1);
broker2.submitVmList(vmlist2);
int id = 0;
long length = 40000;
long fileSize = 300;
long outputSize = 300;
UtilizationModel utilizationModel = new
UtilizationModelFull();
cloudletList1.add(cloudlet1);
cloudletList2.add(cloudlet2);
broker1.submitCloudletList(cloudletList1);
broker2.submitCloudletList(cloudletList2);
CloudSim.startSimulation();
CloudSim.stopSimulation();
hostList.add(
new Host(
hostId,
new RamProvisionerSimple(ram),
new BwProvisionerSimple(bw),
storage,
peList,
new VmSchedulerSpaceShared(peList)
)
);
return datacenter;
}
private static DatacenterBroker createBroker(int id){
}
return broker;
}
if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS){
Log.print("SUCCESS");
RESULT:
AIM:
To find a procedure to transfer a file between two independent Virtual machines using
Shared folder in VMware Workstation.
PRE-REQUISITES:
⚫ VMware Workstation
⚫ Two Ubuntu Virtual Machines,
⚫ Text file.
PROCEDURE I:
● Before turning on the virtual machines, create a shared folder in the host OS
● Choose the people whom you want to share with. Select as everyone.
● Turn on the Second Virtual machine and check whether sharedfolders is shared and
mount the shared folder to Share folder
● Open the shared folder which you have seen in the previous Virtual machine. Open
the folder and open the text file.
● Finally you can see that the file has been transferred from one virtual machine
through another virtual machine by using the shared folder method.
PROCEDURE II:
1. Before starting your Guest
2. Go to VirtualBox Manager
3. Select your interested Guest
4. Go to Guest Settings
5. In Guest Settings, scroll the left side-menu, and go to Shared Folders
If you see the error mount: wrong fs type, bad option, bad superblock on …, this means you first need to
OUTPUT:
RESULT:
Thus, the transfer of a file between two virtual machines was successfully
implemented using the shared folder procedure as well as the correctness has been
proved here successfully
EX.NO: 7 LAUNCH A VIRTUAL MACHINE USING
TRYSTACK(OPENSTACK)
AIM
To study about the Openstack and its dashboard and also the procedure to create
a virtual machine using Openstack Dashboard.
PROCEDURE
KVM INSTALLTION
To run KVM, you need a processor that supports hardware virtualization. Intel and AMD both
have developed extensions for their processors, deemed respectively
Intel VT-x (code name Vanderpool) and AMD-V (code name Pacifica). To see if your processor
supports one of these, you can review the output from this command:
Now see if your running kernel is 64-bit, just issue the following command:
$ uname –m
x86_64 indicates a running 64-bit kernel. If you use see i386, i486, i586 or i686, you're running a
32-bit kernel.
$ ls /lib/modules/3.16.0-30- generic/kernel/arch/x86/kvm/kvm
Verify Installation
You can test if your install has been successful with the following command:
Id Name State
Creating VMS
$ virt-install --connect qemu:///system -n hardy -r 512 -f hardy1.qcow2 -s 12 -c ubuntu-
14.04.2-server-amd64.iso --vnc --noautoconsole --os-type linux --os-variant ubuntuHardy
(or)
Step 1 : Under the Project Tab, Click Instances. In the right side screen Click Launch Instance.
Step 2 : In the details, Give the instance name(eg. Instance1).
Step 3: Click Instance Boot Source list and choose 'Boot from image' Step 4:
Click Image name list and choose the image currently uploaded. Step 5: Click
launch.
Your VM will get created.
[Type text]
In browser give your machines ip http://<ip Address>
Re-Starting Openstack
$ ./rejoin.sh
$ ps -ef|grep devstack it shows all the processes running End all
the processes.
RESULT:
Thus, the Openstack has been successfully studied with its installation in
Ubuntu as well as the launching of a new virtual machine in Openstack
Dashboard.
[Type text]
EX.NO: 8 INSTALL HADOOP SINGLE NODE
CLUSTER WITH IMPLEMENTATION OF
WORDCOUNT PROGRAM
AIM:
To install and run a Hadoop Single Node Cluster and implement Word Count program.
PROCEDURE:
REQUIREMENTS:
DOWNLOAD LINKS:
1. For Hadoop:
http://www-eu.apache.org/dist/hadoop/common/hadoop-3.0.0/
Delete the all contents of the bin folder and replace it by downloading from the below
link
https://codeload.github.com/gvreddy1210/bin/zip/master
3. For jdk:
If not present do the following check whether the system is 32bit or 64bit.
32/
PROCEDURE:
3. Path setting:
Go to control panel (or) file explorer (or) right click my computer select system
properties select advanced system settings go to advanced tab select environment
variables.
For java:
VARIABLE : JAVA_HOME
For Hadoop:
VARIABLE : HADOOP_HOME
(Eg: C:\hadoop-3.0.0\hadoop-3.0.0)
VARIABLE : Path
PATH : Locate till bin folders of both jdk and
jdk1.8.0_162;
C:\hadoop 3.0.0\hadoop3.0.0\
bin; C:\hadoop-3.0.0\
hadoop3.0.0\sbin)
Note: you have to set three paths to the Path. Separate the paths by a semicolon (;)
Set JAVA_HOME
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
Create a folder named data. Inside that folder create two folders named datanode and
namenode.
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/C:/hadoop-3.0.0/hadoop-3.0.0/data/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/C:/hadoop-3.0.0/hadoop-3.0.0/data/datanode</value>
</property>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
5. RUN HADOOP
Open command prompt with admin privileges and run the following command to
format the namenode.
As of now you have completed the installation steps, now you need to run the setup for
that, open command prompt and execute “start-all.cmd”.
Now if you want to check which services are running in your system, run the command
‘JPS’ in your command prompt.
REQUIREMENTS:
PROCEDURE:
Open cmd in Administrative mode and move to "C:/Hadoop-2.8.0/sbin" and start
cluster
Start-all.cmd
Copy the input text file named input_file.txt in the input directory (input_dir)of
HDFS.
o hadoop fs -put C:/input_file.txt /input_dir
PROGRAM:
Therefore Hadoop Single Node Cluster is created and word count program is
implemented completed successfully.