Cloud Computing Lab-Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Lab 1: Install Virtual Machine and configuring linux on it(Type 2 virtualization).

Theory

Virtualization can increase IT agility, flexibility and scalability while creating significant cost savings.
Greater workload mobility, increased performance and availability of resources, and automated operations
– they’re all benefits of virtualization that make IT simpler to manage and less costly to own and operate.

Procedure

Steps to install and configure VMWare:

1. Download VMWare workstation trial version setup file from here and make sure the latest
version is being downloaded and installed.

2. Install VMWare on your machine. Setup is simple and requires to click Next button couple of
times.

3. After installation open VMWare workstation by using either start menu or shortcut created on
the desktop.

4. Click on ―Create a New Virtual Machine‖.

5. With default ―Typical‖ selected click on Next button.

6. Specify the path of the operating system set up file.

7. In the Next step you need to specify a Key or a serial number of operating system. If you are
using trial version then that part can be

skipped.

8. Enter the name for the virtual machine and specify a path to the directory where you want to
create your virtual machine. It is recommended that the drive you‘re selecting to install virtual
machine should have sufficient space.

9. Specify an amount of disk space you want to allocate for a virtual machine. Allocate disk space
according to the size of software you are going to install on the virtual machine.
10. On the next screen it will show configuration you selected for a virtual machine.

11. It will allocate Hardware according to the default settings but you can change it by using
Customize Hardware button in the above screen. You can specify what amount of RAM, a
processor has to be allocated for a virtual machine. Do not allocate complete RAM or complete
Processor for a virtual machine. Also, do not allocate very less RAM or processor. Leave
default settings or allocate in such way that your application should be able to run on the virtual
machine. Else it will result in a slow virtual machine.

12. Click on the Finish button to create the virtual machine at the specified location and with
specified resources.

Conclusion

Cloud computing provides measured service to the users and that can be achieved by using virtualization.
VMWare- a popular application that can be used to configure virtual machines in the same computer and
make them work as separate entities, which is foundational to the very concept of cloud computing.
Lab 2: Run a Simple C Program and Java Program in Virtual Machine using Type2 Virtualization.

Theory

As the VMWare can be installed and utilized as an entirely separate computing unit, different programs can
be run on the virtual machine as if it was a real computer. In this lab, a simple program in C and java
program is executed in the Guest OS of the virtual machine thus solidifying the usability of virtual machine.

Procedure for C

1. Create a .C extension file and write program

2. Install gcc compiler

3. sudo apt-get install libncurses5-dev libncursesw5-dev for curses.h


(use curses.h instead of conio.h)

4. Compile the c program using gcc pathtofile -o filename

5. Execute ./filename

Procedure for Java

6. Create a .java extension file and write program

7. Install java using sudo apt install openjdk-8-jdk

8. export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/ and source the .bashrc

9. Compile the java program using javac filename.java

10. Execute using java filename

Conclusion

Therefore, using VMWare, separate programs can be executed in them making it possible for
multiple devices to be allocated for different users in cloud computing where these users can have
their own workspace.
LAB 3:. Implement MultiThread programming using java.

Program:

class MultithreadingDemo extends Thread {

public void run()

try {

// Displaying the thread that is running

System.out.println(

"Thread " + Thread.currentThread().getId()

+ " is running");

catch (Exception e) {

// Throwing an exception

System.out.println("Exception is caught");

// Main Class

public class Multithread {

public static void main(String[] args)


{

int n = 8; // Number of threads

for (int i = 0; i < n; i++) {

MultithreadingDemo object

= new MultithreadingDemo();

object.start();

—---------------------------------------------------------------------------------------

class MultithreadingDemo implements Runnable {

public void run()

try {

// Displaying the thread that is running

System.out.println(

"Thread " + Thread.currentThread().getId()

+ " is running");

catch (Exception e) {

// Throwing an exception
System.out.println("Exception is caught");

// Main Class

class Multithread {

public static void main(String[] args)

int n = 8; // Number of threads

for (int i = 0; i < n; i++) {

Thread object

= new Thread(new MultithreadingDemo());

object.start();

}
Lab 5: Task Programming

public class TestTask {

public static void main(String[] args) {

Timer T=new Timer();

TimerTask birthday=new TimerTask() {

@Override

public void run() {

System.out.println("Happy Birthday!!!");

};

Calendar date=Calendar.getInstance();

date.set(2022,Calendar.AUGUST,17,0,0,0);

T.schedule(birthday,date.getTime());

}
Lab 6: Executing a Simple Legacy version python program in Google App Engine

Theory
Google App Engine (GAE) is a platform-as-a-service product that provides web app developers and
enterprises with access to Google's scalable hosting and tier 1 internet service.GAE requires that
applications be written in Java or Python, store data in Google Bigtable , and use the Google query language.
Noncompliant applications require modification to use GAE.GAE provides more infrastructure than other
scalable hosting services, such as Amazon Elastic Compute Cloud (EC2). GAE also eliminates some system
administration and development tasks to make writing scalable applications easier.
Procedure
1.Download cloud sdk from https://cloud.google.com/sdk/docs/install-sdk
2. Install the GoogleCloudSDKInstaller.exe
3. Make sure to tick on checkbox(if not by default) gcloud init after the installation
4. Create a app.yaml file for configuration and keep in app named folder:

runtime: python27
api_version: 1
threadsafe: false

Handlers:
- url: /
script: index.py
5. Put python code in index.py file in the same folder:
Print ‘test’
6. “gcloud init” in Google cloud sdk shell and make sure to login using google account
7. Also put in shell:
gcloud components install app-engine-python cloud-datastore-emulator

8. Put the following command in the shell:

py google-cloud-sdk\bin\dev_appserver.py E:\cloud\app
Conclusion

Google App Engine is an environment facilitated by Google and can be used to implement tenets of cloud
computing. It allows the development of simple to very complex applications in a cloud environment. Cloud
Computing is practiced by developers and big organizations who cannot afford to have any downtimes in
their existing services while coming up with new systems. So, using GAE’s cloud environment to develop
applications and collaborate is significant.

You might also like