0% found this document useful (0 votes)
2 views

Cloud Service Management

The document is a laboratory record for the CCS366 Cloud Service Management course at Misrimal Navajee Munoth Jain Engineering College. It outlines the college's vision and mission, provides a certificate of bonafide work, and includes an index of experiments conducted in the lab, detailing procedures, source codes, and results for various cloud-related tasks. The experiments include creating cloud organizations, cost models, usage alerts, and billing alerts using AWS and other cloud services.

Uploaded by

Derlin
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)
2 views

Cloud Service Management

The document is a laboratory record for the CCS366 Cloud Service Management course at Misrimal Navajee Munoth Jain Engineering College. It outlines the college's vision and mission, provides a certificate of bonafide work, and includes an index of experiments conducted in the lab, detailing procedures, source codes, and results for various cloud-related tasks. The experiments include creating cloud organizations, cost models, usage alerts, and billing alerts using AWS and other cloud services.

Uploaded by

Derlin
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/ 21

MISRIMAL NAVAJEE MUNOTH JAIN

ENGINEERING COLLEGE
OWNED AND MANAGED BY TAMILNADU EDUCATIONAL AND MEDICAL TRUST

THORAPAKKAM , CHENNAI - 600 097.

LABORATORY RECORD

SUBJECT : CCS366 CLOUD SERVICE MANAGEMENT


NAME : ……………………………………………

CLASS : ……………………………………………

REGISTER NUMBER : ………………………………………........

1
COLLEGE

VISION :

• To produce high quality, creative and ethical engineers and technologists


contributing effectively for the ever-advancing Information Technology
field.

MISSION :

• To educate the future software engineers with strong fundamentals by


continuously improving the teaching learning methodologies using
contemporary aids.
• To create a knowledge hub of Information technology with everlasting
urge to learn by developing, maintaining and continuously improving the
resources/technology.
• To produce ethical engineers / researchers by instilling the values of
humility, humaneness, honesty and courage to serve the society.

DEPARTMENT : INFORMATION TECHNOLOGY

2
MISRIMAL NAVAJEE MUNOTH JAIN
ENGINEERING COLLEGE
OWNED AND MANAGED BY TAMILNADU EDUCATIONAL AND MEDICAL TRUST
THORAPAKKAM , CHENNAI - 600 097.

NAME : ………………………………………… CLASS : …………………………….

REGISTER NO. : ………………………………………… BRANCH : …………………………..

Certificate that this is a bonafide record of the work done by the above student in
the CCS366 CLOUD SERVICE MANAGEMENT Laboratory during the
year 2025.

Signature Of the Faculty-In-Charge Signature of Head of Dept.

Submitted For the Practical Examination Held On ……………………………

External Examiner Internal Examiner

Date:

3
INDEX
S.No. DATE NAME OF THE EXPERIMENT PAGE SIGNATURE
Create a Cloud Organization in
AWS/Google Cloud/or any
01. 21/02/25 equivalent Open-Source cloud 06-08
software’s like OpenStack,
Eucalyptus, Open Nebula with
Role-based access control.

Create a Cost-model for a web


02. 07/03/25 application using various services 09-11
and do Cost-benefit analysis.

Create alerts for usage of Cloud 12-14


03. 28/03/25 resources.

Create Billing alerts for your Cloud


04. 11/04/25 Organization. 15-17

Compare Cloud cost for a simple


05. 02/05/25 web application across AWS, Azure 18-21
and GCP and suggest the best one.

4
CCS366

CLOUD SERVICE MANAGEMENT LABORATORY

5
Ex. No. 01 CREATE A CLOUD ORGANIZATION IN
AWS/GOOGLE CLOUD/OR ANY EQUIVALENT
OPEN-SOURCE CLOUD SOFTWARE’S LIKE
DATE: 2 1 / 0 2 / 2 5 OPENSTACK, EUCALYPTUS, OPEN NEBULA WITH
ROLE-BASED ACCESS CONTROL

AIM:

To create a Cloud Organization in AWS/Google Cloud/or any equivalent


Open-Source cloud software's like Open stack, Eucalyptus, Open Nebula with Role-
based access control.

PROCEDURE:

