0% found this document useful (0 votes)
41 views18 pages

Lab Manual

The lab manual outlines a course on Architecting Distributed Cloud Applications, focusing on creating virtual machines on Microsoft Azure and using Docker for containerization. It includes objectives, outcomes, a list of experiments, and detailed steps for deploying Azure VMs and installing Docker on Ubuntu. The evaluation scheme and resources for further learning are also provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views18 pages

Lab Manual

The lab manual outlines a course on Architecting Distributed Cloud Applications, focusing on creating virtual machines on Microsoft Azure and using Docker for containerization. It includes objectives, outcomes, a list of experiments, and detailed steps for deploying Azure VMs and installing Docker on Ubuntu. The evaluation scheme and resources for further learning are also provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

LAB MANUAL

Architecting Distributed Cloud Application Lab

Dr.Rajni Mohana
COURSE CODE: 19B1WCI675
COURSE CREDITS: 1
CORE/ELECTIVE: ELECTIVE
L-T-P: 0-0-2
Pre-requisite: Cloud Computing, Basic Networking

Course Objectives:

1. Learn to create a VM on the Microsoft Azure cloud.


2. Create Docker and install container on the docker.
3. Learn to run a network, communication, and storage services for cloud applications on
containers.

Course Outcomes:

Level of
S No Course Outcomes
Attainment
Install Docker and container. Deploy virtual machine on Microsoft
CO1 Familiarity
Azure.
CO2 Create sample microservice on cloud container Usage
CO3 Perform messaging service on cloud containers Usage
CO4 Learn about storage service on cloud containers Usage

List of Experiments

S No Description Hours
Deploy a Microsoft Azure Virtual Machine using free account.
1 4
Create an account on Visual Studio Team Services (VSTS).
2 Install Docker on Ubuntu Machine. 4
3 Create a container image and run the container 4
4 Build a Sample Application with Microservices 4
5 Message Communication of Distributed Cloud Applications 4
6 Storage Services for Distributed Cloud Applications 4
7 Small Project using cloud application services 4
Total Lab hours 28

Suggested/Resources:
This course is designed based on famous course provided by Microsoft. Links to courses and
content are as follows:
 https://courses.edx.org/courses/course-v1:Microsoft+DEVOPS200.9x+3T2019/course/
 https://azure.microsoft.com/en-in/blog/architecting-distributed-cloud-applications-free-
video-course/

https://www.youtube.com/watch?v=xJMbkZvuVO0&list=PL9XzOCngAkqs0Q8ZRdafn
SYExKQurZrBY

Evaluation Scheme:
S No Exam Coverage/Scope of Examination Marks
1 Mid Term Test Viva and Written Exam 20
2 End Term Test Viva and Written Exam 20
3 Lab Records 15
Teacher Assessment (Quality and quantity of experiment performed,
4 30
learning laboratory skills)
Attendance and
5 9+6=15
Participation in lab
6 Total 100

Course Outcomes (COs) contribution to the Programme Outcomes (POs)

CO/PO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 Average
CO1 3 3 2 1 1 1 1 1 1 1 1 1 1.4
CO2 3 3 3 2 2 1 1 1 1 1 3 1 1.8
CO3 3 3 3 2 2 2 1 1 1 1 3 1 1.9
CO4 3 3 3 2 2 1 1 1 1 1 3 1 1.8
Average 3 3 2.8 1.8 1.8 1.3 1 1 1 1 2.5 1 1.8
Lab 1 & 2 Deploy a Microsoft Azure Virtual Machine using free account.
Create an account on Visual Studio Team Services (VSTS).

Steps to Create Azure Virtual Machine

Now, you have a basic impression of the considerations before the creation of VM in Azure. So,
let us proceed towards the basic steps for deploying a virtual machine in Azure.

Step 1: Starting the Process of Setting up Azure VM

 The first thing you need to do is log into the Azure management portal
through www.portal.azure.com. You should have an active Azure subscription to use
the portal. Do not worry if you do not have a subscription! You can sign up for a free
trial account.
 After logging in, you have to click on “New” in the “Navigation” section. Then you
need to click on “Marketplace” followed by “Compute”.

Step 2: Select the Server Image for VM

Now, you will find the “Virtual Machines Marketplace” tab. This is the place where you find
various VM configurations and pre-configured images. The images for the Azure virtual
machine in this tab have official images from Microsoft, Microsoft partners, and ISVs. The
images are suitable for Windows-based deployments. Also, you can find images from select
partners such as Canonical or Red Hat.

 Select one of the images from the various options. Let us assume we create an Azure
