CC LAB MANUAL (5b)
CC LAB MANUAL (5b)
AIM:
Step 1:
Download the following
VMware package
Guest OS (Ubuntu) ISO file
Step 2: Navigate to the directory where the above files are downloaded.
Step 3:
Change the permissions of the VMware package. Use the following command, chmod a+x
<VMWARE_PACKAGE_NAME> That is,
1
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
2
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
Step 4:
Open VMware Player
Accept all the agreements, terms and conditions.
Select all the default settings and continue.
VMware is successfully installed on your Host Machine.
3
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
4
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
5
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
Step 5:
Select “Create a new Virtual Machine”
Select “Use ISO image” and Browse your Guest OS ISO image path and click “Next”.
Use your password as “admin” and click “Next”.
Click “Next”
Select your disk size upto a maximum of 25GB and Click “Next”.
6
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
7
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
Select Finish
RESULT:
8
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
AIM:
To install a C compiler in the virtual machine and execute a sample program.
ALGORITHM:
Step 1: To check Gcc compiler is installed or not.
$ dpkg - l | grep gcc
Step 2: If GCC compiler is not installed in VM, to execute the following command
$sudo apt-get install gcc (or) $sudo apt-get install build-essential
Step 3: Open a Vi Editor
Step 4: Get the no. of rows and columns for first and second
matrix. Step 5: Get the values of x and y matrix using for loop.
Step 6: Find the product of first and second and store the result in multiply
matrix. multiply[i][j]=multiply[i][j]+(first[i][k]*second[k][j]);
Step 7: Display the resultant
matrix. Step 8: Stop the program.
PROGRAM:
#include <stdio.h>
int main()
{
int a[10][10],b[10][10],mul[10][10],r,c,i,j,k;
9
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
Thus a C compiler in the virtual machine to execute a sample program has been executed
successfully.
10
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
AIM:
To Install Google App Engine. Create hello world app and other simple web applications
using python/java.
STEP 1
Download google cloud SDK from the google cloud website
[ https://cloud.google.com/sdk/docs/install ]
( OR )
Click the following link to download the required Google Cloud SDK
[ https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-
sdk-357.0.0-linux-x86_64.tar.gz ]
Extract the zip folder in Downloads/ folder
STEP 2
Open new terminal in Downloads/ folder and install the google cloud
./google-cloud-sdk/install.sh
Login to your google account and continue the process by accepting the terms and
conditions
11
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
STEP 3
Finally run the app using
12
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
Go to http://localhost:8000/
RESULT :
Thus installation of Google App Engine is completed and hello world app using python is
completed successfully
13
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
AIM:
To use GAE launcher to launch the web applications.
PROCEDURE :
https://cloud.google.com/sdk/docs/install
./google-cloud-sdk/install.sh
14
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
Step 10 - Go to http://localhost:8000
“If Localhost not opening then run this command”
fuser -n tcp -k 8080
OUTPUT :
RESULT :
Thus the GAE launcher has been successfully used to launch the web applications.
15
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
AIM:
DESCRIPTION:
CloudSim is a simulation toolkit that supports the modeling and simulation of the core
functionality of cloud, like job/task queue, processing of events, creation of cloud
entities(datacenter, datacenter brokers, etc), communication between different entities,
implementation of broker policies, etc.
This toolkit allows to:
Test application services in a repeatable and controllable environment.
Tune the system bottlenecks before deploying apps in an actual cloud.
Experiment with different workload mix and resource performance scenarios
on simulated infrastructure for developing and testing adaptive application
provisioning techniques
Core features of CloudSim are:
The Support of modeling and simulation of large scale computing
environment as federated cloud data centers, virtualized server hosts, with
customizable policies for provisioning host resources to virtual machines and
energy-aware computational resources
It is a self-contained platform for modeling cloud’s service brokers,
provisioning, and allocation policies.
It supports the simulation of network connections among simulated system
element
Support for simulation of federated cloud environment that inter-networks resources
from both private and public domains.
Availability of a virtualization engine that aids in the creation and
management of multiple independent and co-hosted virtual services on a data
center node.
Flexibility to switch between space shared and time shared allocation of
processing cores to virtualized services.
The cloudsim allows to model and simulate the cloud system components,
therefore to support its function different set of classes has been developed by its
developers like:
To simulating the regions and datacenters the class named “Datacenter.java”
is available in org.cloudbus.cloudsim package.
To simulate the workloads for cloud, the class named as “Cloudlet.java” is
available in org.cloudbus.cloudsim package.
To simulate the load balancing and policy-related implementation the classes
named “DatacenterBroker.java”,
16
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
Cloudsim simulation toolkit setup is easy. Before you start to setup CloudSim,
following resources must be Installed/downloaded on the local system
Java Development Kit(JDK)
Eclipse IDE for Java developers
Download CloudSim source code
Download Common Math libraries
RESULT:
Thus the study on cloudsim simulation tool is done successfully.
17
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
18
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
3. After making sure git is installed, Clone the project from github url
https://github.com/michaelfahmy/cloudsim-task-scheduling
Use command : git clone https://github.com/michaelfahmy/cloudsim-task-scheduling
4. Open netbeans 8.x and create a new java project from files
19
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
5. Now find the cloned project folder which generally in linux will be in
/home/Netbeansproject1/javaapplication1
20
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
Paste the folders in the src folder of the newly created netbeans project
21
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
22
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
Select the folder where you cloned the git project and go to jars
23
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
9. To run any scheduling , expand the folder and right click on the file ending on
_scheduler and run file
For FCFS, run FCFS_Scheduler,java
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.VmSchedulerTimeShared; import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple; import
org.cloudbus.cloudsim.provisioners.PeProvisionerSimple; import
org.cloudbus.cloudsim.provisioners.RamProvisionerSimple;
/**
24
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
25
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
// Second step: Create Datacenters
//Datacenters are the resource providers in CloudSim. We need at list one of them to run a
CloudSim simulation
@SuppressWarnings("unused")
Datacenter datacenter0 = createDatacenter("Datacenter_0"); @SuppressWarnings("unused")
Datacenter datacenter1 = createDatacenter("Datacenter_1");
//Third step: Create Broker DatacenterBroker broker = createBroker(); int brokerId =
broker.getId();
//Fourth step: Create VMs and Cloudlets and send them to broker vmlist =
createVM(brokerId,20); //creating 20 vms
cloudletList = createCloudlet(brokerId,40); // creating 40 cloudlets
broker.submitVmList(vmlist); broker.submitCloudletList(cloudletList);
// Fifth step: Starts the simulation CloudSim.startSimulation();
// Final step: Print results when simulation is over List<Cloudlet> newList =
broker.getCloudletReceivedList();
CloudSim.stopSimulation();
printCloudletList(newList); Log.printLine("CloudSimExample6 finished!");
}
catch (Exception e)
{
Log.printLine("The simulation has been terminated due to an unexpected
}
// Here are the steps needed to create a PowerDatacenter:
// 1. We need to create a list to store one or more
// Machines
List<Host> hostList = new ArrayList<Host>();
// 2. A Machine contains one or more PEs or CPUs/Cores. Therefore, should
// create a list to store these PEs before creating a Machine.
List<Pe> peList1 = new ArrayList<Pe>(); int mips = 1000;
// 3. Create PEs and add these into the list.
//for a quad-core machine, a list of 4 PEs is required:
peList1.add(new Pe(0, new PeProvisionerSimple(mips)));
// need to store Pe id and MIPS Rating
peList1.add(new Pe(1, new PeProvisionerSimple(mips))); peList1.add(new Pe(2, new
PeProvisionerSimple(mips))); peList1.add(new Pe(3, new PeProvisionerSimple(mips)));
//Another list, for a dual-core machine List<Pe> peList2 = new ArrayList<Pe>();
peList2.add(new Pe(0, new PeProvisionerSimple(mips))); peList2.add(new Pe(1, new
PeProvisionerSimple(mips)));
//4. Create Hosts with its id and list of PEs and add them to the list of machines int hostId=0;
int ram = 2048; //host memory (MB) long storage = 1000000; //host storage int bw = 10000;
hostList.add(
new Host( // This is our first machine hostId++;
hostList.add(new Host(hostId,new RamProvisionerSimple(ram), new BwProvisionerSimple(bw),
storage,peList2,new VmSchedulerTimeShared(peList2))); // Second machine
//To create a host with a space-shared allocation policy for PEs to VMs:
//hostList.add(new Host(hostId,new CpuProvisionerSimple(peList1),new
RamProvisionerSimple(ram),new BwProvisionerSimple(bw),storage,new
VmSchedulerSpaceShared(peList1) new wProvisionerSimple(bw), storage, peList1,
new VmSchedulerTimeShared(peList1)
Create a DatacenterCharacteristics object that stores the
// properties of a data center: architecture, OS, list of Resource // Machines, allocation policy:
time- or space-shared, time zone // and its price (G$/Pe time unit).
26
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
27
CS1707- Cloud Computing Laboratory Department of CSE 2024 - 2025
OUTPUT :
RESULT:
Thus the study on cloudsim simulation tool is done successfully.
28