STEP 1: Creating a cloud organization with role-based access control involves setting
up a hierarchy of users, groups, and roles to manage permissions effectively.
STEP 2: One way to create a cloud organization with role-based access control in
AWS is done using AWS Identity and Access Management (IAM).
STEP 3: We can adapt the concepts to other cloud providers or open-source cloud
software with similar capabilities.

SOURCE CODE:

1. import boto3
2. # Initialize AWS IAM client
3. iam = boto3.client('iam')
4. # Define policies
5. policy_document = {
6. "Version": "2012-10-17",
7. "Statement": [{
8. "Effect": "Allow",
9. "Action": "s3:*",
10. "Resource": "*"
11. }]

6
12. }
13. # Create policies
14. s3_policy = iam.create_policy(
15. PolicyName='S3FullAccess',
16. PolicyDocument=str(policy_document)
17. )
18. # Create a group
19. group_response = iam.create_group(
20. GroupName='MyGroup'
21. )
22. # Attach policy to the group
23. iam.attach_group_policy(
24. GroupName='MyGroup',
25. PolicyArn=s3_policy['Policy']['Arn']
26. )
27. # Create a new IAM user
28. user_response = iam.create_user(
29. UserName='MyUser'
30. )
31. # Add the user to the group
32. iam.add_user_to_group(
33. GroupName='MyGroup',
34. UserName='MyUser'
35. )
36. print("Organization created successfully!")

7
OUTPUT:

RESULT:

Thus, we have created Cloud Organization in AWS/Google Cloud/or any


equivalent Open-Source cloud software's like Open stack, Eucalyptus, Open Nebula
with Role-based access control and executed and verified successfully.

8
Ex. No. 02
CREATE A COST-MODEL FOR A WEB
APPLICATION USING VARIOUS SERVICES AND DO
DATE: 0 7 / 0 3 / 2 5 COST-BENEFIT ANALYSIS

AIM:

To create a cost model for a web application using cloud services and perform
cost-benefit analysis

PROCEDURE:

STEP 1: Creating a cost model for a web application using cloud services involves
estimating the expenses associated with various components and services utilized in
the application.
STEP 2: Building a cost model for a typical web application using a combination of
AWS (Amazon Web Services) and Google Cloud Platform (GCP) services is
considered.
STEP 3: Specific pricing information may change over time, and we need to check the
respective cloud providers for up-to-date pricing.

SOURCE CODE:

1. # Define the cost of each service per hour in Indian