virtual machine with Windows Server 2016 image. After selecting the image, you can
preview the information related to Windows Server 2016 image.
 Now, you have to select the type of deployment model needed for the Windows
Server 2016 image. The recommended deployment model is the “Resource Manager.”
So, choose the option of “Resource Manager” in the “Select a deployment model”
data field.
 Once you have selected the “Resource Manager” option, you can click on “Create.”
This would start the process of creating the Azure virtual machine.
Now the basic steps for deploying a virtual machine in Azure have been covered. The next
section of steps would deal with the configuration of basic settings for the Azure VM.

Step 3: Create a Virtual Machine

After completing the steps mentioned above, you would land upon the “Create Virtual Machine”
tab. Here, you would find four distinct tabs on the left side of the screen. They are “Basics,”
“Size,” “Settings,” and “Summary.” Let us proceed with the description of each field and the
best practices for their configuration.

Basics

The first configuration in the “Create Virtual Machine” tab is “Basics.” You have to provide
important details about the azure virtual machine you want to create. The details can be
presented as follows:

 The name of the virtual machine.


 The virtual machine disk type.
 User name of the administrator.
 Password for the administrator user.
 The Azure subscription that you want to use.
 Resource group for availing a logical container for Azure resources. You can find two
options in this field, such as “Create new” and “Use existing.” This field is essential
for effective management of resources on your Azure VM.
 The final entry in the configuration of basic settings is the location of the Azure
region. This is where the virtual machine would be placed.
After filling up all the fields mentioned above, you can click on “OK.” This would take you to
the next tab in “Create Virtual Machine,” i.e., “Size.”

 Size
The “Size” tab would help you configure the Azure virtual machine size. You would find the
different VM size options according to your basic configurations. It is important to keep in mind
that you cannot find all VM sizes in all Azure regions. When a particular VM size is not
available in a region, the size option would be disabled.
In this section, you can find the description of several vCPU for the VM and minimum memory.
Most important of all, you can also find the estimated monthly costs for the VM size. Once you
have reviewed all the options and selected the right one, click on “Select.”

 Settings
Once the VM size is selected, you can proceed to the next tab of “Settings.” In this tab, you will
get the chance to configure settings for storage, availability, monitoring, and networking. So, let
us find out how to configure these individual settings in the Azure management portal.

 Availability Set
The concern of availability is important when you create VM in azure. In the “Settings” tab, you
will find an option for choosing “Availability Set.” You can select the availability set on an
optional basis. This can help you identify the availability set for placing the VM. However, keep
in mind that this configuration cannot be changed after creation of the VM.

 Storage
The next element in “Settings” for your Azure virtual machine is “Storage.” In this section, you
have to choose the storage medium for the OS disk in the new virtual machine. You can find two
options here. One is “Managed Disks,” and the other is “Storage Account.” “Managed Disks”
feature helps in storage account management that simplified disk management on IaaS virtual
machines.

If you do not choose “Managed Disks,” then you have the option for selecting “Storage
Account.” With the “Storage Account” option, you can choose the Azure storage account for
placing the OS disk. You can choose a new storage account or select an existing one according to
your preferences.

 Network
The “Network” settings for azure virtual machine come next. Here you have to choose the
“Virtual Network” type, “Subnet,” “Public IP Address,” and “Network Security Group.” In the
“Virtual Network” part, you can choose an existing VNET or create a new one. Then, select the
subnet in which you want to place the virtual machine. The subnet refers to the range of IP
addresses from the VNET.

Now, you have to choose the “Public IP Address.” Here you can create a new public IP address
or else choose “None” for obtaining a publicly accessible IP address for the virtual machine. You
also have to select the “Networking Security Group” option. In this option, you will configure
inbound and outbound firewall rules for controlling traffic. The default Network Security Group
for Windows is Remote Desktop Protocol (RDP) and SSH in Linux.

 Monitoring
The penultimate step in configuring your azure virtual machine relates to “Monitoring” option in
the “Settings” tab. You can find three options in monitoring configurations. They are “Boot
Diagnostics,” “Guest OS Diagnostics,” and “Diagnostics Storage Account.” In the “Boot
Diagnostics” option, you can view the console output and take screenshots for the Azure VM.

The “Guest OS Diagnostics” option helps in enabling or disabling Guest OS Diagnostic metrics
for VM. This feature helps in the creation of alerts and stay updated on the applications. The
final aspect of the monitoring tab is “Diagnostics Storage Account.” Here, you can choose an
existing Azure storage account or create a new one where the diagnostic metrics will be written.

After you are done with the configuration of “Settings,” you can click “OK” to proceed.

Step 4: Summary and Final Deployment

The final section in “Create Virtual Machine” is “Summary.” This appears after completing the
basic configuration for your azure VM. The “Summary” would give you a basic impression of
the virtual machine that will be created. The offer details, pricing, and terms of use are
highlighted in this section.

If you want to create the VM, then accept the Terms of use and then click on “Create.” That’s it,
the deployment process starts. However, you need to keep in mind that the VM may take several
minutes for full provisioning and ready to use. You can find the status on the notification panel.

Conclusion

On a concluding note, the process for creating an Azure virtual machine is quite easy. The
discussion presented above reflected on various details of setting up an Azure VM. The
significance of Azure VM and the essential considerations for creating one are major highlights
of this discussion. They helped in clarifying the basics surrounding the creation of an Azure VM.
Lab 3&4 Install Docker on Ubuntu Machine.

Docker is an increasingly popular software package that creates a container for application
development.

Developing in Docker speeds up applications, as it shares the kernel and other resources, instead
of requiring dedicated server resources.

There are two versions of Docker – Docker CE (Community Edition) and Docker EE (Enterprise
Edition). If you have a small-scale project, or you’re just learning, you will want to use Docker
CE.

Prerequisites

 Ubuntu 18.04 64-bit operating system


 A user account with sudo privileges
 Command-line/terminal (CTRL-ALT-T or Applications menu > Accessories >
Terminal)
 Docker software repositories (optional)

Option 1: Install Docker on Ubuntu Using Default Repositories


Step 1: Update Software Repositories

It’s a good idea to update the local database of software to make sure you’ve got access to the
latest revisions.

Open a terminal window and type:

sudo apt-get update

Allow the operation to complete.

Step 2: Uninstall Old Versions of Docker

Next, it’s recommended to uninstall any old Docker software before proceeding.

Use the command:


sudo apt-get remove docker docker-engine docker.io

Step 3: Install Docker on Ubuntu 18.04

To install Docker on Ubuntu, in the terminal window enter the command:

sudo apt install docker.io

Step 4: Start and Automate Docker

The Docker service needs to be setup to run at startup. To do so, type in each command followed
by enter:

sudo systemctl start docker


sudo systemctl enable docker

Step 5 (Optional): Check Docker Version

To verify the installed Docker version number, enter:

docker --version

Option 2: Install Docker from Official Repository


Step 1: Update Local Database
Update the local database with the command:

sudo apt-get update

Step 2: Download Dependencies

You’ll need to run these commands to allow your operating system to access the Docker
repositories over HTTPS.

In the terminal window, type:

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

To clarify, here’s a brief breakdown of each command:

 apt-transport-https: Allows the package manager to transfer files and data over https
 ca-certificates: Allows the system (and web browser) to check security certificates
 curl: This is a tool for transferring data
 software-properties-common: Adds scripts for managing software

Step 3: Add Docker’s GPG Key

The GPG key is a security feature.

To ensure that the software you’re installing is authentic, enter:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

Step 4: Install the Docker Repository

To install the Docker repository, enter the command:


sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs) stable"

The command “$(lsb_release –cs)” scans and returns the codename of your Ubuntu installation
– in this case, Bionic. Also, the final word of the command – stable– is the type of Docker
release.

A stable release is tested and confirmed to work, but updates are released less frequently. You
may substitute edge if you’d like more frequent updates, at the cost of potential instability. There
are other repositories, but they are riskier – more info can be found on the Docker web page.
Step 5: Update Repositories

Update the repositories you just added:

sudo apt-get update

Step 6: Install Latest Version of Docker

To install the latest version of docker:

sudo apt-get install docker-ce

Step 7 (Optional): Install Specific Version of Docker

List the available versions of Docker by entering the following in a terminal window:
apt-cache madison docker-ce

The system should return a list of available versions as in the image above.

At this point, type the command:

sudo apt-get install docker-ce=[version]

However, substitute [version] for the version you want to install (pulled from the list you just
generated).

For example:
Option 3: Install Docker from a .deb Package

You can also install Docker manually by downloading the Docker .deb file.

1. First, navigate to the Docker download page.

2. Next, click on the pool link, then stable, then amd64. This is the location of the stable
Docker releases for Ubuntu 18.04.

3. Click on the Docker engine you want to install and the .deb package downloads automatically.
Make a note of the path where you saved it.

4. To install Docker, run the following command (using the path of the downloaded Docker
package):

sudo dpkg -i /path/to/docker.package.deb

Allow the installer to run.

Option 4: Install Docker from a Convenience Script

For installing edge or testing versions of Docker, you can use convenience scripts.

This method should not be used in production environments or if you already have another
version of Docker installed on your system.

Make sure to inspect the scripts before downloading and running them on your system.

Install Docker Engine – Community

To install the latest Docker engine, use the get.docker.com script by running the command:

curl -fsSL https://get.docker.com -o get-docker.sh

Run the script to start the installation:


sh get-docker.sh

The Docker service will start automatically.

Install Docker Testing Version

To install the latest testing version of Docker, use the test.docker.com script:

curl -fsSL https://test.docker.com -o test-docker.sh

Start the installation by running the command:

sh test-docker.sh

Lab 5& 6. Create a container image and run the container

1 Step 1: Create a Base Container

2. S t e p 2 : I n s p e c t I m a g e s

3 Step 3: Inspect Containers

Step 4: Start the Container

Step 5: Modify the Running Container

Step 6: Create an Image From a Container

Step 7: Tag the Image


Step 8: Create Images With Tags

Step 9: Delete the Original Container

Step 10: Look at Running Containers

Step 11: Consider Your Options

Lab 7& 8 Build a Sample Application with Microservices

Step 1: Creating a Test Database Server - in Docker

Step 2: Creating a Microservice in Node.js


Step 3: Dockerising our Microservice
Step 4: Integration Testing the Environment
Reference : https://dwmkerr.com/learn-docker-by-building-a-microservice/
Lab 9 & 10 Message Communication of Distributed Cloud Applications

1 a. When you click here, the AWS Management Console will open in a new browser window,
so you can keep this step-by-step guide open. When the screen loads, enter your user name and
password to get started. Then type queue in the search bar and select Simple Queue Service to
open the console

b. If the SQS console landing page appears, as shown on by the screenshot, click Get Started
Now. If you don't see this page, skip to the next step.

2. Create an AWS SQS queue


In this step, you will create and configure an Amazon SQS queue. A queue is a reliable, highly-
scalable buffer that stores messages as they travel between distributed applications or
microservices. Queues help to decouple applications, connect microservices, batch tasks, or store
notifications.

Our use case for this tutorial will simulate the storage of incoming orders from an e-commerce
application.

a. First, we will create a simple queue that stores orders that are placed on the store.
Enter Orders in the Queue Name field.
b. For this tutorial, we do not require strict ordering, so we won’t make any changes to the queue
type. Leave Standard Queue selected.

c. You can configure your queue to modify settings such as retention period, maximum message
size and delivery delays. For this tutorial, we will keep the default parameters. Choose Quick-
Create Queue.

d. Your new queue is created and selected in the queue list.

3 Send Messages to the queue

Once you have created your queue, it is ready to receive messages from the online store that
capture the details of each new order.

a. Your queue is already selected in the list. From Queue Actions, select Send a Message.
The Send a Message to Orders dialog box is displayed.
b. The Send a Message to Orders dialog box is displayed. On the Message Body tab, enter the
following text to represent a sample order:

c. Select the Message Attributes tab to add some optional metadata about this message for easy
processing. Let’s add an order type to the order. Enter Order-Type in the Name field, String in
the Type field, and Online in the Value field. Click Add Attribute.
d. To send the message immediately, click Send Message. Confirmation that your message was
sent is displayed in the Send a Message to Orders dialog box. Click Close.
4 Retrieve and delete messages
After you send a message to a queue, another application can consume it from the queue and do
something with it. In this example, you will simply retrieve the message to view the order, and
then delete it.

a. Ensure that your Orders queue is selected in the queue list. Next, from Queue Actions,
select View/Delete Messages.
b. The View/Delete Messages in Orders dialog box is displayed. When you request a message
from a queue, you don't specify request a specific message. Instead, you specify the maximum
number of messages (up to 10) that you want to retrieve.
Click Start Polling for messages to retrieve messages from the queue.
c. Once a consumer has received and processed a message, it can be deleted from the queue.
Select the message that you want to delete and then choose Delete 1 Message.
d. The Delete Messages dialog box is displayed. Check the box next to the message and
click Yes, Delete Checked Messages. The selected message is deleted. Choose Close.

You might also like