Lab File Cloud Computing
Lab File Cloud Computing
Engineering
B.Tech
3 Year – 6thSemester
rd
1 List of Experiments 1
1
CGC COLLEGE
Task 1. Install VirtualBox/VMware OF
Workstation on EngineeringCollege
different OS.
Department of Computer Science &
Step 1: Download VirtualBox installer for Windows
Engineering
The installer can be found on its download page
here https://www.virtualbox.org/wiki/Downloads
Go to the page above and download the binary version for Windows hosts
After downloading, run the executable to begin installing the software. When you start
the installation, you should get a prompt like the one below.
During the installation wizard, you’ll get a Network Interfaces warning.. Click Yes to
proceed. If you’re in the process of downloading or copying files and data, this will
interrupt your network connection briefly. So, maybe pause the process or wait until
you’re done before installing VirtualBox.
2
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
When prompted with a message to install (Trust) Oracle Universal Serial Bus,
3
click Install to continue.
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
After that, VirtualBox should be installed. When you’re done installing, open
VirtualBox and install its extension pack.
The extension pack extends the functionality of VirtualBox base packages. It provides the
following enhancements to VirtualBox:
To install the extension pack, go back to VirtualBox’s download page , download and
4
save the current pack for all supported platforms’
CGC COLLEGE OF Engineering College
Department
Step 2: Install VirtualBox extension pack. of Computer Science &
After downloading the saving he extension pack. open VirtualBox host software
click File –> Preferences Engineering
Then select extension, click the browse button to the right to find the download extension
pack. Select it, agree to the licensing terms and install.
When you’re done, VirtualBox software will be ready to use and install guest operating
systems.
5
Task 2. Install different operating systems in Virtual Box.
CGC COLLEGE OF Engineering College
Open up your VM app and click theDepartment of virtual
button to create a new Computermachine. Science &
Engineering
You’ll be guided through the process by a wizard that first asks which OS you’ll be
installing. If you type the name of the OS in the “Name” box, the app will most likely
automatically select the type and version for the OS. If it doesn’t—or it guesses wrong—
select those items yourself from the dropdown menus. When you’re done, click “Next.”
6
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Based on the OS you plan to install, the wizard will preselect some default settings for
you, but you can change them over the screens that follow. You’ll be asked how much
memory to allocate to the VM. If you want something other than the default, select it
here. Otherwise, just click “Next.” And don’t worry, you’ll be able to change this value
later if you need to.
7
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
The wizard will also create the virtual hard disk file to be used by the VM. Unless you
already have a virtual hard disk file you want to use, just select the option to create a new
one.
ou’ll also be asked whether to create a dynamically allocated or fixed size disk. With a
dynamically allocated disk, you’ll set a maximum disk size, but the file will only grow to
that size as it needs to. With a fixed size disk, you’ll also set a size, but the file created
8
will be that large from its creation.
CGC COLLEGE OF Engineering College
We recommend creating fixed sizeDepartment of they
disks because, while Computer Science
eat up a little more disk&
space, they also perform better—making your VM feelEngineering
a bit more responsive. Plus, you’ll
know how much disk space you’ve used and won’t get surprised when your VM files
start growing.
You’ll then be able to set the size of the virtual disk. You’re free to go with the default
setting or change the size to suit your needs. Once you click “Create,” the virtual hard
disk is created.
9
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
After that, you’re dumped back into the main VM app window, where your new VM
should show up. Make sure the installation media you need is available to the machine—
usually this involves pointing to an ISO file or real disc through the VM’s settings. You
can run your new VM by selecting it and hitting “Start.”
10
Task 3. Simulate a cloud scenario using simulator
CGC COLLEGE OF Engineering College
STEP BY STEP INSTALLATION Department
OF CLOUD SIM ofINTO
Computer
ECLIPSE Science &
Engineering
1. Open up Eclipse and go to Menu Section, then click File, keep on clicking New and
finally select java project. It is shown as in the Figure1
11
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Give project Name and select run time environment and Finish
3. Once you hit finish. An empty project named CloudIntro will be created in the project
List as shown in the Figure3.
5. A new window will get open, now click File System as demonstrated in the Figure5.
13
6. Next Step is to go to the directory where you have extracted your cloud sim tool.
Figure6 is shown to guide you to get into the directory where your cloudsim folder is
located. CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
15
CloudSim is written in Java. The knowledge you need to use CloudSim is basic Java
programming and some basics about cloud computing. Knowledge of programming IDEs
such as Eclipse or NetBeans isCGC COLLEGE
also helpful. OFhence,
It is a library and, Engineering
CloudSim doesCollege
not
have to be installed. Normally, youDepartment of Computer Science &
can unpack the downloaded package in any directory,
add it to the Java classpath and it is ready to be used. Please verify whether Java is
available on your system.To use Engineering
CloudSim in Eclipse:
The fourth step is to create one virtual machine unique ID of the VM, userId ID
of the VM’s owner, mips, number Of Pes amount of CPUs, amount of RAM,
amount of bandwidth, amount of storage, virtual machine monitor, and
cloudletScheduler policy for cloudlets:
Vm vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerTimeShared())
16
Create a cloudlet with CGC COLLEGE
length, file size, output size, OF Engineering
and utilisation model: College
Department
Cloudlet cloudlet = new Cloudlet(id, length, of Computer
pesNumber, fileSize,Science
outputSize,&
utilizationModel, utilizationModel, utilizationModel)
Engineering
Submit the cloudlet list to the broker:
broker.submitCloudletList(cloudletList)
CloudSim.startSimulation()
Sample Output from the Existing Example:
Starting CloudSimExample1...
Initialising...
Starting CloudSim version 3.0
Datacenter_0 is starting...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>null
Broker is starting...
Entities started.
0.0: Broker: Cloud Resource List received with 1 resource(s)
0.0: Broker: Trying to Create VM #0 in Datacenter_0
0.1: Broker: VM #0 has been created in Datacenter #2, Host #0
0.1: Broker: Sending cloudlet 0 to VM #0
400.1: Broker: Cloudlet 0 received
400.1: Broker: All Cloudlets executed. Finishing...
400.1: Broker: Destroying VM #0
Broker is shutting down...
Simulation: No more future events
CloudInformationService: Notify all CloudSim entities for shutting down.
Datacenter_0 is shutting down...
Broker is shutting down...
Simulation completed.
Simulation completed.
========== OUTPUT ==========
Cloudlet ID STATUS Data center ID VM ID Time Start Time Finish Time
0 SUCCESS 2 0 400 0.1 400.1
*****Datacenter: Datacenter_0*****
User id Debt
17
3 35.6
OR
CGC
The main() method is the pointer COLLEGE
from where the executionOF
of thisEngineering
example starts College
Department of Computer Science &
public static void main(String[] args)
Engineering
There are eleven steps that are followed in each example with some variation in them,
specified as follows:
Set the Number of users for the current simulation. This user count is directly
proportional to a number of brokers in the current simulation.
Initialize the simulation, provided with the current time, number of users and trace flag.
Create a Datacenter.
18
new RamProvisionerSimple(ram),
CGC
new COLLEGE OF Engineering College
BwProvisionerSimple(bw),
storage,
Department of Computer Science &
peList,
Engineering
new VmSchedulerTimeShared(peList)
)
);
String arch = "x86";
String os = "Linux";
String vmm = "Xen";
double time_zone = 10.0;
double cost = 3.0;
double costPerMem = 0.05;
double costPerStorage = 0.001;
double costPerBw = 0.0;
LinkedList<Storage> storageList = new LinkedList<Storage>();
DatacenterCharacteristics characteristics = new
DatacenterCharacteristics(arch, os, vmm, hostList,
time_zone, cost, costPerMem,
costPerStorage, costPerBw);
Datacenter datacenter = null;
try {
datacenter = new Datacenter(name, characteristics, new
VmAllocationPolicySimple(hostList),
storageList, 0);
} catch (Exception e) {
e.printStackTrace();
}
return datacenter;
}
Where the createBroker() method initializes the entity object from DatacenterBroker
19
class
CGC COLLEGE OF Engineering College
Department of Computer Science &
private static DatacenterBroker createBroker()
{
DatacenterBroker broker = null; Engineering
try {
broker = new DatacenterBroker("Broker");
} catch (Exception e) {
e.printStackTrace();
return null;
}
return broker;
}
Vm vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerTimeShared());
vmlist.add(vm);
broker.submitVmList(vmlist);
20
cloudletList = new ArrayList<Cloudlet>();
CGC COLLEGE OF Engineering College
int id = 0; Department of Computer Science &
long length = 400000;
long fileSize = 300; Engineering
long outputSize = 300;
UtilizationModel utilizationModel = new UtilizationModelFull();
cloudlet.setUserId(brokerId);
cloudlet.setVmId(vmid);
cloudletList.add(cloudlet);
broker.submitCloudletList(cloudletList);
CloudSim.startSimulation();
CloudSim.stopSimulation();
21
printCloudletList(newList);
CGC COLLEGE OF Engineering College
Where printCloudletList() method formats the output to correctly display it on the
console.
Department of Computer Science
&
Engineering
private static void printCloudletList(List<Cloudlet> list)
{
int size = list.size();
Cloudlet cloudlet;
String indent = " ";
Log.printLine();
Log.printLine("========== OUTPUT ==========");
Log.printLine("Cloudlet ID" + indent + "STATUS" + indent
+ "Data center ID" + indent + "VM ID" +
indent + "Time" + indent
+ "Start Time" + indent + "Finish Time");
22
}
CGC COLLEGE OF Engineering College
Once you Run the example the output for cloudsimExample1.java will be displayed like:
Department of Computer Science &
Engineering
23
Task 4. Implement scheduling algorithms.
CGC COLLEGE OF Engineering College
Department
Implementation of Shortest Job First of Computer Science &
algorithm using cloudSim
DatacenterBroker.java
package org.cloudbus.cloudsim; Engineering
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.core.CloudSimTags;
import org.cloudbus.cloudsim.core.SimEntity;
import org.cloudbus.cloudsim.core.SimEvent;
import org.cloudbus.cloudsim.lists.CloudletList;
import org.cloudbus.cloudsim.lists.VmList;
/**
* DatacentreBroker represents a broker acting on behalf of a user. It hides VM
management, as vm
* creation, sumbission of cloudlets to this VMs and destruction of VMs.
*
* @author Rodrigo N. Calheiros
* @author Anton Beloglazov
* @since CloudSim Toolkit 1.0
*/
public class DatacenterBroker extends SimEntity {
/** The vm list. */
protected List<? extends Vm> vmList;
/** The vms created list. */
protected List<? extends Vm> vmsCreatedList;
/** The cloudlet list. */
protected List<? extends Cloudlet> cloudletList;
/** The cloudlet submitted list. */
protected List<? extends Cloudlet> cloudletSubmittedList;
/** The cloudlet received list. */
protected List<? extends Cloudlet> cloudletReceivedList;
/** The cloudlets submitted. */
protected int cloudletsSubmitted;
24
/** The vms requested. */
protected int vmsRequested;
/** The vms acks. */ CGC COLLEGE OF Engineering College
protected int vmsAcks; Department of Computer Science &
/** The vms destroyed. */
protected int vmsDestroyed; Engineering
/** The datacenter ids list. */
protected List<Integer> datacenterIdsList;
/** The datacenter requested ids list. */
protected List<Integer> datacenterRequestedIdsList;
/** The vms to datacenters map. */
protected Map<Integer, Integer> vmsToDatacentersMap;
/** The datacenter characteristics list. */
protected Map<Integer, DatacenterCharacteristics> datacenterCharacteristicsList;
/**
* Created a new DatacenterBroker object.
*
* @param name name to be associated with this entity (as required by Sim_entity
class from
* simjava package)
* @throws Exception the exception
* @pre name != null
* @post $none
*/
public DatacenterBroker(String name) throws Exception {
super(name);
setVmList(new ArrayList<Vm>());
setVmsCreatedList(new ArrayList<Vm>());
setCloudletList(new ArrayList<Cloudlet>());
setCloudletSubmittedList(new ArrayList<Cloudlet>());
setCloudletReceivedList(new ArrayList<Cloudlet>());
cloudletsSubmitted = 0;
setVmsRequested(0);
setVmsAcks(0);
setVmsDestroyed(0);
setDatacenterIdsList(new LinkedList<Integer>());
setDatacenterRequestedIdsList(new ArrayList<Integer>());
setVmsToDatacentersMap(new HashMap<Integer, Integer>());
setDatacenterCharacteristicsList(new HashMap<Integer,
DatacenterCharacteristics>());
}
25
/**
* This method is used CGC
to sendCOLLEGE
to the broker the OF Engineering
list with virtual machines College
that
must be Department of Computer Science &
* created.
* Engineering
* @param list the list
* @pre list !=null
* @post $none
*/
public void submitVmList(List<? extends Vm> list) {
getVmList().addAll(list);
}
/**
* This method is used to send to the broker the list of cloudlets.
*
* @param list the list
* @pre list !=null
* @post $none
*/
public void submitCloudletList(List<? extends Cloudlet> list) {
getCloudletList().addAll(list);
}
/**
* Specifies that a given cloudlet must run in a specific virtual machine.
*
* @param cloudletId ID of the cloudlet being bount to a vm
* @param vmId the vm id
* @pre cloudletId > 0
* @pre id > 0
* @post $none
*/
public void bindCloudletToVm(int cloudletId, int vmId) {
CloudletList.getById(getCloudletList(), cloudletId).setVmId(vmId);
}
/**
* Processes events available for this Broker.
*
26
* @param ev a SimEvent object
* @pre ev != null
* @post $none CGC COLLEGE OF Engineering College
*/ Department of Computer Science &
@Override
public void processEvent(SimEvent ev) { Engineering
switch (ev.getTag()) {
// Resource characteristics request
case
CloudSimTags.RESOURCE_CHARACTERISTICS_REQUEST:
processResourceCharacteristicsRequest(ev);
break;
// Resource characteristics answer
case CloudSimTags.RESOURCE_CHARACTERISTICS:
processResourceCharacteristics(ev);
break;
// VM Creation answer
case CloudSimTags.VM_CREATE_ACK:
processVmCreate(ev);
break;
// A finished cloudlet returned
case CloudSimTags.CLOUDLET_RETURN:
processCloudletReturn(ev);
break;
// if the simulation finishes
case CloudSimTags.END_OF_SIMULATION:
shutdownEntity();
break;
// other unknown tags are processed by this method
default:
processOtherEvent(ev);
break;
}
}
/**
* Process the return of a request for the characteristics of a PowerDatacenter.
*
* @param ev a SimEvent object
* @pre ev != $null
* @post $none
27
*/
protected void processResourceCharacteristics(SimEvent ev) {
CGC COLLEGE
DatacenterCharacteristics characteristics OF Engineering College
= (DatacenterCharacteristics)
ev.getData(); Department of Computer Science &
getDatacenterCharacteristicsList().put(characteristics.getId(),
characteristics); Engineering
if (getDatacenterCharacteristicsList().size() ==
getDatacenterIdsList().size()) {
setDatacenterRequestedIdsList(new ArrayList<Integer>());
createVmsInDatacenter(getDatacenterIdsList().get(0));
}
}
/**
* Process a request for the characteristics of a PowerDatacenter.
*
* @param ev a SimEvent object
* @pre ev != $null
* @post $none
*/
protected void processResourceCharacteristicsRequest(SimEvent ev) {
setDatacenterIdsList(CloudSim.getCloudResourceList());
setDatacenterCharacteristicsList(new HashMap<Integer,
DatacenterCharacteristics>());
/**
* Process the ack received due to a request for VM creation.
*
* @param ev a SimEvent object
* @pre ev != null
28
* @post $none
*/
CGC COLLEGE
protected void processVmCreate(SimEvent ev) { OF Engineering College
Department of Computer Science &
int[] data = (int[]) ev.getData();
int datacenterId = data[0];
int vmId = data[1]; Engineering
int result = data[2];
if (result == CloudSimTags.TRUE) {
getVmsToDatacentersMap().put(vmId, datacenterId);
getVmsCreatedList().add(VmList.getById(getVmList(), vmId));
Log.printLine(CloudSim.clock() + ": " + getName() + ": VM #" +
vmId
+ " has been created in Datacenter #" + datacenterId
+ ", Host #"
+ VmList.getById(getVmsCreatedList(),
vmId).getHost().getId());
} else {
Log.printLine(CloudSim.clock() + ": " + getName() + ": Creation
of VM #" + vmId
+ " failed in Datacenter #" + datacenterId);
}
incrementVmsAcks();
/**
* Process a cloudlet return event.
*
* @param ev a SimEvent object
* @pre ev != $null
* @post $none
*/
protected void processCloudletReturn(SimEvent ev) {
Cloudlet cloudlet = (Cloudlet) ev.getData();
getCloudletReceivedList().add(cloudlet);
Log.printLine(CloudSim.clock() + ": " + getName() + ": Cloudlet " +
cloudlet.getCloudletId()
+ " received");
cloudletsSubmitted--;
if (getCloudletList().size() == 0 && cloudletsSubmitted == 0) { // all
cloudlets executed
Log.printLine(CloudSim.clock() + ": " + getName() + ": All
Cloudlets executed. Finishing...");
clearDatacenters();
finishExecution();
} else { // some cloudlets haven't finished yet
if (getCloudletList().size() > 0 && cloudletsSubmitted == 0) {
// all the cloudlets sent finished. It means that some bount
// cloudlet is waiting its VM be created
clearDatacenters();
createVmsInDatacenter(0);
}
30
}
}
CGC COLLEGE OF Engineering College
/** Department of Computer Science &
* Overrides this method when making a new and different type of Broker. This
method is called Engineering
* by {@link #body()} for incoming unknown tags.
*
* @param ev a SimEvent object
* @pre ev != null
* @post $none
*/
protected void processOtherEvent(SimEvent ev) {
if (ev == null) {
Log.printLine(getName() + ".processOtherEvent(): " + "Error - an
event is null.");
return;
}
/**
* Create the virtual machines in a datacenter.
*
* @param datacenterId Id of the chosen PowerDatacenter
* @pre $none
* @post $none
*/
protected void createVmsInDatacenter(int datacenterId) {
// send as much vms as possible for this datacenter before trying the next
one
int requestedVms = 0;
String datacenterName = CloudSim.getEntityName(datacenterId);
for (Vm vm : getVmList()) {
if (!getVmsToDatacentersMap().containsKey(vm.getId())) {
Log.printLine(CloudSim.clock() + ": " + getName() + ":
Trying to Create VM #" + vm.getId()
+ " in " + datacenterName);
sendNow(datacenterId,
31
CloudSimTags.VM_CREATE_ACK, vm);
requestedVms++;
} CGC COLLEGE OF Engineering College
} Department of Computer Science &
Engineering
getDatacenterRequestedIdsList().add(datacenterId);
setVmsRequested(requestedVms);
setVmsAcks(0);
}
/**
* Submit cloudlets to the created VMs.
*
* @pre $none
* @post $none
*/
protected void submitCloudlets() {
int vmIndex = 0;
List <Cloudlet> sortList= new ArrayList<Cloudlet>();
ArrayList<Cloudlet> tempList = new ArrayList<Cloudlet>();
if(smallestCloudlet.getCloudletLength()>checkCloudlet.getCloudletLength())
{
smallestCloudlet= checkCloudlet;
}
}
32
sortList.add(smallestCloudlet);
tempList.remove(smallestCloudlet);
CGC COLLEGE OF Engineering College
} Department of Computer Science &
int count=1; Engineering
for(Cloudlet printCloudlet: sortList)
{
Log.printLine(count+".Cloudler Id:"+printCloudlet.getCloudletId()
+",Cloudlet Length:"+printCloudlet.getCloudletLength());
count++;
}
/**
* Destroy the virtual machines running in datacenters.
*
* @pre $none
* @post $none
*/
protected void clearDatacenters() {
for (Vm vm : getVmsCreatedList()) {
Log.printLine(CloudSim.clock() + ": " + getName() + ":
Destroying VM #" + vm.getId());
sendNow(getVmsToDatacentersMap().get(vm.getId()),
CloudSimTags.VM_DESTROY, vm);
}
getVmsCreatedList().clear();
}
/**
* Send an internal event communicating the end of the simulation.
*
* @pre $none
* @post $none
*/
protected void finishExecution() {
sendNow(getId(), CloudSimTags.END_OF_SIMULATION);
}
/*
* (non-Javadoc)
* @see cloudsim.core.SimEntity#shutdownEntity()
*/
@Override
public void shutdownEntity() {
34
Log.printLine(getName() + " is shutting down...");
}
CGC COLLEGE OF Engineering College
/* Department of Computer Science &
* (non-Javadoc)
* @see cloudsim.core.SimEntity#startEntity()Engineering
*/
@Override
public void startEntity() {
Log.printLine(getName() + " is starting...");
schedule(getId(), 0,
CloudSimTags.RESOURCE_CHARACTERISTICS_REQUEST);
}
/**
* Gets the vm list.
*
* @param <T> the generic type
* @return the vm list
*/
@SuppressWarnings("unchecked")
public <T extends Vm> List<T> getVmList() {
return (List<T>) vmList;
}
/**
* Sets the vm list.
*
* @param <T> the generic type
* @param vmList the new vm list
*/
protected <T extends Vm> void setVmList(List<T> vmList) {
this.vmList = vmList;
}
/**
* Gets the cloudlet list.
*
* @param <T> the generic type
* @return the cloudlet list
*/
35
@SuppressWarnings("unchecked")
public <T extends Cloudlet> List<T> getCloudletList() {
CGC
return (List<T>) COLLEGE OF Engineering College
cloudletList;
} Department of Computer Science &
/** Engineering
* Sets the cloudlet list.
*
* @param <T> the generic type
* @param cloudletList the new cloudlet list
*/
protected <T extends Cloudlet> void setCloudletList(List<T> cloudletList) {
this.cloudletList = cloudletList;
}
/**
* Gets the cloudlet submitted list.
*
* @param <T> the generic type
* @return the cloudlet submitted list
*/
@SuppressWarnings("unchecked")
public <T extends Cloudlet> List<T> getCloudletSubmittedList() {
return (List<T>) cloudletSubmittedList;
}
/**
* Sets the cloudlet submitted list.
*
* @param <T> the generic type
* @param cloudletSubmittedList the new cloudlet submitted list
*/
protected <T extends Cloudlet> void setCloudletSubmittedList(List<T>
cloudletSubmittedList) {
this.cloudletSubmittedList = cloudletSubmittedList;
}
/**
* Gets the cloudlet received list.
*
* @param <T> the generic type
36
* @return the cloudlet received list
*/
CGC COLLEGE OF Engineering College
@SuppressWarnings("unchecked")
public <T extends Cloudlet>Department of Computer
List<T> getCloudletReceivedList() { Science &
return (List<T>) cloudletReceivedList;
} Engineering
/**
* Sets the cloudlet received list.
*
* @param <T> the generic type
* @param cloudletReceivedList the new cloudlet received list
*/
protected <T extends Cloudlet> void setCloudletReceivedList(List<T>
cloudletReceivedList) {
this.cloudletReceivedList = cloudletReceivedList;
}
/**
* Gets the vm list.
*
* @param <T> the generic type
* @return the vm list
*/
@SuppressWarnings("unchecked")
public <T extends Vm> List<T> getVmsCreatedList() {
return (List<T>) vmsCreatedList;
}
/**
* Sets the vm list.
*
* @param <T> the generic type
* @param vmsCreatedList the vms created list
*/
protected <T extends Vm> void setVmsCreatedList(List<T> vmsCreatedList) {
this.vmsCreatedList = vmsCreatedList;
}
/**
* Gets the vms requested.
37
*
* @return the vms requested
*/ CGC COLLEGE OF Engineering College
Department
protected int getVmsRequested() { of Computer Science &
return vmsRequested;
} Engineering
/**
* Sets the vms requested.
*
* @param vmsRequested the new vms requested
*/
protected void setVmsRequested(int vmsRequested) {
this.vmsRequested = vmsRequested;
}
/**
* Gets the vms acks.
*
* @return the vms acks
*/
protected int getVmsAcks() {
return vmsAcks;
}
/**
* Sets the vms acks.
*
* @param vmsAcks the new vms acks
*/
protected void setVmsAcks(int vmsAcks) {
this.vmsAcks = vmsAcks;
}
/**
* Increment vms acks.
*/
protected void incrementVmsAcks() {
vmsAcks++;
}
38
/**
* Gets the vms destroyed.
* CGC COLLEGE OF Engineering College
Department of Computer Science &
* @return the vms destroyed
*/
protected int getVmsDestroyed() { Engineering
return vmsDestroyed;
}
/**
* Sets the vms destroyed.
*
* @param vmsDestroyed the new vms destroyed
*/
protected void setVmsDestroyed(int vmsDestroyed) {
this.vmsDestroyed = vmsDestroyed;
}
/**
* Gets the datacenter ids list.
*
* @return the datacenter ids list
*/
protected List<Integer> getDatacenterIdsList() {
return datacenterIdsList;
}
/**
* Sets the datacenter ids list.
*
* @param datacenterIdsList the new datacenter ids list
*/
protected void setDatacenterIdsList(List<Integer> datacenterIdsList) {
this.datacenterIdsList = datacenterIdsList;
}
/**
* Gets the vms to datacenters map.
*
* @return the vms to datacenters map
*/
39
protected Map<Integer, Integer> getVmsToDatacentersMap() {
return vmsToDatacentersMap;
} CGC COLLEGE OF Engineering College
Department of Computer Science &
/**
* Sets the vms to datacenters map. Engineering
*
* @param vmsToDatacentersMap the vms to datacenters map
*/
protected void setVmsToDatacentersMap(Map<Integer, Integer>
vmsToDatacentersMap) {
this.vmsToDatacentersMap = vmsToDatacentersMap;
}
/**
* Gets the datacenter characteristics list.
*
* @return the datacenter characteristics list
*/
protected Map<Integer, DatacenterCharacteristics>
getDatacenterCharacteristicsList() {
return datacenterCharacteristicsList;
}
/**
* Sets the datacenter characteristics list.
*
* @param datacenterCharacteristicsList the datacenter characteristics list
*/
protected void setDatacenterCharacteristicsList(
Map<Integer, DatacenterCharacteristics>
datacenterCharacteristicsList) {
this.datacenterCharacteristicsList = datacenterCharacteristicsList;
}
/**
* Gets the datacenter requested ids list.
*
* @return the datacenter requested ids list
*/
protected List<Integer> getDatacenterRequestedIdsList() {
40
return datacenterRequestedIdsList;
}
CGC COLLEGE OF Engineering College
/** Department of Computer Science &
* Sets the datacenter requested ids list.
* Engineering
* @param datacenterRequestedIdsList the new datacenter requested ids list
*/
protected void setDatacenterRequestedIdsList(List<Integer>
datacenterRequestedIdsList) {
this.datacenterRequestedIdsList = datacenterRequestedIdsList;
}
}
Simulation.java
package examples.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 java.util.Random;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.CloudletSchedulerSpaceShared;
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;
41
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple;
//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 = 1000;
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(i, userId, mips, pesNumber, ram, bw, size, vmm,
new CloudletSchedulerSpaceShared());
//for creating a VM with a space shared scheduling policy for
cloudlets:
//vm[i] = Vm(i, userId, mips, pesNumber, ram, bw, size, vmm,
new CloudletSchedulerSpaceShared());
list.add(vm[i]);
}
42
return list;
} CGC COLLEGE OF Engineering College
Department of Computer Science &
private static List<Cloudlet> createCloudlet(intEngineering
userId, int cloudlets){
// Creates a container to store Cloudlets
LinkedList<Cloudlet> list = new LinkedList<Cloudlet>();
//cloudlet parameters
long length = 1000;
long fileSize = 300;
long outputSize = 300;
int pesNumber = 1;
UtilizationModel utilizationModel = new UtilizationModelFull();
for(int i=0;i<cloudlets;i++){
Random r= new Random();
cloudlet[i] = new Cloudlet(i, length +r.nextInt(2000), pesNumber,
fileSize, outputSize, utilizationModel, utilizationModel, utilizationModel);
// setting the owner of these Cloudlets
cloudlet[i].setUserId(userId);
list.add(cloudlet[i]);
}
return list;
}
/**
* Creates main() to run this example
*/
public static void main(String[] args) {
Log.printLine("Starting CloudSimExample6...");
try {
// First step: Initialize the CloudSim package. It should be called
43
// before creating any entities.
int num_user = 3; // number of grid users
CalendarCGCcalendarCOLLEGE OF Engineering College
= Calendar.getInstance();
Department
boolean trace_flag oftrace
= false; // mean Computer
events Science &
// Initialize the CloudSim libraryEngineering
CloudSim.init(num_user, calendar, trace_flag);
//Fourth step: Create VMs and Cloudlets and send them to broker
vmlist = createVM(brokerId,10); //creating 20 vms
cloudletList = createCloudlet(brokerId,40); // creating 40 cloudlets
broker.submitVmList(vmlist);
broker.submitCloudletList(cloudletList);
CloudSim.stopSimulation();
printCloudletList(newList);
Log.printLine("CloudSimExample6 finished!");
}
44
catch (Exception e)
{
CGC COLLEGE OF Engineering College
e.printStackTrace();
Department
Log.printLine("The simulation of
has Computer
been terminatedScience
due to an&
unexpected error");
} Engineering
}
//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)
45
long storage = 1000000; //host storage
int bw = 10000;
CGC COLLEGE OF Engineering College
hostList.add( Department of Computer Science &
new Host(
hostId, Engineering
new RamProvisionerSimple(ram),
new BwProvisionerSimple(bw),
storage,
peList1,
new VmSchedulerTimeShared(peList1)
)
); // 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)
// )
// );
/**
* Prints the Cloudlet objects
* @param list list of Cloudlets
*/
@SuppressWarnings("deprecation")
private static void printCloudletList(List<Cloudlet> list) {
int size = list.size();
Cloudlet cloudlet;
}
}
}
}
49
Task 5 To study cloud security management.
CGC COLLEGE OF Engineering College
Department
Cloud security, also known as cloud of Computer
computing security, consists of a setScience
of policies,&
Engineering
controls, procedures and technologies that work together to protect cloud-based systems,
data, and infrastructure. These security measures are configured to protect cloud data,
support regulatory compliance and protect customers' privacy as well as setting
authentication rules for individual users and devices. From authenticating access to
filtering traffic, cloud security can be configured to the exact needs of the business. And
because these rules can be configured and managed in one place, administration
overheads are reduced and IT teams empowered to focus on other areas of the business.
Cloud computing offers organizations many benefits, but these benefits are unlikely to be
realized if there are not appropriate IT security and privacy protection strategies in place
when using the cloud. When migrating to the cloud, organizations must have a clear
understanding of potential security risks associated with cloud computing, and set
realistic expectations with providers. The following 8 steps will help enterprise IT and
business decision makers analyze the information security and privacy implications of
cloud computing and cloud security management on their business.
Following are the Steps to follow:
1. Ensure effective governance and compliance
Most organizations have security, privacy and compliance policies and procedures to
protect their IP and assets.In addition to this, organizations should establish a formal
governance framework that outlines chains of responsibility, authority and
communication.This describes the roles and responsibilities of those involved, how they
interact and communicate, and general rules and policies.
2. Audit operation and business processes
It is important to audit the compliance of IT system vendors that host the applications and
data in the cloud.There are three important areas that need to be audited by cloud service
customers: internal control environment of a cloud service provider, access to the
50
corporate audit trail, and the cloud service facility’s security.
3. Manage people, roles, CGC COLLEGE
and identities OF Engineering College
Using the cloud means there will beDepartment ofcloud
employees from the Computer Science
service provider that can&
Engineering
access the data and applications, as well as employees of the organization that perform
operations on the providers system. Organizations must ensure that the provider has
processes that govern who has access to customer data and application. The provider
must allow the customer to assign and manage roles and authorization for each of their
users. The provide must also have a secure system in place to managing the unique
identifies for users and services.
4. Proper protection of data
Data is the core of all IT security concerns for any organization. Cloud computing does
not change this concern but brings new challenges because of the nature of cloud
computing. The security and protection of data both at rest and in transit needs to be
ensured.
5. Enforce privacy policies
Privacy and protection of personal information and data is crucial, especially as many
major companies and financial institutions are suffering data breaches. Privacy of
personal information is related to personal data that is held by an organization, which
could be compromised by negligence or bugs. It is critical that privacy requirements be
addresses by the cloud service provider. If not, the organization should consider seeking a
different provider or not placing sensitive data in the cloud.
6. Assess security considerations for cloud applications
Organizations are constantly protecting their business applications from internal and
external threats.Application security poses challenges to both the provider and
organization, and depending on the type of cloud deployment model (IaaS, PaaS, or
SaaS), there are different security policy considerations.
7. Cloud networks and connections are secure
Cloud service providers must allow legitimate network traffic and block malicious traffic.
51
Unfortunately, cloud service providers will not know what network traffic its customer
CGCorganizations
plan to send and receive. Therefore, COLLEGE OF Engineering
and providers College
must work together to
set safety measures, and provide theDepartment of Computer
tools necessary to protect the system. Science &
Engineering
8. Evaluate security controls and physical infrastructure
The security of an IT system is also based on the security of the physical infrastructure
and facility. Organizations must have assurance from the provider that the appropriate
controls are in place. Infrastructure and facilities should be held in secure areas, and
protected against external and environmental threats. For example, physical printers
should be locked down or moved into a controlled access area. Further protect access by
using a network print security appliance to require user authentication for access to the
printer to help eliminate security breaches and reduce printing costs. As organizations
migrate their applications and data to the cloud computing, it is critical to maintain the
security and privacy protection they had in their traditional IT environment.
52
Task 6 To study and implementation
CGC COLLEGE of identityOF
management
Engineering College
Department
Identity management (ID management) of Computer
is the organizational Science
process for ensuring that&
individuals have the appropriate access to technologyEngineering
resources. More specifically, this
includes the identifying, authentication and authorization of a person, or persons, to have
access to applications, systems or networks. This is done by associating user rights and
restrictions with established identities. Managed identities can also refer to software
processes that need access to organizational systems. Identity management can be
considered an essential component for security.
Identity management includes authenticating users and determining whether they're
allowed access to particular systems. ID management works hand-in-hand with identity
access manageme systems. Identity management is focused on authentication, while
access management is aimed at authorization.
The main goal of identity management is to ensure that only authenticated users are
granted access to the specific applications, systems or IT environments for which they are
authorized. This includes control over user provisioning and the process
of onboarding new users such as employees, partners, clients and other stakeholders.
Identity management also includes control over the process of authorizing system or
network permissions for existing users and the offboarding of users who are no longer
authorized to access organization systems.
ID management determines whether a user has access to systems and also sets the level
of access and permissions a user has on a particular system. For instance, a user may be
authorized to access a system but be restricted from some of its components.
Identity governance, the policies and processes that guide how roles and user access
should be administered across a business environment, is also an important aspect of
identity management. Identity governance is key to successfully managing role-based
access management systems.
Importance of identity management
53
Identity management is an important part of the enterprise security plan, as it is linked to
CGC
both the security and productivity of theCOLLEGE
organization. OF Engineering College
In many organizations, users areDepartment of Computer
granted more access Science
privileges than they need to&
perform their functions. Attackers can take advantage Engineering
of compromised user credentials to
gain access to organizations' network and data. Using identity management, organizations
can safeguard their corporate assets against many threats including hacking, ransomware,
phishing and other malware attacks.
Identity management systems can add an additional layer of protection by ensuring user
access policies and rules are applied consistently across an organization.
An identity and access management (IAM) system can provide a framework with the
policies and technology needed to support the management of identities. Many of today's
IAM systems use federated identity, which allows a single digital identity to be
authenticated and stored across multiple different systems.
An IAM system can also be used to deploy single sign-on (SSO) technologies. This can
significantly decrease the number of passwords users need. SSO incorporates a federated-identity
approach by using a single login and password to create an authentication token, which can then
54
be accepted by various enterprise systems and applications. Combined with multifactor
authentication as well as enforceable security policies, enterprises can lower the risk of security
CGC COLLEGE OF Engineering College
breaches. An example of such policies includes the principle of least privilege, which gives users
Department of Computer Science &
only the access they require to fulfill their roles
Challenges of implementing identity management
Engineering
To implement identity management, an enterprise must be able to plan and collaborate
across business units. Successful organizations will more likely be ones that establish
identity management strategies with clear objectives, defined business processes and buy-
in from stakeholders at the outset. Identity management works best when IT, security,
human resources and other departments are involved.
Identity management systems must allow companies to automatically manage multiple
users in different situations and computing environments in real time. It's much more
time-consuming to manually adjust access privileges and access controls for hundreds or
thousands of users. Additionally, authentication must be simple for users to perform and
easy for IT to deploy and secure.
One of the top challenges in implementing identity management is password
management. IT professionals should investigate techniques that can reduce the impact of
these password issues in their companies.
For security, tools for managing identity management should run as an application on a
dedicated network appliance or server. At the core of an identity management system are
policies defining which devices and users are allowed on the network and what a user can
accomplish, depending on device type, location and other factors. All of this also depends
on appropriate management console functionality. This includes policy definition,
reporting, alerts, alarms and other common management and operations requirements. An
alarm might be triggered, for example, when a specific user tries to access a resource for
which they do not have permission. Reporting produces an audit log documenting what
specific activities were initiated.
Many identity management systems offer directory integration, support for both wired
and wireless users and the flexibility to meet almost any security and operational policy
55
requirement. Because bring your own device (BYOD) is so strategic today, time-saving
features support for a varietyCGC COLLEGE
of mobile operating systemsOF
and Engineering College
automated device status
verification is becoming common.Department ofmay
Time-saving features Computer Science
include automated device&
onboarding and provisioning. Engineering
Business benefits of identity management
In addition to managing employees, the use of identity management along with access
management enables a business to manage customer, partner, supplier and device access
to its systems while ensuring security is the top priority.
This goal can be accomplished on several fronts, starting with allowing authorized access
from anywhere. As people increasingly use their social media identities to access services
and resources, organizations must be able to reach their users through any platform.
Additionally, they can allow their users access to corporate systems through their existing
digital identities.
Identity management can also be used to improve employee productivity. This is
especially important when onboarding new employees, or changing authorizations for
accessing different systems when an employee's function changes. When companies hire
new employees, they have to be given access to specific parts of their systems, given new
devices and provisioned into the business. Done manually, this process can be time-
consuming and reduces the ability of the employees to get right to work. However,
automated provisioning can enable companies to accelerate the process of allowing new
employees to access the required parts of their systems.
Finally, identity management can be an important tool for enhancing employees' user
experience, especially for reducing the impact of identity chaos -- the state of having
multiple sets of user IDs and passwords for disparate systems. Typically, people can't
remember numerous usernames and passwords and would prefer to use a single identity
to log in to different systems at work. SSO and unified identities enable customers and
other stakeholders to access different areas of the enterprise system with one account,
56
ensuring a seamless user experience.
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
57
Task 7 Case Study - Amazon Web Services/Microsoft
CGC COLLEGE Azure/Google
OF Engineering College
cloud services Department of Computer Science &
Engineering
Microsoft Azure
Microsoft Azure, as the name suggests, is Microsoft’s Cloud platform that lets you test,
build, deploy, and even manage applications that are placed in Microsoft Azure’s data
centers or Availability Zones. It has all three service model solutions just like AWS,
which are infrastructure as a Service, Platform as a Service, and Software as a Service. It
lets you integrate with different open source and Microsoft Stack of products/tools and
programming languages.
It was announced in 2008 but was released on February 1, 2020, as Windows Azure and
later on renamed to Microsoft Azure as we know it today.
Azure is similar to AWS and offers a variety of products and solutions for app
developers. The Azure platform offers good processing and computing power. It is
capable of deploying and managing virtual machines at scale. Azure can also run large-
scale “parallel batch computing” – a unique feature that it shares with AWS over the
Google Cloud Platform.
58
space where popular Google Services reside like Google Search, YouTube, Gmail, etc.
Google is popularly known for its services in Machine Learning, Data Analytics,
Compute, Storage, etc. CGC COLLEGE OF Engineering College
I believe this is enough informationDepartment of Computer
about the Cloud Service Science
providers we plan to &
compare. Let us go ahead and understand how these compare with each other.
Engineering
Market Share
When we start with market share, what better way to see the numbers than to start by
taking a look at the Gartner’s Magic Quadrant for Cloud Infrastructure services.
This tells you that AWS is still leading the Cloud Market with a definitive edge. Yes,
Azure and Google Cloud follow suit, but they do have some catching up to do.
Talking about the numbers, AWS had a clear head start in the market since it initiated
quite early than others. But it still holds on top position in the market and by quite a
margin, as Q4 in 2019, these were the respective market shares were as follows-
But numbers can be deceptive. It was also revealed that AWS grew by just 41% last year.
Whereas Google Cloud and Azure grew by 80% and 75% respectively. This suggests is
that Azure and Google Cloud are catching up.
This was about the market share. Let us see how these Cloud Service Providers compare
when it comes to their reach in terms of infrastructure.
Global Infrastructure
When we discuss the infrastructure that concerns these platforms, we have to consider
two terms, those are, Regions and Availability Zones.
Regions: Here, regions mean a geographical location where a Cloud Data center
resides.
Availability Zone
It is the data center that resides in a region. Regions may have more than one Data-center.
Some regions, for certain services providers, have only one data center. Hence, we do not
59
use the availability zone term in that case. That data center is called or known as region.
CGC COLLEGE OF Engineering College
Here are some numbers to see how these platforms compare:
Department of Computer Science &
Amazon Web Services Engineering
Regions: 24 Launched and 3 announced
Availability Zones: 76
Countries served: 245
Microsoft Azure
Regions: 60+
Countries served: 140
Regions: 22
Availability Zone: 61
Countries served: 35
It is clear that Amazon Web Services has a wider reach and provides services to more
countries than the other two platforms. Let us now move ahead and see what kind of
customer base these platforms support.
McDonald’s
Netflix
Unilever
Samsung
MI
60
AirBnB
BMW
ESPN CGC COLLEGE OF Engineering College
Department of Computer Science &
Companies Like Netflix, LinkedIn spend $10-19 million a month on their instances. That
Engineering
tells you how much trust people have in this platform and also how large and high profile
the customer base is. It also has a very widespread small scale industry customer base.
Microsoft Azure
Microsoft Azure is not far behind in this race. It also has a wide customer base and has
gained a lot of popularity in most of the Top Fortune 500 companies. Around 70-80% of
fortune 500 companies use Microsoft Azure. Some known brands that use this platform
are:
Ebay
Apple
Pixar
HP
Honeywell
Among the three, Google Cloud is the youngest and has a smaller customer base
compared to others. But we should not forget Google Cloud is home to YouTube, and
Gmail which are huge on their own. Here is a list of some other popular customers they
have-
HSBC
Snapchat
HTC
Phillips
So this was about some of the customers these Cloud Service Providers have. Please not
these are just some numbers and honorable mentions. If you visit the websites for these
platforms you will find a large number of customer base and even many case studies that
tell you how these service providers have solved problems for numerous businesses
across the globe.
61
Now that we know what customers these platforms serve, let us see and compare the
services provided by these platforms.
CGC COLLEGE OF Engineering College
Service Comparison
Department of Computer Science &
Engineering
Amazon Web Services, Microsoft Azure and Google Cloud Platform provide numerous
cloud computing services that are there in the market. If we are to bluntly put out the
numbers then this is how the service numbers appear.
Since there are so many services these service providers provide, these services are
classified into subcategories, or domains, let us dig deeper into some of these services.
Compute Services
When we compare compute services, AWS has all the praise for EC2 which is very
popular in the market. It also supports various other compute services that touch PaaS,
container, and even serverless computing service. Azure also has many services that
match AWS in these domains. Google Cloud, however, lacks a little when compared with
these two platforms. Here is a list of some notable services these Service providers
provide.
Amazon Web
Services Microsoft Azure Google Cloud
Services
Storage Services
Storage is a very important service when it comes to Cloud Computing because it is only
after you store data you can think of other services that can help process your data. Let us
see how these Service Providers take care of Storage on Cloud.
No matter if you are looking for object, Block or file storage, AWS covers it all. Not just
that, it takes storage to a different level as it provides services like Amazon Storage
Gateway, Snowball and Snowmobile. These services ensure you covered even if your
requirement are for hybrid storage, or even if you actually want to move your data
physically. Hence Amazon Web Services has you covered here.
Microsoft Azure
Microsoft Azure’s is equally good when it comes to storing your data on cloud. It covers
you with basic storage services like Blob Storage for object storage which maybe
unstructured data. It provides Queue Storage if you ate dealing with large-volume storage
workloads. it also provides File and Disk Storage. It covers you Big Data Application
needs with Data Lake Store.
Google Cloud also limited in terms of Storage Services just as it is Compute domain.
However it has unified object storage service, and even a Persistent Disk storage
option.Just Amazon Snowball it provides Data Transfer Application, and also supports
online Data transfer services.
File System
Amazon EFS Azure File Storage Google ZFS/Avere
Storage
Now that we know how Storage Services have fared. Let us go ahead and see how these
Cloud giants fare with each other in terms of Cloud Database offerings.
Database Services
When it comes to databases and archiving, here too, Amazon has a plethora of Cloud
Services to offer. It is SQL-compatible databases like Aurora or even databases that are
Relational like the Relational Database Service (RDS). It has you covered on NoSQL
Databases too, it offers service called Dynamo. Whereas, ElastiCache service provides an
in-memory data store too. If your requirements need you to have a Data Warehouse, a
graph database, or even services that meet data migration needs, it answers with services
like Amazon Redshift, Neptune. As already mentioned in storage services, even if
archival storage is to be handled even that is managed with Amazon Glacier.
Microsoft Azure
SQL DB
64
DB for MySQL
DB for PostGreSQL
CGC COLLEGE OF Engineering College
Department
It covers you for Data Warehouse requirements of Computer
with Cosmos Science
DB and their stable Storage &
for NoSQL. Redis Cache provides in-memory service and for Hybrid Storage
Engineering
requirements, there is Server Stretch Database. It is designed in such a way that it suites
specific organizations that use Microsoft SQL Server for their data centers. Amazon Web
Services lack a little in the backup domain. Microsoft Azure comparatively does better
there and is equally adept when it comes to Archival storage.
It does provide SQL and NoSQL Database services. Google Cloud Spanner is a service
for SQL based Databases that are designed for data critical workloads requirements.
Cloud Bigtable and Cloud Datastore are its options for NoSQL database requirements.
Again the number of services and options it provides in comparison to Microsoft Azure
or Amazon Web Services is still less and limited. It does have services for Backup or
archival. Here is a list of database services that work similarly for these cloud service
providers.
Google Cloud
NoSQL DB: Amazon
Table Storage DatastoreGoogle Cloud
Key-value DynamoDB
Bigtable
So this was about Databases. Let us go ahead and compare these platforms based on
Networking Domain.
Networking Domain
These services do fairly well against each other when compared and there is very little to
65
choose when put head to head. Here is a list of services when compared head to head.
CGC COLLEGE OF Engineering College
Amazon Web
Services
Services Department of Computer
Microsoft Azure Science
&
Google Cloud
Engineering
Virtual Network Amazon VPC Azure Vnet Google VPC
Domain Name Amazon Route Azure Domain Name Google Domain Name
Services 53 Service Service
Pricing
Pricing is easily the hardest measure to compare these Cloud Service Providers for. This
is because pricing varies greatly when it comes to comparing them based on small-term
investment or short sized services. However, let us try and do that.
When it comes to short term investments or small-sized resources, Google Cloud gives
better pricing options. Here is one example for the same. Let us consider small-sized
virtual instances with minimum RAM and Virtual CPU requirements. Google Cloud will
cost around, $50-55 per month. Amazon Web Services will cost you $69 per month and
Microsoft Azure will cost you around $70-75 per month.
But as we scale up the pricing models change a lot and give you a very different picture.
Let us consider this example, if we opt for the largest instance these platforms provide
different pricing, an instance with around 4 TB of RAM, and around 128 Virtual CPU’s
Amazon Web services offer the best pricing here, it costs around $2700 to $3000 per
month. Microsoft Azure costs around $5000 per month, whereas Google Cloud costs
$3800 to 4000 per month.
66
So it is clear that Google Cloud is cheaper when it comes to short term investments.
Another point that supports the claim is Google Cloud charges on a per-second basis.
Microsoft Azure gives you perCGC COLLEGE
minute billing. Amazon Web OF Engineering
Services had hour billing,College
but in recent times it too has movedDepartment of Computer Science &
to per-minute billing.
Engineering
Google Cloud ensures when it comes to small-term investments, it comes with various
offers and discounts ensuring cheaper pricing. So as mentioned earlier choosing a
provider based on pricing can be tricky and may vary on what sort of business
requirements your business has.
Miscellaneous Comparison
We have already compared these platforms on quite a few pointers, however, there are
quite a few other pointers these platforms can be compared on.
Here is an overall miscellaneous comparison. Let us start with Amazon Web Services.
What makes Amazon Web Services stand out? Firstly its head start, meaning it has had
that extra valuable years to firm its dominance in the market. This can be proven with
facts. Amazon Web Services has been the market leader in terms of Market share in IaaS
services, it provides and Gartner supports that claim with numbers.
Another reason for this success is the number of services it provides, it almost provides
double the services the second-best competitor provides in terms of the sheer number of
services it has to offer. It is a highly mature platform and is ready to serve different
enterprise-level requirements. It also has deep and precise capabilities.
But everything has weaknesses. Amazon is costly when it comes to short term
investments and many find it tricky to opt for this platform due to the uncertainty on its
pricing models. But the wide array of services it provides makes up for the lapse in
pricing concerns. Certainly Amazon’s strong points or pros overshadow Amazon’s
weaknesses.
Now let us go ahead and see how Microsoft Azure Fares when it comes to its strengths
and weaknesses.
67
Microsoft Azure CGC COLLEGE OF Engineering College
Department
Microsoft is a company that has overcome of inComputer
various hurdles Science
the IT and software industry&
it has ever come across. This ability has also transpiredEngineering
into Cloud offerings it provides.
Microsoft always had a stronghold and contributions to the On-Premise service market. It
has ensured that services and offering it provided can be moved to the cloud and can be
made Azure Cloud Compatible. Even though it had a late start, it is making up for it at a
very good pace.
Another major reason why Microsoft Azure is so popular and is so widely used is
because Microsoft Azure integrates with most of Microsoft stack of products with easy.
Hence many companies and enterprises find it relevant to migrate to Microsoft Azure
because then the deployment seems easy and effortless.
Let us see how this platform fares compared to others, and what are its pros and cons.
It offers fairly strong offerings in containers, it has developed a standard for Kubernetes,
and high computation capabilities in terms of Big Data Analytics, and even Machine
Learning. it also offers decent enough load balancing and scalability.
If we are to compare it with Amazon web Services and Microsoft Azure, it lacks a little
here with lesser market share, and lesser number of services.
By now, I assume we have discussed numerous pointers using which you can take a call
on what platform will suit your needs best. All these providers have their strengths and
weaknesses, and I am sure by now you can choose one for your requirements. Before we
68
all sign out, here are some final points.
CGC COLLEGE OF Engineering College
Market Share: Amazon Web Services is a clear winner here
Global Infrastructure:Department
In terms of number of Computer
Amazon Science
Web Services stands out&
here too
Growth: GCP is a clear winner here
Engineering
Service Comparison: Amazon web Services wins for numbers whereas
Microsoft Azure wins for integration capabilities
Pricing: Small investments GCP wins, longer run costs Amazon Web
Services is a winner
So this is, by now you should have a clear picture as to how these Cloud providers fare
against each other. This brings us to the end of this article on AWS vs Azure vs Google
Cloud.
Conclusion
Cloud Computing services has triggered a revolution in the IT industry. It has become a
go-to factor for application implementation and hosting for all companies, whether big or
small. According to a Gartner Survey Report, the market for public cloud is predicted to
reach around $411 billion in 2020. This is bound to generate a wide range of job
opportunities in this field. So, if you are planning to start a career in this domain, you are
on the right track. Getting a cloud computing certification in this field will definitely help
in learning and developing your skills. Become a cloud computing expert and join the
elite group of highly paid IT professionals in the world.
69
Task 8 Case Study on AWS Cloud
CGC COLLEGE OF Engineering College
Department of Computer Science &
Cloud computing is a term referred to storing and accessing data over the internet. It
Engineering
doesn't store any data on the hard disk of your personal computer. In cloud computing,
you can access data from a remote server.
Amazon web service is a platform that offers flexible, reliable, scalable, easy-to-use and
cost-effective cloud computing solutions.
AWS is a comprehensive, easy to use computing platform offered Amazon. The platform
is developed with a combination of infrastructure as a service (IaaS), platform as a
service (PaaS) and packaged software as a service (SaaS) offerings
History of AWS
Migration
Migration services used to transfer data physically between your datacenter and AWS.
1. DMS (Database Migration Service) -DMS service can be used to migrate on-site
databases to AWS. It helps you to migrate from one type of database to another
— for example, Oracle to MySQL.
2. SMS (Server Migration Service) - SMS migration services allows you to migrate
on-site servers to AWS easily and quickly.
3. Snowball — Snowball is a small application which allows you to transfer terabytes
of data inside and outside of AWS environment.
Storage
1. Amazon Glacier- It is an extremely low-cost storage service. It offers secure and
fast storage for data archiving and backup.
71
2. Amazon Elastic Block Store (EBS)- It provides block-level storage to use with
Amazon EC2 instances. Amazon Elastic Block Store volumes are network-
CGC COLLEGE
attached and remain independent from the life of anOF Engineering College
instance.
3. AWS Storage Gateway- This Department
AWS service is of Computer
connecting Science
on-premises software&
applications with cloud-based storage. It offers secure integration between the
Engineering
company's on-premises and AWS's storage infrastructure.
Security Services
1. IAM (Identity and Access Management) — IAM is a secure cloud security service
which helps you to manage users, assign policies, form groups to manage multiple
users.
2. Inspector — It is an agent that you can install on your virtual machines, which
reports any security vulnerabilities.
3. Certificate Manager — The service offers free SSL certificates for your domains
that are managed by Route53.
4. WAF (Web Application Firewall) — WAF security service offers application-
level protection and allows you to block SQL injection and helps you to block
cross-site scripting attacks.
5. Cloud Directory — This service allows you to create flexible, cloud-native
directories for managing hierarchies of data along multiple dimensions.
6. KMS (Key Management Service) — It is a managed service. This security service
helps you to create and control the encryption keys which allows you to encrypt
your data.
7. Organizations — You can create groups of AWS accounts using this service to
manages security and automation settings.
8. Shield — Shield is managed DDoS (Distributed Denial of Service protection
service). It offers safeguards against web applications running on AWS.
9. Macie — It offers a data visibility security service which helps classify and protect
your sensitive critical content.
10. GuardDuty —It offers threat detection to protect your AWS accounts and
workloads.
Database Services
1. Amazon RDS- This Database AWS service is easy to set up, operate, and scale a
relational database in the cloud.
2. Amazon DynamoDB- It is a fast, fully managed NoSQL database service. It is a
simple service which allow cost-effective storage and retrieval of data. It also
allows you to serve any level of request traffic.
3. Amazon ElastiCache- It is a web service which makes it easy to deploy, operate,
and scale an in-memory cache in the cloud.
4. Neptune- It is a fast, reliable and scalable graph database service.
72
5. Amazon RedShift - It is Amazon's data warehousing solution which you can use to
perform complex OLAP queries.
CGC COLLEGE OF Engineering College
Analytics Department of Computer Science &
1. Athena — This analytics service allows perm SQL queries on your S3 bucket to
find files. Engineering
2. CloudSearch — You should use this AWS service to create a fully managed search
engine for your website.
3. ElasticSearch — It is similar to CloudSearch. However, it offers more features like
application monitoring.
4. Kinesis — This AWS analytics service helps you to stream and analyzing real-
time data at massive scale.
5. QuickSight —It is a business analytics tool. It helps you to create visualizations in
a dashboard for data in Amazon Web Services. For example, S3, DynamoDB, etc.
6. EMR (Elastic Map Reduce) —This AWS analytics service mainly used for big
data processing like Spark, Splunk, Hadoop, etc.
7. Data Pipeline — Allows you to move data from one place to another. For example
from DynamoDB to S3.
Management Services
1. CloudWatch — Cloud watch helps you to monitor AWS environments like EC2,
RDS instances, and CPU utilization. It also triggers alarms depends on various
metrics.
2. CloudFormation — It is a way of turning infrastructure into the cloud. You can use
templates for providing a whole production environment in minutes.
3. CloudTrail — It offers an easy method of auditing AWS resources. It helps you to
log all changes.
4. OpsWorks — The service allows you to automated Chef/Puppet deployments on
AWS environment.
5. Config — This AWS service monitors your environment. The tool sends alerts
about changes when you break certain defined configurations.
6. Service Catalog — This service helps large enterprises to authorize which services
user will be used and which won't.
7. AWS Auto Scaling — The service allows you to automatically scale your
resources up and down based on given CloudWatch metrics.
8. Systems Manager — This AWS service allows you to group your resources. It
allows you to identify issues and act on them.
9. Managed Services—It offers management of your AWS infrastructure which
allows you to focus on your applications.
Internet of Things
73
1. IoT Core— It is a managed cloud AWS service. The service allows connected
devices like cars, light bulbs, sensor grids, to securely interact with cloud
CGC COLLEGE OF Engineering College
applications and other devices.
2. IoT Device Management —Department of Computer
It allows you to manage your IoT devicesScience
at any scale.&
3. IoT Analytics — This AWS IOT service is helpful to perform analysis on data
collected by your IoT devices. Engineering
4. Amazon FreeRTOS — This real-time operating system for microcontrollers helps
you to connect IoT devices in the local server or into the cloud.
Application Services
1. Step Functions — It is a way of visualizing what's going inside your application
and what different microservices it is using.
2. SWF (Simple Workflow Service) — The service helps you to coordinate both
automated tasks and human-led tasks.
3. SNS (Simple Notification Service) — You can use this service to send you
notifications in the form of email and SMS based on given AWS services.
4. SQS (Simple Queue Service) — Use this AWS service to decouple your
applications. It is a pull-based service.
5. Elastic Transcoder — This AWS service tool helps you to changes a video's
format and resolution to support various devices like tablets, smartphones, and
laptops of different resolutions.
Developer Tools
1. CodeStar — Codestar is a cloud-based service for creating, managing, and
working with various software development projects on AWS.
2. CodeCommit — It is AWS's version control service which allows you to store
your code and other assets privately in the cloud.
3. CodeBuild — This Amazon developer service help you to automates the process
of building and compiling your code.
4. CodeDeploy — It is a way of deploying your code in EC2 instances automatically.
5. CodePipeline — It helps you create a deployment pipeline like testing, building,
74
testing, authentication, deployment on development and production environments.
6. Cloud9 —It is an Integrated Development Environment for writing, running, and
debugging code in the CGC
cloud. COLLEGE OF Engineering College
Department of Computer Science &
Mobile Services
1. Mobile Hub — Allows you to add, configure and Engineering
design features for mobile apps.
2. Cognito — Allows users to signup using his or her social identity.
3. Device Farm — Device farm helps you to improve the quality of apps by quickly
testing hundreds of mobile devices.
4. AWS AppSync —It is a fully managed GraphQL service that offers real-time data
synchronization and offline programming features.
Business Productivity
1. Alexa for Business — It empowers your organization with voice, using Alexa. It
will help you to Allows you to build custom voice skills for your organization.
2. Chime — Can be used for online meeting and video conferencing.
3. WorkDocs — Helps to store documents in the cloud
4. WorkMail — Allows you to send and receive business emails.
Artificial Intelligence
1. Lex — Lex tool helps you to build chatbots quickly.
2. Polly — It is AWS's text-to-speech service allows you to create audio versions of
your notes.
3. Rekognition — It is AWS's face recognition service. This AWS service helps you
to recognize faces and object in images and videos.
4. SageMaker — Sagemaker allows you to build, train, and deploy machine learning
models at any scale.
5. Transcribe — It is AWS's speech-to-text service that offers high-quality and
affordable transcriptions.
6. Translate — It is a very similar tool to Google Translate which allows you to
translate text in one language to another.
Game Development
1. GameLift- It is a service which is managed by AWS. You can use this service to
host dedicated game servers. It allows you to scale seamlessly without taking your
game offline.
Amazon Web services are widely used for various computing purposes like:
Web site hosting
Application hosting/SaaS hosting
Media Sharing (Image/ Video)
Mobile and Social Applications
Content delivery and Media Distribution
Storage, backup, and disaster recovery
Development and test environments
Academic Computing
Search Engines
Social Networking
76
Advantages of AWS
CGC COLLEGE OF Engineering College
Department
Following are the pros of using AWS services: of Computer Science &
AWS allows organizations to use the already familiar programming models,
operating systems, databases, and architectures.Engineering
It is a cost-effective service that allows you to pay only for what you use, without
any up-front or long-term commitments.
You will not require to spend money on running and maintaining data centers.
Offers fast deployments
You can easily add or remove capacity.
You are allowed cloud access quickly with limitless capacity.
Total Cost of Ownership is very low compared to any private/dedicated servers.
Offers Centralized Billing and management
Offers Hybrid Capabilities
Allows you to deploy your application in multiple regions around the world with
just a few clicks
Disadvantages of AWS
If you need more immediate or intensive assistance, you'll have to opt for paid
support packages.
Amazon Web Services may have some common cloud computing issues when
you move to a cloud. For example, downtime, limited control, and backup
protection.
AWS sets default limits on resources which differ from region to region. These
resources consist of images, volumes, and snapshots.
Hardware-level changes happen to your application which may not offer the best
performance and usage of your applications.
77
Task 9 To Create EC2 Instance in AWS
CGC COLLEGE OF Engineering College
Department
An EC2 instance is nothing but a virtual of Computer
server in Amazon ScienceIt&
Web services terminology.
stands for Elastic Compute Cloud. It is a web service where an AWS subscriber can
request and provision a compute server in AWS cloud.Engineering
An on-demand EC2 instance is an offering from AWS where the subscriber/user can
rent the virtual server per hour and use it to deploy his/her own applications.
The instance will be charged per hour with different rates based on the type of the
instance chosen. AWS provides multiple instance types for the respective business needs
of the user.
Thus, you can rent an instance based on your own CPU and memory requirements and
use it as long as you want. You can terminate the instance when it’s no more used and
save on costs. This is the most striking advantage of an on-demand instance- you can
drastically save on your CAPEX.
Login to your AWS account and go to the AWS Services tab at the top left corner.
Here, you will see all of the AWS Services categorized as per their area viz.
Compute, Storage, Database, etc. For creating an EC2 instance, we have to
choose Computeà EC2 as in the next step.
78
Open all the services and click on EC2 under Compute services. This will launch
the dashboard of EC2. CGC COLLEGE OF Engineering College
Department of Computer Science &
Here is the EC2 dashboard. Here you will get all the information in gist about the AWS
EC2 resources running. Engineering
Step 2) On the top right corner of the EC2 dashboard, choose the AWS Region in which
you want to provision the EC2 server.
Here we are selecting N. Virginia. AWS provides 10 Regions all over the globe.
79
Step 3) In this step
CGC COLLEGE OF Engineering College
Once your desired Region isDepartment ofto Computer
selected, come back Science &
the EC2 Dashboard.
Click on 'Launch Instance' button in the section of Create Instance (as shown
below). Engineering
Instance creation wizard page will open as soon as you click 'Launch Instance'.
Choose AMI
1. You will be asked to choose an AMI of your choice. (An AMI is an Amazon
Machine Image. It is a template basically of an Operating System platform which
you can use as a base to create your instance). Once you launch an EC2 instance
from your preferred AMI, the instance will automatically be booted with the
desired OS. (We will see more about AMIs in the coming part of the tutorial).
2. Here we are choosing the default Amazon Linux (64 bit) AMI.
80
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Step 1) In the next step, you have to choose the type of instance you require based on
your business needs.
1. We will choose t2.micro instance type, which is a 1vCPU and 1GB memory server
offered by AWS.
2. Click on "Configure Instance Details" for further configurations
81
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
In the next step of the wizard, enter details like no. of instances you want to
launch at a time.
Here we are launching one instance.
Configure Instance
Step 1) No. of instances- you can provision up to 20 instances at a time. Here we are
launching one instance.
82
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Step 2) Under Purchasing Options, keep the option of 'Request Spot Instances' unchecked
as of now. (This is done when we wish to launch Spot instances instead of on-demand
ones. We will come back to Spot instances in the later part of the tutorial).
Step 3) Next, we have to configure some basic networking details for our EC2 server.
83
You have to decide here, in which VPC (Virtual Private Cloud) you want to
CGC
launch your instance and underCOLLEGE OFyour
which subnets inside Engineering College
VPC. It is better to
Department of Computer Science &
determine and plan this prior to launching the instance. Your AWS architecture
set-up should include IP ranges for your subnets etc. pre-planned for better
management. (We will see how to create a newEngineering
VPC in Networking section of the
tutorial.
Subnetting should also be pre-planned. E.g.: If it's a web server you should place
it in the public subnet and if it's a DB server, you should place it in a private
subnet all inside your VPC.
Below,
Here I have selected an already existing VPC where I want to launch my instance.
84
Step 4) In this step,
CGC COLLEGE OF Engineering College
A VPC consists of subnets,Department ofthatComputer
which are IP ranges Science
are separated for restricting&
access.
Below, Engineering
1. Under Subnets, you can choose the subnet where you want to place your instance.
2. I have chosen an already existing public subnet.
3. You can also create a new subnet in this step.
Once your instance is launched in a public subnet, AWS will assign a dynamic
85
public IP to it from their pool of IPs.
CGC COLLEGE OF Engineering College
Step 5) In this step, Department of Computer Science &
You can choose if you want AWS to assign it Engineering
an IP automatically, or you want to
do it manually later. You can enable/ disable 'Auto assign Public IP' feature here
likewise.
Here we are going to assign this instance a static IP called as EIP (Elastic IP)
later. So we keep this feature disabled as of now.
86
Step 6) In this step,
CGC COLLEGE OF Engineering College
In the following step, keep Department of 'None'
the option of IAM role Computer
as of now. Science
We will visit&
the topic of IAM role in detail in IAM services.
Engineering
Shutdown Behavior – when you accidently shut down your instance, you surely
don't want it to be deleted but stopped.
Here we are defining my shutdown behavior as Stop.
87
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
In case, you have accidently terminated your instance, AWS has a layer of
security mechanism. It will not delete your instance if you have enabled
accidental termination protection.
Here we are checking the option for further protecting our instance from
accidental termination.
88
Step 9) In this step,
CGC COLLEGE OF Engineering College
Under Monitoring- you can Department
enable Detailed of Computer
Monitoring Science
if your instance is a&
business critical instance. Here we have kept the option unchecked. AWS will
Engineering
always provide Basic monitoring on your instance free of cost. We will visit the
topic of monitoring in AWS Cloud Watch part of the tutorial.
Under Tenancy- select the option if shared tenancy. If your application is a highly
secure application, then you should go for dedicated capacity. AWS provides both
options.
Click on 'Add Storage' to add data volumes to your instance in next step.
89
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Add Storage
In the Add Storage step, you'll see that the instance has been automatically
provisioned a General Purpose SSD root volume of 8GB. ( Maximum volume
size we can give to a General Purpose volume is 16GB)
You can change your volume size, add new volumes, change the volume type,
etc.
AWS provides 3 types of EBS volumes- Magnetic, General Purpose SSD,
Provisioned IOPs. You can choose a volume type based on your application's
90
IOPs needs.
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Tag Instance
you can tag your instance with a key-value pair. This gives visibility to the AWS
account administrator when there are lot number of instances.
The instances should be tagged based on their department, environment like
Dev/SIT/Prod. Etc. this gives a clear view of the costing on the instances under
one common tag.
91
2. Go to configure Security Groups later
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Review Instances
93
Step 1) In this step, we will review all our choices and parameters and go ahead to launch
our instance. CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Step 2) In the next step you will be asked to create a key pair to login to you an instance.
A key pair is a set of public-private keys.
AWS stores the private key in the instance, and you are asked to download the private
key. Make sure you download the key and keep it safe and secured; if it is lost you cannot
download it again.
94
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
When you download your key, you can open and have a look at your RSA private
key.
95
Step 3) Once you are done downloading and saving your key, launch your instance.
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
96
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Click on the 'Instances' option on the left pane where you can see the status of the
instance as 'Pending' for a brief while.
Once your instance is up and running, you can see its status as 'Running' now.
97
Note that the instance has received a Private IP from the pool of AWS.
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
An EIP is a static public IP provided by AWS. It stands for Elastic IP. Normally when
you create an instance, it will receive a public IP from the AWS's pool automatically. If
you stop/reboot your instance, this public IP will change- it'dynamic. In order for your
application to have a static IP from where you can connect via public networks, you can
use an EIP.
Step 1) On the left pane of EC2 Dashboard, you can go to 'Elastic IPs' as shown below.
98
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
99
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Your request will succeed if you don't have 5 or more than 5 EIPs already in your
account.
100
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
101
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Step 6) Come back to your instances screen, you'll see that your instance has received
your EIP.
Step 7) Now open putty from your programs list and add your same EIP in there as
below.
102
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
1. Go to Auth
2. Add your private key in .ppk (putty private key) format. You will need to convert
pem file from AWS to ppk using puttygen
103
Once done click on "Open" button
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Once you connect, you will successfully see the Linux prompt.
Please note that the machine you are connecting from should be enabled on the
instance Security Group for SSH (like in the steps above).
Once you become familiar with the above steps for launching the instance, it becomes a
matter of 2 minutes to launch the same!
You can now use your on-demand EC2 server for your applications.
104
A spot Instance is an offering from AWS; it allows an AWS business subscriber to bid on
unused AWS compute capacity. CGC COLLEGE
The hourly OF
price for a Spot Engineering
instance College
is decided by AWS,
Department
and it fluctuates depending on the supply and demand forofSpot
Computer
instances. Science &
Your Spot instance runs whenever your bid exceeds Engineering
the current market price. The price
of a spot instance varies based on the instance type and the Availability Zone in which
the instance can be provisioned.
When your bid price exceeds the market spot price of the instance called as the ‘spot
price,' your instance stays running. When the spot price overshoots the bid price, AWS
will terminate your instance automatically. Therefore, it is necessary to plan the spot
instances in your application architecture carefully.
In order to launch a spot instance, you have to first create a Spot Request.
1. On the EC2 Dashboard select 'Spot Requests' from the left pane under Instances.
2. Click on the button 'Request Spot Instances" as shown below.
Spot instance launch wizard will open up. You can now go ahead with selecting the
parameters and the instance configuration.
Step 1) Select an AMI- an AMI is a template consisting of the OS platform and software
to be installed in the instance. Select your desired AMI from the existing list. We are
selecting Amazon Linux AMI for this tutorial.
Step 2) Capacity Unit- a Capacity Unit is your application requirement. You may decide
to launch an instance based on the instance type, vCPU or custom configuration like your
choice of vCPU/memory/storage requirements. Here we are selecting an Instance.
106
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
If you wish to customize the capacity, you can add your choice of
1. vCPU,
2. Memory and
3. Instance storage as below.
Step 3) Target Capacity depicts how many spot instances you wish to maintain in your
request. Here we are selecting one.
107
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Step 4) Bid Price – this is the maximum price we are ready to pay for the instance. We
are going to set a particular price per instance/hour. This is the simplest to calculate based
on our business requirement. We will see ahead how we should determine the bid price
so that our bid price always remains high and doesn't exceed the spot price so that our
instance keeps running.
just below the bid price you can see a button of Pricing History. Click on that as shown
below.
108
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Here in Pricing History, we can see a graph depicting instance pricing trends with
historical data. You can select the parameters and get an idea of the pricing of our desired
instance over a period of time.
Thus, from the chart below, we can see that the instance type that we are planning to
provision lies in the pricing range of $0.01xx, and it seems that Availability Zone 'us-east
1a' has the lowest price.
109
cont. to step 4.
CGC COLLEGE OF Engineering College
Department
So let's come back to our step of quoting a bid price. of Computer Science &
Engineering
For the sake of maintaining our instance always available and if it falls within our budget,
we can quote a higher bid price. Here we have quoted a slightly higher price of $0.05.
110
can further lower the price and save costs drastically.
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Step 5) Once we are done looking at the trends and quoting our bid price, click on next.
111
Our next step is to configure the instance, in this step of the wizard, we'll configure
instance parameters like VPC,CGC
subnets, COLLEGE
etc. OF Engineering College
Department of Computer Science &
Let's take a look.
Engineering
Step 1) Allocation Strategy – it determines how your spot request is fulfilled from the
AWS's spot pools. There are two types of strategies:
Diversified – here, spot instances are balanced across all the spot pools
Lowest price – here, spot instances are launched from the pool which has lowest
price offers
For this tutorial, we'll select Lowest Price as our allocation strategy.
Step 2) Select the VPC- we'll select from the list of available VPCs that we have created
earlier. We can also create a new VPC in this step.
112
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Step 3) Next we'll select the security group for the instance. We can select an already
existing SG or create a new one.
Step 4) Availability Zone- we'll select the AZ where we want to place our instance based
113
on our application architecture. We are selecting AZ- us-east-1a.
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
Step 5) Subnets- we are going to select the subnet from our list of already available list.
Step 6) Public IP- we'll choose to assign the instance a public IP as soon as it launches. In
114
this step, you can choose if you want AWS to assign it an IP automatically, or you want
to do it manually later. You CGC COLLEGE
can enable/ OF Engineering
disable 'Auto assign College
Public IP' feature here
likewise. Department of Computer Science &
Engineering
AWS stores the private key in the instance, and you are asked to download the private
key. Make sure you download the key and keep it safe and secured; if it is lost you
cannot download it again.
After selecting public IP, here we are selecting a key which we already have created in
our last tutorial.
115
Once we are done configuring our spot instance request in the 2 steps earlier in our
wizard, we'll take a look at theCGC COLLEGE OF Engineering College
overall configuration.
Department of Computer Science &
Engineering
1. We can also download a JSON file with all the configurations. Below is our
JSON file.
116
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
After we are done reviewing, we can proceed with the launching by clicking the Launch
button as shown below.
117
Once we select Launch, we can see a notification about the request getting created.
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
The spot request creation wizard will close, and the page will automatically direct back to
the EC2 Dashboard.
You can see as shown below that the State of our request is 'open' which means that it is
getting evaluated from the AWS's side. AWS EC2 will check if the required instance is
available in its spot pool.
118
After a couple of minutes, you can see that the state is changed to 'active', and now our
CGCYouCOLLEGE
spot request is successfully fulfilled. OF Engineering
can note the configuration parameters below.College
Department of Computer Science &
Engineering
Summary:
Thus, we saw in detail how to create an on-demand EC2 instance in this tutorial. Because
it is an on-demand server, you can keep it running when in use and 'Stop' it when it's
unused to save on your costs.
You can provision a Linux or Windows EC2 instance or from any of the available AMIs
in AWS Marketplace based on your choice of OS platform.
If your application is in production and you have to use it for years to come, you should
consider provisioning a reserved instance to drastically save on your CAPEX.
Here, we saw how to create a Spot Instance request successfully by determining our bid
119
price.
CGC COLLEGE OF Engineering College
Spot instances are a great way to Department of Computer
save on costs for instances which are notScience
application&
critical. A common example would be to create a fleet of spot instances for a task such as
Engineering
image processing or video encoding. In such cases, you can keep a cluster of instances
under a load balancer.
If the bid price exceeds the spot price and your instance is terminated from AWS's side,
you can have other instances doing the processing job for you. You can leverage Auto
scaling for this scenario. Avoid using Spot instances for business critical applications like
databases etc.
120
Lab Plan
CGC COLLEGE OF Engineering College
Department of Computer Science Lab 1 &
Install VirtualBox/VMware Workstation on different OS.
Engineering
Install different operating systems in Virtual Box. Lab2
services
121
COURSE OBJECTIVES
1.
CGC COLLEGE OF Engineering College
To study the basics of cloud computing.
2. To study the key conceptsDepartment
of virtualizationof Computer Science
&
3. To know about Different Cloud Computing Engineering
services
4. To implement different Cloud seniors and programming in cloudsim.
5. To study the key components of Amazon Web Services
122
COURSE OUTCOMES CGC COLLEGE OF Engineering College
Department of Computer Science &
1. Define Cloud Computing and memorize the different Cloud
service and deployment models
Engineering
2. Describe importance of virtualization along with their
technologies.
3. Use and Examine different cloud computing services
4. Analyze the components of open stack & Google Cloud platform
and understand Mobile Cloud Computing
5. Describe the key components of Amazon web Service
6. Design & develop backup strategies for cloud data based on
features
123
Method of Evaluation
CGC COLLEGE OF Engineering College
Department of Computer Science &
Course Name: Cloud Computing Lab
CodeCode: BTCS613-18 Engineering
Internal = 30
External = 20
Total = 50
124
Time Table
1 2CGC COLLEGE
3 4 OF 5Engineering
6 College
7
9:00-9:50
10:00- Department
11:00- of Computer
12:00- 13:00- Science
14:00- 15:00-&
10:50 11:50 12:50 13:50 14:50 15:50
Engineering
Mo
Tu
We
Th
Fr
125
List of students
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
126
Viva Questions
CGC COLLEGE OF Engineering College
Question Bank Department of Computer Science &
on cloud Computing
1) What are the advantages of using cloud computing?
Engineering
Ans:-The advantages of using cloud computing are
Data backup and storage of data
Powerful server capabilities
SaaS ( Software as a service)
Information technology sandboxing capabilities
Increase in productivity
Cost effective & Time saving
2) Mention platforms which are used for large scale cloud computing?
Ans:- The platforms that are used for large scale cloud computing are
Apache Hadoop
MapReduce
127
7) What are the security aspects provided with cloud?
Identity management: ItCGC COLLEGE
authorizes OF Engineering College
the application services
Access control: permission has Department
to be provided to of
the Computer
users so that theyScience
can control &
the access of another user who is entering into the cloud environment.
Authentication and Authorization: Allows onlyEngineering
the authorized and authenticated
user only to access the data and applications
13) Before going for cloud computing platform what are the essential things to be taken
in concern by users?
128
Compliance
Loss of data
Data storage CGC COLLEGE OF Engineering College
Business continuity Department of Computer Science &
Uptime
Data integrity in cloud computing Engineering
14) Mention some open source cloud computing platform databases?
Ans:- The open source cloud computing platform databases are
MongoDB
CouchDB
LucidDB
15) What are the security laws which are implemented to secure data in a cloud ?
Ans:- The security laws which are implemented to secure data in cloud are
Processing: Control the data that is being processed correctly and completely in
an application
File: It manages and control the data being manipulated in any of the file
Output reconciliation: It controls the data which has to be reconciled from input
to output
Input Validation: Control the input data
Security and Backup: It provides security and backup it also controls the security
breaches logs
16) Mention the name of some large cloud providers and databases?
Google bigtable
Amazon simpleDB
Cloud based SQL
18) Explain what are the different modes of software as a service (SaaS)?
Simple multi-tenancy : In this each user has independent resources and are
different from other users, it is an efficient mode.
Fine grain multi-tenancy: In this type, the resources can be shared by many but
the functionality remains the same.
129
19) What is the use of API’s in cloud services?
Ans:- API’s ( Application Programming Interface) is very useful in cloud platforms
It eliminates the need toCGC
write theCOLLEGE OF Engineering College
fully fledged programs
It provides the instructionsDepartment of Computer
to make communication between oneScience
or more &
applications
It allows easy creation of applications and link Engineering
the cloud services with other
systems
20) What are the different data centers deployed for cloud computing?
Ans:- Cloud computing consists of different datacenters like
Containerized Datacenters
Low Density Datacenters
25) As a infrastructure as a service what are the resources that are provided by it?
Ans:- IAAS ( Infrastructure As A Service) provides virtual and physical resources that
are used to build a cloud. It deals with the complexities of deploying and maintaining of
130
the services provided by this layer. Here the infrastructure is the servers, storage and
other hardware systems.
CGC COLLEGE OF Engineering College
Department
26) What are the business benefits involved of Computer Science &
in cloud architecture?
Ans:- The benefits involved in cloud architecture is
Zero infrastructure investment Engineering
Just in time infrastructure
More efficient resource utilization
27) What are the characteristics of cloud architecture that separates it from traditional
one?
Ans:- The characteristics that makes cloud architecture above traditional architecture is
According to the demand cloud architecture provides the hardware requirement
Cloud architecture is capable of scaling the resource on demand
Cloud architecture is capable of managing and handling dynamic workloads
without failure
28) Mention what is the difference between elasticity and scalability in cloud computing?
Ans:- Scalability is a characteristics of cloud computing through which increasing
workload can be handled by increasing in proportion the amount of resource capacity.
Whereas, elasticity, is being one of the characteristics that highlights the concept of
commissioning and decommissioning of a large amount of resource capacity.
29) Mention the services that are provided by Window Azure Operating System?
Ans:- Window Azure provides three core services which are given as
Compute
Storage
Management
30) In cloud architecture what are the different components that are required?
Cloud Ingress
Processor Speed
Cloud storage services
Cloud provided services
Intra-cloud communications
34) Mention in what ways cloud architecture provide automation and performance
transparency?
Ans:- To provide the performance transparency and automation there are many tools used
by cloud architecture. It allows to manage the cloud architecture and monitor reports. It
also allows them to share the application using the cloud architecture. Automation is the
key component of cloud architecture which helps to improve the degree of quality.
Web Role
Worker Role
VM Role
Web Role – A web role is basically used to deploy a website, using languages
supported by the IIS platform like, PHP, .NET etc. It is configured and
customized to run web applications.
Worker Role – A worker role is more like an help to the Web role, it used to
execute background processes unlike the Web Role which is used to deploy the
website.
133
VM Role – The VM role is used by a user to schedule tasks and other windows
services. This role can be used to customize the machines on which the web and
worker role is running. CGC COLLEGE OF Engineering College
Department of Computer Science &
43) What is a cloud service role?
Ans: A cloud service role is comprised of application Engineering
files and a configuration. A cloud
service can have two types of roles.
134
50) What is a cloud service component?
Ans: Three components are required in order to deploy an application as a cloud service
in Azure: CGC COLLEGE OF Engineering College
Department of Computer Science &
Q51) What is deployment environments?
Ans: Azure offers two deployment environments Engineering
for cloud services: a staging
environment in which you can test your deployment before you promote it to the
production environment. The two environments are distinguished only by the virtual IP
addresses (VIPs) by which the cloud service is accessed. In the staging environment, the
cloud service’s globally unique identifier (GUID) identifies it in URLs
(GUID.cloudapp.net). In the production environment, the URL is based on the friendlier
DNS prefix assigned to the cloud service (for example, myservice.cloudapp.net).
135
58) What is Cloud Computing?
Ans: Cloud computing is the use of computing resources (hardware and software) that
are delivered as a service over aCGC
networkCOLLEGE OF Engineering College
(typically the Internet).
Department of Computer Science &
59) What are the Service Model in Cloud Computing?
Ans: Cloud computing providers offer their servicesEngineering
according to three fundamental
models: Infrastructure as a service (IaaS), platform as a service (PaaS), and software as a
service (SaaS) where IaaS is the most basic and each higher model abstracts from the
details of the lower models.
Examples of IaaS include Amazon CloudFormation (and underlying services such as
Amazon EC2), Rackspace Cloud, Terremark, Windows Azure Virtual Machines, Google
Compute Engine. and Joyent.
Examples of PaaS include Amazon Elastic Beanstalk, Cloud Foundry, Heroku,
Force.com, EngineYard, Mendix, Google App Engine, Windows Azure Compute, and
OrangeScape.
Examples of SaaS include Google Apps, Microsoft Office 365, and Onlive. Source from.
136
63) What is Azure Active Directory and how it is used?
Ans. Microsoft offers Azure active directory, a fully managed multi-tenant service that
implements identity and accessCGC COLLEGE
capabilities for applicationsOF Engineering
running in Azure as wellCollege
as
Department of Computer Science &
applications operating in the on-premises environment. It is used for providing single
sign-on and multi-factor authentication to help users from protecting attacks.
64) What is an Availability Set? Engineering
Ans. Availability Set is a logical grouping capability majorly employed for separating
VM sources from each other when they are deployed. They are used for building reliable
cloud solutions. The VMs placed in the Availability set are run across various physical
servers, storage units, compute racks, and network switches in Azure. If any failure
occurs, only VMs subset is affected, and the overall solution stays operational.
66) Name the web application types that can be deployed with the Azure?
Ans. The web applications that can be deployed with the Azure are ASP.Net, PHP, and
WCF.
137
of your applications always remains working when the Azure platform is under periodic
maintenance.
CGC COLLEGE OF Engineering College
Department
70) What is the difference between Azure of Computer
Service Bus Queues Science &
and Storage Queues?
Ans. Two types of queue mechanisms are supported by Azure: Storage queues and
Service Bus queues. Engineering
Storage queues: These are the part of the Azure storage infrastructure, features a simple
REST-based GET/PUT/PEEK interface. Provides persistent and reliable messaging
within and between services.
Service Bus queues: These are the part of a broader Azure messaging infrastructure that
helps to queue as well as publish/subscribe, and more advanced integration patterns.
73). Explain the types of services you can build with the Service Fabric.
Ans. Majorly, two types of services you can build on Service Fabric:
Stateless Services - No state is stored in the service. The longer-term state is stored in
an external database. This is the typical application/data layer approach to build
services.
Stateful Services - The state is stored in the service. Allows the state to persist
without the need for an external database.
77) What are the three main components of the Windows Azure Platform?
Ans: Compute, Storage and AppFabric.
Microsoft Azure Advanced Interview Questions
80) How many instances of a Role should be deployed to satisfy Azure SLA (service
level agreement)? And what’s the benefit of Azure SLA?
Ans: TWO. And if we do so, the role would have external connectivity at least 99.95% of
the time.
139
List of Internal marks
CGC COLLEGE OF Engineering College
Department of Computer Science &
Engineering
140