Rupees
2. service_costs_inr = {
3. "Compute": 3.75, # Cost per hour for a virtual
machine instance in INR
4. "Storage": 0.75, # Cost per GB per month for
storage in INR
5. "Database": 7.50, # Cost per hour for a managed
database instance in INR
6. # Add more services as needed

9
7. }
8. # Define the usage of each service
9. service_usage = {
10. "Compute": 1, # Number of virtual machine
instances
11. "Storage": 100, # Amount of storage in GB
12. "Database": 1, # Number of database
instances
13. # Add more services as needed
14. }
15. # Calculate the total cost of each service in
Indian Rupees
16. total_costs_inr = {service:
service_costs_inr[service] * service_usage[service]
for service in service_costs_inr}
17. # Calculate the total cost of all services
combined in Indian Rupees
18. total_cost_inr = sum(total_costs_inr.values())
19. # Perform cost-benefit analysis (e.g., compare
cost to potential revenue or savings)
20. # For simplicity, let's assume a fixed revenue
or savings value in INR
21. revenue_or_savings_inr = 75000 # Example
revenue or savings in Indian Rupees
22. # Determine if the cost is justified based on
the revenue or savings
23. if total_cost_inr <= revenue_or_savings_inr:
24. print("The cost of the services is justified.")
25. else:
26. print("The cost of the services exceeds the
potential revenue or savings.")

10
27. # Print the detailed cost breakdown in Indian
Rupees
28. print("Detailed cost breakdown (in Indian
Rupees):")
29. for service, cost_inr in
total_costs_inr.items():
30. print("{}: INR {:.2f}".format(service,
cost_inr))
31. print("Total Cost: INR
{:.2f}".format(total_cost_inr))

OUTPUT:

RESULT:

Thus, we have created a cost model for a web application using cloud services
and perform cost-benefit analysis which was executed and verified successfully.

11
Ex. No. 03
CREATE ALERTS FOR USAGE OF CLOUD
RESOURCES
DATE: 28/03/25

AIM:

To create alerts for usage of cloud resources.

PROCEDURE:

1. Define Metrics: Identify the key metrics you want to monitor for your cloud
resources, such as CPU utilization, memory usage, disk I/O, network traffic,
etc.
2. Set Thresholds: Determine threshold levels for each metric that indicate when
an alert should be triggered. For example, you might set a threshold of 90%
CPU utilization to trigger a CPU alert.
3. Monitor Metrics: Continuously monitor the selected metrics using monitoring
tools provided by the cloud platform or third-party monitoring services.
4. Check Thresholds: Regularly compare the current metric values to the
predefined thresholds.
5. Trigger Alerts: If any metric value exceeds its threshold, trigger an alert.
6. Notify Users: Send notifications to relevant stakeholders (e.g., system
administrators, DevOps team) via email, SMS, or other communication
channels, informing them of the alert and providing details about the resource
and the metric that triggered it.
7. Take Action: Depending on the severity of the alert and the established
procedures, take appropriate actions to address the issue. This could involve
scaling resources, reallocating resources, investigating the root cause of the
problem, or executing remediation scripts.
8. Resolve Alert: Once the issue has been addressed, mark the alert as resolved
and update any incident documentation or status boards.
9. Review Alerts: Periodically review alert history and patterns to identify
recurring issues, adjust thresholds if necessary, and optimize the alerting
system for better efficiency and accuracy.
10. Document Process: Document the alerting process, including the metrics
monitored, thresholds set, notification procedures, and response actions. Ensure
that all team members are familiar with the alerting process and know how to
respond to alerts effectively.

12
SOURCE CODE:

1. import boto3
2. def create_cloudwatch_alarm(instance_id, threshold,
evaluation_periods, email):
3. # Initialize the CloudWatch client
4. cloudwatch = boto3.client('cloudwatch')
5. # Define the alarm name
6. alarm_name =
"{}_CPU_Utilization_Alarm".format(instance_id)
7. # Create the alarm
8. response = cloudwatch.put_metric_alarm(
9. AlarmName=alarm_name,
10. ComparisonOperator='GreaterThanThreshold',
11. EvaluationPeriods=evaluation_periods,
12. MetricName='CPUUtilization',
13. Namespace='AWS/EC2',
14. Period=60, # 1 minute
15. Statistic='Average',
16. Threshold=threshold, # CPU threshold
(percentage)
17. ActionsEnabled=True,
18. AlarmActions=[
a. 'arn:aws:sns:us-east-1:123456789012:MyTopic' #
Replace with your SNS topic ARN
19. ],
20. AlarmDescription='Alarm when CPU exceeds {}% for
{} period(s)'.format(threshold, evaluation_periods),
21. Dimensions=[
a. {
b. 'Name': 'InstanceId',
c. 'Value': instance_id
d. },
22. ],
23. Unit='Percent'
24. )
25. print("CloudWatch alarm created successfully:",
response)
26. # Example usage
27. if name == " main ":
28. # Input parameters

13
29. instance_id = raw_input("Enter EC2 instance ID:
") # Use input() in Python 3.x
30. threshold = float(raw_input("Enter CPU
utilization threshold (percentage): ")) # Use
input() in Python 3.x
31. evaluation_periods = int(raw_input("Enter number
of evaluation periods: ")) # Use input() in Python
3.x
32. email = raw_input("Enter email address for
notification: ") # Use input() in Python 3.x
33. # Create CloudWatch alarm
34. create_cloudwatch_alarm(instance_id, threshold,
evaluation_periods, email)

OUTPUT:

RESULT:

Thus, we have created alerts for the usage of cloud resources which was
executed and verified successfully.

14
Ex. No. 04
CREATE BILLING ALERTS FOR YOUR CLOUD
ORGANIZATION
DATE: 11/04/25

AIM:

To Create billing alerts for a cloud organization with suitable algorithm, source
code, output, result.

PROCEDURE:

1. Identify Thresholds: Determine the spending thresholds at which you want to


receive alerts. These thresholds could be based on your budget, expected usage,
or any predefined limits.
2. Select Alert Mechanism: Choose the mechanism for generating alerts.
Common options include email notifications, SMS alerts, integration with chat
platforms (e.g., Slack), or using a dedicated billing alerting service provided by
your cloud provider.
3. Set Up Billing Alerts: Configure billing alerts using the billing management
console or APIs provided by your cloud provider. Specify the spending
thresholds and the alerting mechanism to be used.
4. Define Recipients: Specify the email addresses, phone numbers, or other
contact details for the recipients who should receive the alerts. Ensure that the
recipients are authorized to view and manage billing information for your cloud
organization.
5. Test Alerts: Test the billing alerting system to ensure that alerts are triggered
correctly and notifications are delivered to the designated recipients. Verify
that the thresholds are set up accurately and that alerts are triggered when
spending exceeds the specified limits.
6. Monitor Usage: Regularly monitor your cloud usage and spending to stay
informed about your organization's resource consumption and associated costs.
Review billing reports and dashboards provided by your cloud provider to track
spending trends and identify any unexpected or unusual usage patterns.
7. Adjust Thresholds: Periodically review and adjust the billing thresholds based
on changes in your organization's budget, resource requirements, or usage
patterns. Ensure that the thresholds are aligned with your organization's
financial goals and risk tolerance.
8. Document Process: Document the billing alerting process, including the

15
thresholds, alert mechanisms, recipients, and any relevant policies or
procedures. Ensure that all stakeholders are aware of the billing alerting system
and know how to respond to alerts effectively.

SOURCE CODE:

1. import boto3
2. def create_billing_alarm(threshold_amount,
email_address):
3. # Initialize the CloudWatch client
4. cloudwatch = boto3.client('cloudwatch')
5. # Define the alarm name
6. alarm_name = 'BillingAlarm'
7. # Create the alarm
8. response = cloudwatch.put_metric_alarm(
9. AlarmName=alarm_name,
10. ComparisonOperator='GreaterThanThreshold',
11. EvaluationPeriods=1,
12. MetricName='EstimatedCharges',
13. Namespace='AWS/Billing',
14. Period=86400, # 1 day (in seconds)
15. Statistic='Maximum',
16. Threshold=threshold_amount,
17. ActionsEnabled=True,
18. AlarmActions=[
19. 'arn:aws:sns:us-east-1:123456789012:MyTopic' #
Replace with your SNS topic ARN
20. ],
21. AlarmDescription='Alarm when estimated charges
exceed ${}'.format(threshold_amount),
22. Dimensions=[
23. {
24. 'Name': 'Currency',

16
25. 'Value': 'USD'
26. }
27. ],
28. Unit='None'
29. )
30. print("Billing alarm created successfully:",
response)
31. # Example usage
32. if name == " main ":
33. # Input parameters
34. threshold_amount = float(input("Enter billing
threshold amount (USD): "))
35. email_address = input("Enter email address for
notification: ")
36. # Create billing alarm
37. create_billing_alarm(threshold_amount,
email_address)

OUTPUT:

RESULT:

Thus, we have created billing alerts for a cloud organization which was
executed and verified successfully.

17
Ex. No. 05
COMPARE CLOUD COST FOR A SIMPLE WEB
APPLICATION ACROSS AWS, AZURE AND GCP
DATE: 0 2 / 0 5 / 2 5 AND SUGGEST THE BEST ONE

AIM:

To compare the cloud costs across different providers (AWS, Azure, and GCP)
for a simple web application.

PROCEDURE:

1. Identify Requirements: Define the basic requirements of your web


application, including compute resources, storage, and data transfer needs.
2. Research Pricing: Gather pricing information from AWS, Azure, and GCP for
the required resources, including virtual machines, storage, and data transfer.
3. Calculate Monthly Costs: Estimate the monthly costs for your web
application on each cloud platform based on the pricing information gathered.
Consider different usage scenarios (e.g., baseline, peak) and any potential
discounts or promotions.
4. Factor in Additional Services: Take into account any additional services or
features required for your web application, such as database services, content
delivery networks (CDNs), or monitoring tools, and compare the costs across
cloud providers.
5. Consider Support and SLAs: Evaluate the support options and service level
agreements (SLAs) offered by each cloud provider, as well as the associated
costs, and factor these into your cost comparison.
6. Assess Flexibility and Scalability: Consider the flexibility and scalability of
each cloud platform in terms of adjusting resources up or down based on
demand, and assess the potential impact on costs.
7. Account for Data Transfer Costs: Take into account any data transfer costs
between different regions or zones within each cloud provider's network, as
well as data transfer costs to and from the internet.
8. Evaluate Total Cost of Ownership (TCO): Compare the total cost of
ownership (TCO) for running your web application on each cloud platform,
including both direct costs (e.g., infrastructure, services) and indirect costs
(e.g., management, maintenance).
9. Assess Vendor Lock-in: Evaluate the potential for vendor lock-in with each
cloud provider and consider the implications for future migration or

18
interoperability with other services or platforms.
10. Make a Decision: Based on the cost comparison, as well as other factors such
as performance, reliability, and ease of use, make an informed decision about
the best cloud provider for your simple web application.

SOURCE CODE:

1. # AWS Pricing
2. aws_vm_cost_per_hour = 0.05 # Cost per hour for a
t2.micro instance (example)
3. aws_storage_cost_per_gb_month = 0.1 # Cost per GB
per month for storage (example)
4. aws_data_transfer_cost_per_gb = 0.12 # Cost per GB
for data transfer (example)
5. # Azure Pricing
6. azure_vm_cost_per_hour = 0.06 # Cost per hour for a
Standard_B1s instance (example)
7. azure_storage_cost_per_gb_month = 0.11 # Cost per GB
per month for storage (example)
8. azure_data_transfer_cost_per_gb = 0.10 # Cost per GB
for data transfer (example)
9. # GCP Pricing
10. gcp_vm_cost_per_hour = 0.0475 # Cost per hour
for a e2-medium instance (example)
11. gcp_storage_cost_per_gb_month = 0.09 # Cost per
GB per month for storage (example)
12. gcp_data_transfer_cost_per_gb = 0.11 # Cost per
GB for data transfer (example)
13. # Web application requirements
14. num_instances = 2 # Number of instances
required
15. storage_gb = 100 # Storage required in GB
16. data_transfer_gb = 1000 # Data transfer
required in GB
17. # Calculate costs for AWS
18. aws_vm_cost_monthly = aws_vm_cost_per_hour * 24
* 30 * num_instances
19. aws_storage_cost_monthly =
aws_storage_cost_per_gb_month * storage_gb

19
20. aws_data_transfer_cost_monthly =
aws_data_transfer_cost_per_gb * data_transfer_gb
21. aws_total_cost_monthly = aws_vm_cost_monthly +
aws_storage_cost_monthly
aws_data_transfer_cost_monthly
22. # Calculate costs for Azure
23. azure_vm_cost_monthly = azure_vm_cost_per_hour *
24 * 30 * num_instances
24. azure_storage_cost_monthly =
azure_storage_cost_per_gb_month * storage_gb
25. azure_data_transfer_cost_monthly =
azure_data_transfer_cost_per_gb * data_transfer_gb
26. azure_total_cost_monthly = azure_vm_cost_monthly
+ azure_storage_cost_monthly +
azure_data_transfer_cost_monthly
27. # Calculate costs for GCP
28. gcp_vm_cost_monthly = gcp_vm_cost_per_hour * 24
* 30 * num_instances
29. gcp_storage_cost_monthly =
gcp_storage_cost_per_gb_month * storage_gb
30. gcp_data_transfer_cost_monthly =
gcp_data_transfer_cost_per_gb * data_transfer_gb
31. gcp_total_cost_monthly = gcp_vm_cost_monthly +
gcp_storage_cost_monthly +
gcp_data_transfer_cost_monthly
32. # Print costs for each cloud platform
33. print("AWS Monthly Cost: $",
aws_total_cost_monthly)
34. print("Azure Monthly Cost: $",
azure_total_cost_monthly)
35. print("GCP Monthly Cost: $",
gcp_total_cost_monthly)
36. # Compare costs and suggest the best option
37. min_cost = min(aws_total_cost_monthly,
azure_total_cost_monthly, gcp_total_cost_monthly)
38. if min_cost == aws_total_cost_monthly:
39. print("AWS is the most cost-effective option.")
40. elif min_cost == azure_total_cost_monthly:
41. print("Azure is the most cost-effective
option.")
42. else:

20
43. print("GCP is the most cost-effective option.")

OUTPUT:

RESULT:

Thus, we have compared the cloud costs across different providers (AWS,
Azure, and GCP) for a simple web application which was executed and verified
successfully.

21

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy