HCIA-Cloud Service V3.0 Lab Guide
HCIA-Cloud Service V3.0 Lab Guide
HCIA-Cloud Service V3.0 Lab Guide
HCIA-Cloud Service
Version: 3.0
1
Copyright © Huawei Technologies Co., Ltd. 2021. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any
means without prior written consent of Huawei Technologies Co., Ltd.
Notice
The purchased products, services and features are stipulated by the contract made
between Huawei and the customer. All or part of the products, services and features
described in this document may not be within the purchase scope or the usage
scope. Unless otherwise specified in the contract, all statements, information, and
recommendations in this document are provided "AS IS" without warranties,
guarantees or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort
has been made in the preparation of this document to ensure accuracy of the
contents, but all statements, information, and recommendations in this document
do not constitute a warranty of any kind, express or implied.
Overview
This document is intended for those who are preparing for the HCIA-Cloud Service exam
or those who want to learn about how to use, manage, and maintain cloud services.
Description
This document includes exercises on HUAWEI CLOUD operations, exercises on compute,
networking, storage, and O&M services, and comprehensive exercises. These exercises can
help you understand the functions and positions of the cloud services.
Exercise 1: Exercises on HUAWEI CLOUD operations. The exercises include registering
a HUAWEI CLOUD account, logging in to the console, configuring IAM, as well as
purchasing, trying, and releasing cloud services.
Exercise 2: Exercises on compute services including Elastic Cloud Server (ECS), Image
Management Service (IMS), and Auto Scaling (AS). The exercises involve ECS
lifecycle management, image management, and auto scaling.
Exercise 3: Exercises on network services, including enabling communication between
ECSs in the same Virtual Private Cloud (VPC), using security groups, Elastic IP (EIP),
Virtual Private Network (VPN), and using Elastic Load Balance (ELB) to distribute
traffic among backend servers.
Exercise 4: Exercises on storage services, including using and managing Elastic
Volume Service (EVS), Object Storage Service (OBS), and Scalable File Service (SFS).
Exercise 5: Exercises on O&M services, including using Cloud Trace Service (CTS) to
track operations, using the Cloud Eye to monitor cloud services, and using Log Tank
Service (LTS) to search for logs.
Exercise 6: Exercises on using ECS and RDS as service nodes and data nodes, using
VPC to provide network resources for ECS, using AS to dynamically add and remove
ECS instances to ensure stable running, using ELB to automatically distribute traffic
among backend servers to achieve greater levels of fault tolerance in your
applications, and using Cloud Eye to monitor cloud services.
Knowledge Required
To better understand this certification course, familiarize yourself with the following
knowledge:
Basic IT knowledge
Servers and commonly used operating systems (Windows and Linux)
Fundamentals about storage and network
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 4
Lab Environment
All exercises will be performed on the HUAWEI CLOUD official website. The cloud service
is under fast iterative development, so some screenshots in this document might be
different from those on the official website.
You can visit the Help Center to learn more about using the cloud services.
All basic security services are configured by default for all exercises.
The following table lists the resources required for the exercises and the estimated costs in
the AP-Singapore region. The actual costs may vary, depending on your use of the cloud
services.
x86 | General
computing |
s6.large.2 | 2
vCPUs | 4 GB,
ECS 1 High I/O | 40 GB 0.13/h 12 1.56
| Windows
Server 2012 R2
Standard 64-bit
English (40 GB)
x86 | General
computing |
s6.small.1 | 1
vCPU | 1 GB,
High I/O | 40
Exercises GB, Dynamic
on BGP | Exclusive | 20.28
compute ECS 1 Billed by 0.04/h 12 0.48
services bandwidth | 1
Mbit/s,
Windows |
Windows Server
2012 R2
Standard 64-bit
English
AS 1 N/A Free 12 0
x86 | General
computing |
s6.large.2 | 2
vCPUs | 4 GB,
ECS 2 High I/O | 40 GB 0.13/h 12 3.12
| Windows
Server 2012 R2
Standard 64-bit
English (40 GB)
x86 | General
computing |
s6.large.2 | 2
ECS 1 0.07/h 12 0.84
Exercises vCPUs | 4 GB,
on High IO | 40 GB
networking | CentOS 64-bit
services
Dedicated |
Dynamic BGP |
EIP 2 Billed by 0.03/h 12 0.72
bandwidth | 1
Mbit/s
Public network |
ELB 1 Dynamic BGP, 1 0.03/h 12 0.36
Mbit/s
x86 | General
computing |
s6.large.2 | 2
Exercises vCPUs | 4 GB;
on storage ECS 1 High I/O | 40 GB 0.13/h 12 1.56
services | Windows
Server 2012 R2
Standard 64-bit
English (40 GB)
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 6
x86 | General
computing |
s6.large.2 | 2
ECS 1 0.07/h 12 0.84
vCPUs | 4 GB,
High IO | 40 GB
| CentOS 64-bit
IAM 1 N/A 12
Exercises Cloud
1 N/A 12
on O&M Eye Free 0
services LTS 1 N/A 12
CTS 1 N/A 12
Dedicated |
Dynamic BGP |
EIP 2 Billed by 0.03/h 12 0.72
bandwidth | 1
Comprehen Mbit/s
-sive
RDS for MySQL
exercise
| 8.0 |
Active/standby |
General-
RDS 1 0.36/h 12 4.32
enhanced II 1
vCPU | 2 GB,
Ultra-high I/O |
40 GB
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 7
x86 | General
computing |
s6.small.1 | 1
vCPU | 1 GB,
High I/O | 40
GB, Dynamic
ECS 3 0.07/h 12 2.52
BGP | Dedicated
| Billed by
bandwidth | 5
Mbit/s, CentOS |
CentOS 7.6 64-
bit
AS 1 N/A Free 12 0
Public network |
ELB 1 Dynamic BGP, 5 0.15/h 12 1.80
Mbit/s
Contents
6.4 Setting Up the Linux, Apache, MySQL, PHP (LAMP) Environment .................................................................. 202
6.4.1 Installing LAMP................................................................................................................................................................. 202
6.4.2 Creating a Database for WordPress .......................................................................................................................... 208
6.4.3 Installing WordPress ....................................................................................................................................................... 210
6.5 Achieving High Availability for Web Servers ............................................................................................................. 213
6.5.1 Creating a Shared Load Balancer .............................................................................................................................. 214
6.5.2 Creating an Image ........................................................................................................................................................... 217
6.5.3 Configuring AS .................................................................................................................................................................. 219
6.6 Visiting the Website............................................................................................................................................................ 224
6.7 Monitoring Resources ........................................................................................................................................................ 225
6.8 Deleting Resources ............................................................................................................................................................. 227
6.8.1 Deleting ECSs .................................................................................................................................................................... 227
6.8.2 Deleting the RDS DB Instance ..................................................................................................................................... 228
6.8.3 Deleting the Image ......................................................................................................................................................... 229
6.8.4 Deleting the Load Balancer .......................................................................................................................................... 229
6.8.5 Deleting AS Resources ................................................................................................................................................... 230
6.8.6 Deleting VPC Resources ................................................................................................................................................. 231
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 11
1.1 Introduction
1.1.1 About This Exercise
Register a HUAWEI CLOUD account, log in using the account, create an IAM user and user
group, and purchase and release cloud resources.
1.1.2 Objectives
Learn about HUAWEI CLOUD.
Learn how to register a HUAWEI CLOUD account.
Learn how to purchase and release HUAWEI CLOUD resources.
1.2 Tasks
1.2.1 Roadmap
Step 1 Visit HUAWEI CLOUD official website, and click Register in the upper right.
Step 5 Hover over your username in the upper right and choose Basic Information.
Step 7 Select a type that matches your account. Here, we'll select Individual
Authentication.
Step 9 Once complete, refresh the Real-Name Authentication page. The authentication is
successful, so let's proceed to the next exercise.
Step 1 Go to the management console, hover over your username in the upper right, and
choose Identity and Access Management from the drop-down list.
Step 2 Choose User Groups in the navigation pane, and click Create User Group.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 16
Step 4 Click Manage Permissions for the user group you created.
Step 6 Under Scope, click Region-specific projects, and select AP-Singapore. In the
Permissions section, search for IAM, select Tenant Guest and Tenant
Administrator, and click OK.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 17
Step 7 Go to the Users page, and click Create User in the upper right.
Step 9 Select the user group you created and click Create.
Step 10 View the results. The user is created when you see this page.
Step 11 Log out of the account and log in again as the IAM user.
Step 14 After login, click Console in the upper left. Your account is functioning normally if
you see the home page of the console as shown here.
Step 2 Log in with your HUAWEI CLOUD account, and choose Virtual Private Cloud in the
left pane.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 21
1.3 Exercises
1. Create a VPC with a custom name.
2. Create an IAM user with a custom name.
3. Create a user group with a custom name like group1.
4. Grant the user group read-only permissions for the Enterprise Project Management
(EPS) service.
5. Log in as the IAM user and check whether you can create a new VPC or modify the
existing one.
6. Log in using the HUAWEI CLOUD account, release the VPC, and delete the IAM user
and user group.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 24
2 Compute Services
2.1 Introduction
2.1.1 About This Exercise
Elastic Cloud Server (ECS) provides scalable, on-demand computing cloud servers for secure,
flexible, and efficient applications and ensures stable and interrupted running of services.
Image Management Service (IMS) enables full-lifecycle management for images,
templates used to create servers or disks, helping you quickly deploy services.
Auto Scaling (AS) automatically adjusts ECS instances based on your service requirements
and configured AS policies. You can configure a scheduled, periodic, or alarm policy to
adapt resources to the fluctuating service load, preventing unnecessary cloud service
charges and ensuring services run stably.
This exercise walks you through how to create and log in to ECSs, modify the ECS
specifications, create private Windows and Linux images, create sharable images, and scale
resources flexibly.
2.1.2 Objectives
Upon completion of this exercise, you will be able to use:
ECS
IMS
AS
2.2 Tasks
2.2.1 Roadmap
Create and log in to an ECS.
Modify ECS specifications.
Create a Windows system disk image from an ECS.
Create a Linux system disk image from an ECS.
Modify and share an image.
Create AS configurations, AS configuration groups, and AS policies.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 25
Step 2 Enter your username and password to log in, click Console, and choose the AP-
Singapore region.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 26
Step 5 Configure the VPC parameters as follows and click Create Now.
Region: AP-Singapore
Name: Enter a name.
Retain the default settings for other parameters.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 28
Step 6 Switch to Virtual Private Cloud page and view the created VPC.
Step 7 Click Service List on the left, and search for Data Encryption Workshop to
configure a key pair for the ECS.
Step 9 Click Create Key Pair, configure parameters, and click OK.
The key pair file is automatically downloaded to your local PC. The key pair file will be
used to obtain the password to log in to the ECS. Keep the file secure.
Step 10 Click Service List on the left and choose Compute > Elastic Cloud Server.
Step 13 Click Next: Configure Network. The Configure Network page is displayed.
Configure the parameters as follows:
Network: Choose the created VPC.
Extension NIC: Retain the default settings.
Security Group: Retain the default settings.
EIP: Not required
Step 14 Click Next: Configure Advanced Settings. The Configure Advanced Settings page
is displayed. Configure the parameters as follows:
ECS Name: ecs-windows (Change as required.)
Login Mode: Key pair
Key Pair: Choose the created key pair.
Cloud Backup and Recovery: Not required
ECS Group (Optional): Retain the default settings.
Advanced Options: Retain the default settings.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 32
Step 15 Click Next: Confirm. After confirming the ECS configurations, select I have read
and agree to the Service Level Agreement and Image Disclaimer, and click
Submit. After about 10 seconds, you can view the created ECS on the Elastic Cloud
Server page. If the Status is Running, the ECS can work normally.
Step 16 Create a Linux ECS. Configure the parameters the same as creating the Windows
ECS, except for ECS Name, Image, and Login Mode (choose Password).
Step 2 Locate the row containing ecs-windows, click More, and choose Get Password.
Step 3 Click Select File, choose the downloaded key pair file, and click Open.
Step 4 Click Get Password, copy the password, and close the window.
Step 5 Locate the row containing ecs-windows, click Remote Login, and click Log In.
If Press Ctrl+Alt+Delete to sign in is displayed, click Send CtrlAltDel in the upper part of
the remote login page.
Step 6 Click Input Commands in the upper right corner, paste the copied password, click
Send, and then press Enter.
Step 7 If a page similar to the one in following figure is displayed, the ECS login was
successful.
Step 8 In this exercise, there is no EIP bound to the Linux ECS. Therefore, you cannot use
remote login tools (SSH tool) to log in to the ECS. You can choose Remote Login in
the row containing ecs-linux, and click Log In to log in to the ECS using VNC.
Linux:
ecs-linux login: root
Password: Enter a password, for example, Huawei@123.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 36
Linux ECSs do not have a GUI. After you log in the Linux ECS remotely, enter root after
ecs-linux login, and then press Enter to input the password. The password is entered in
ciphertext. Ensure that the password is correct before pressing Enter. If Welcome to
Huawei Cloud Service is displayed, the ECS login was successful.
Step 9 If a page similar to the one in preceding figure is displayed, the Linux ECS login was
successful.
Step 2 If the ECS is not in the stopped state, select it and click Stop. If the Stop ECS page
is displayed, select Forcibly stop the preceding ECSs and click Yes.
Step 3 After the ECS has stopped, click More in the Operation column of this ECS and
choose Modify Specifications.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 37
Step 4 In the Modify Specifications dialog box, select the desired ECS type, vCPUs, and
memory size based on service requirements. In this exercise, the memory size is
changed from 4 GB to 8 GB. Click Next.
Step 5 After confirming the new ECS specifications, select I have read and agree to the
Image Disclaimer and click Submit. Go to the Elastic Cloud Server page and you
will see that the ECS status is Resized.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 38
Step 6 Start the ECS. The ECS specifications have been modified.
Step 7 You can also log in to the ECS to check the new specifications, as shown in the
following figure.
Step 2 Check whether DHCP is configured for the ECS NICs. If it is not, configure it.
1. Choose Start > Control Panel. (The GUI varies somewhat depending on the OS
version.)
4. Click Properties, select Internet Protocol Version 4 (TCP/IPv4), and click Properties.
Step 3 Click Start, right-click This PC, and choose Properties. In the navigation pane to
the left of the System page, click Remote settings. Select Allow remote
connections to this computer. Click OK. (The GUI varies somewhat depending on
the OS version.)
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 43
Step 4 Go to Start > Control Panel and navigate to Windows Firewall. In the left pane,
select Allow an app or feature through Windows Firewall. Select apps that are
allowed by Windows Firewall for Remote Desktop based on your network
requirements and click OK.
In this exercise, both the private and public networks are allowed by the firewall.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 44
Step 5 Check whether Cloudbase-Init is installed on the ECS. If it is not, install it.
Go to Start > Control Panel > Programs and Features to check whether Cloudbase-Init
has been installed on the ECS.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 45
Note:
If Cloudbase-Init is not installed on the ECS, custom information cannot be injected
into the new ECSs created from the private image. You will only be able to log in to
the ECSs with the password specified in the image.
For an ECS created from a public image, Cloudbase-Init has been installed on it by
default. You do not need to manually install Cloudbase-Init for it.
For an ECS created using an external image file, you need to install Cloudbase-Init
for the ECS before you use it to create a private image. For details, see Installing and
Configuring Cloudbase-Init.
In this exercise, the ECS is created from the public image windows2012 R2, which has
Cloudbase-Init installed by default.
Step 3 On the Create Image page, set the following parameters and click Next. (Retain
the defaults for the rest of the parameters.)
Region: AP-Singapore
Type: System disk image
Source: Select a Windows ECS, for example, ecs-windows.
Name: Enter a name, for example, image-windows2012.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 47
Step 4 Confirm the settings. Then, select I have read and agree to the Image Disclaimer
and click Submit.
Step 5 Switch back to the Private Images tab page to view the image status.
The time required for creating an image depends on the image size. Generally, it takes
about 10 to 20 minutes. When the image creation completes, its status changes to Normal.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 48
Step 2 You can modify the image name, memory, and other details.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 49
Step 2 Locate the row that contains the image to be replicated and in the Operation
column choose More > Replicate.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 50
Step 3 In the displayed Replicate Image dialog box, enter a new name for the image and
click OK. (Do not select KMS encryption.)
Step 1 On the Private Images tab page, select the private image to be shared and in the
Operation column choose More > Share.
Step 2 In the Share Image dialog box, enter the account name of the target user and click
Add. Click OK.
If the user is a DeC or multi-project user, you also need to enter their project name. To
share the image with multiple users, enter their account names (and project names).
Step 3 Log in to the management console using the account of the target user, go to the
IMS console, click the Images Shared with Me tab, and click Accept.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 52
Step 2 Click the name of the image to be shared. On the Shared with Tenants tab page,
click Add Tenant.
Figure 2-58 Adding tenants who can use the shared image
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 53
Step 3 In the Add Tenant dialog box, enter the account name (and project name if the
tenant is a DeC or multi-project user) and click Add.
Step 2 On the ECS purchase page, ensure that the private image is selected.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 54
Step 3 Go back to the ECS list to view the ECS created using the private image.
Step 2 Check whether DHCP is configured for the ECS NICs. If it is not, configure it.
Step 3 Check whether the one-click password reset plug-in has been installed on the ECS.
If it is not, install it.
Note: To ensure that you can reset the passwords of the new ECSs created from a private
image, you are advised to install the one-click password reset plug-in
(CloudResetPwdAgent) on the ECS used to create the image. For details, see Installing the
One-Click Password Reset Plug-In.
In this exercise, the ECS is created from a public image. Therefore, the one-click
password reset plug-in has been installed on it by default. You do not need to
manually install it. You can run the following command to check whether
CloudResetPwdAgent has been installed:
ls -lh /Cloud*
Note:
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 56
If Cloud-Init is not installed on the ECS, custom information cannot be injected into
the new ECSs created from the private image and you can only log in to the ECSs
with the password specified in the image.
For an ECS created from a public image, Cloud-Init has been installed on it by
default. You do not need to manually install Cloud-Init for it.
For an ECS created using an external image file, you need to install Cloud-Init for the
ECS before you use it to create a private image. For details, see Installing Cloud-Init
and Configuring Cloud-Init.
In this exercise, the ECS is created from the public image CentOS 7.6 64bit(40GB). Cloud-
Init has been installed on it by default. You can run the following command to check
whether Cloud-Init has been installed:
Note: To prevent NIC name drift on the new ECSs created from a private image, you need
to delete network rule files of the ECS used to create the image.
Run the following command to check if there is a network rule file on the ESC:
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 57
ls -l /etc/udev/rules.d
Note:
An ECS created from a public image does not have network rule files by default.
An ECS created using an external image file may have network rule files, delete the
files by following the instructions provided in Deleting Files from the Network Rule
Directory.
Step 3 Set the following parameters on the Create Image page and click Next.
Type: System disk image
Source: Select a Linux ECS, for example, ecs-linux.
Name: Enter a name, for example, image-centos7.6
Step 4 Confirm the settings. Then, select I have read and agree to the Image Disclaimer
and click Submit.
Step 5 Switch back to the Private Images tab page to view the image status.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 59
The time required for creating an image depends on the image size. Generally, it takes
about 10 to 20 minutes. When the image creation completes, its status changes to Normal.
2.2.5 AS Operations
AS automatically adjusts resources based on service demands and pre-configured AS
policies. In this section, we will use ECS ecs-windows as an example to describe how to
scale ECS and bandwidth resources with AS.
Step 3 Set the following parameters and retain the default settings for other parameters.
Region: AP-Singapore
Name: Use the default name as-config-822b.
Configuration Template: Select Use specifications of an existing ECS, and click
Select ECS. In the Select ECS dialog box, select an existing ECS. In this example, ecs-
windows is selected.
Step 2 Set the following parameters and retain the default settings for other parameters.
Then click Create Now
Region: AP-Singapore
AZ: Select all AZs, including AZ1, AZ2, and AZ3. AZs in the same region can
communicate with each other over an intranet.
Multi-AZ Expansion Policy: Load-balanced
Name: as-group-CB (Change it as needed.)
Max. Instances: 5
Expected Instances: 2
Min. Instances: 1
EIP: Release
Health Check Method: ECS health check
Health Check Interval: 5 minutes
Health Check Grace Period (s): 600
Tag: Not required
Step 7 In the Add AS Policy dialog box, configure the following parameters.
In this step, we will configure a policy to add one instance at specified time every day.
Policy Name: as-policy-test1
Policy Type: Periodic
Interval: One day
Triggered At: 18:00
Time Range: Retain the default settings.
Scaling Action: Add 1 instance
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 65
Step 10 In the Add AS Policy dialog box, configure the following parameters.
In this step, we will configure a policy to remove one instance at specified time every day.
Policy Name: as-policy-test2
Policy Type: Periodic
Interval: One day
Triggered At: 23:00
Time Range: Retain the default settings.
Scaling Action: Reduce 1 instances
Cooldown Period (s): 900
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 66
Step 11 To save time, click Execute Now to make the created policy as-policy-test1 take
effect immediately.
Step 12 After executing the AS policy, click the Instances tab to view how the number of
instances has changed in response to the periodic AS policy you configured.
The number of instances will change daily at the times configured for the two periodic
policies.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 67
Step 4 Wait for a short while and then return to the page that displays the bandwidth
scaling policy list.
Step 5 In the bandwidth scaling policy list, click the EIP (in blue) in the AS Resource
column of the created policy.
You can see that the bandwidth has been changed to 10 Mbit/s. It means that the
bandwidth scaling policy has taken effect.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 69
Step 5 Confirm that all the resources created in the experiment have been deleted. If they
have not, delete them.
2.3 Exercises
1. Create an AS group to scale Linux ECS instances.
2. Set the expected number of instances to 3.
3. Add an alarm-based AS policy that removes one instance when the average memory
usage is lower than 30%, with a cooldown period of 5 minutes.
4. Observe the effectiveness of the AS policy. If the policy does not take effect, explain
the possible causes.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 70
3 Networking Services
3.1 Introduction
3.1.1 About This Exercise
A Virtual Private Cloud (VPC) is logically isolated, configurable, and manageable virtual
network for cloud servers, containers, and databases. It improves resource security and
simplifies network deployment on the cloud.
A security group provides access control for ECSs that have the same security requirements
within a given VPC. You can define inbound and outbound rules to control traffic to and
from the ECSs in a security group, making your ECS more secure.
The Elastic IP (EIP) service enables your cloud resources to communicate with the Internet
using static public IP addresses and scalable bandwidths. EIPs can be bound to or unbound
from ECSs, BMSs, virtual IP addresses, load balancers, and NAT gateways.
Elastic Load Balance (ELB) automatically distributes incoming traffic across multiple
backend servers based on listening rules you configure. ELB expands the service capabilities
of your applications and improves their availability by eliminating single points of failure
(SPOFs).
A VPC peering connection is a network connection between two VPCs. ECSs in either VPC
can communicate with each other if they are in the same region. You can create a VPC
peering connection between your own VPCs, or between your VPC and a VPC of another
account within the same region. However, you cannot create a VPC peering connection
between VPCs in different regions.
A Virtual Private Network (VPN) establishes an encrypted, Internet-based communications
tunnel between your network and a VPC. With VPN, you can connect to a VPC and access
the resources deployed there.
In this exercise, we will verify that:
Two ECSs in a VPC can communicate with each other by default.
Security groups can be used to control communication between them.
ECSs can access the Internet after an EIP is bound to each of them.
ELB can distribute traffic across backend servers.
We will also create a VPC peering connection to enable ECSs in different VPCs in the same
region to communicate with each other, and create a VPN connection to enable ECSs in
different regions to communicate with each other.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 71
3.1.2 Objectives
Learn how to enable communication between different ECSs in a VPC.
Learn how to use security groups to control communication between ECSs.
Learn how to use EIP to allow an ECS to access the Internet.
Learn how to use ELB to distribute traffic across backend servers.
Learn how to use a VPC peering connection to enable ECSs in different VPCs in the
same region to communicate with each other.
Learn how to use a VPN connection to enable ECSs in different regions to
communicate with each other.
Exercises
3.2 Tasks
3.2.1 Roadmap
Create two VPCs in AP-Singapore, one VPC in AF-Johannesburg, and one VPC in
LA-Santiago.
Verify that security groups can control communication between ECSs in AP-
Singapore.
Verify that an ECS with an EIP bound can access the Internet in AP-Singapore.
Verify that ECSs in different VPCs in the same region (AP-Singapore) can
communicate with each other through a VPC peering connection.
Verify that ECSs in different regions (LA-Santiago and AF-Johannesburg) can
communicate with each other through a VPN connection.
Delete resources.
Exercises
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 72
Step 1 Log in to the management console and select the AP-Singapore region. Click
Service List. Under Networking, select Virtual Private Cloud.
Step 3 Configure the VPC parameters as follows and click Create Now.
Region: AP-Singapore
Name: VPC-S01
CIDR Block: Use the default CIDR block, for example, 192.168.0.0/16.
Subnet name: subnet-01 and subnet-02
Retain the default settings for other parameters.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 74
Step 5 Click Create VPC again and configure the VPC parameters as follows.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 75
Region: AP-Singapore
Name: VPC-S02
CIDR Block: Set a CIDR block different from that of VPC-S01, for example,
10.0.0.0/24.
Default subnet name: subnet-03
Retain the default settings for other parameters.
Step 7 Create VPC-J01 with subnet-01 in AF-Johannesburg and VPC-Sa01 with subnet-01
in LA-Santiago.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 76
Step 1 Select the AP-Singapore region, click Service List. Under Compute, select Elastic
Cloud Server.
Network configuration:
Network: VPC-S01
subnet-01
Security Group: Select the default security group.
EIP: Not required
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 78
Advanced settings:
ECS Name: ecs-S01
Login Mode: Password, for example, Huawei@123!
Cloud Backup and Recovery: Not required
Step 4 Repeat the preceding steps to create ecs-S02 in subnet-02, ecs-S03 in subnet-03,
ecs-J01 in subnet-01, and ecs-Sa01 in subnet-01. You can create a general
computing ECS with flavor c3.large.2, 2 vCPUs, and 4 GB of memory in the LA-
Santiago and AF-Johannesburg regions.
Step 2 Enter the username (root for a Linux ECS by default) and password to log in to ecs-
S02.
Step 3 Ping the private IP address of ecs-S01 from ecs-S02 to check whether these two
ECSs in the same VPC can communicate with each other. The ping is successful,
indicating that the two ECSs in a VPC can communicate with each other.
Step 4 Ping the private IP address of ecs-S03 from ecs-S02 to check whether these two
ECSs in different VPCs can communicate with each other. The ping fails, indicating
that two ECSs in different VPCs cannot communicate with each other.
Step 2 Click the security group name and delete all inbound security group rules on the
Inbound Rules tab page.
Step 3 Switch to the ECS console, remotely log in to ecs-S02, and ping the private IP
address of ecs-S01. The ping fails, indicating that the two ECSs cannot
communicate with each other.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 82
Step 4 Go back to the Inbound Rules tab page of the security group and click Allow
Common Ports.
Step 5 Switch to the ECS console, remotely log in to ecs-S02, and ping the private IP
address of ecs-S01. The ping is successful, so the two ECSs can communicate with
each other, indicating that the security group can be used to control
communication.
If you want to log in to the ECS with an EIP bound using a remote login tool, we
recommend you to use a key pair instead of a password for security. If you log in to the
ECS through the management console, you can still use a password. The following steps
describe how to use a key pair to log in to the ECS.
Step 2 Click Service List, search for Data Encryption Workshop, and click Data Encryption
Workshop to go to the DEW console.
Step 3 In the navigation pane on the left, choose Key Pair Service. On the ECS List tab
page, locate the row that contains ecs-S02 and click Bind in the Operation column.
Step 4 Select the target key pair, enter the password of user root for logging in to the ecs-
S02, and click OK.
Step 5 View the binding result on the ECS List tab page.
Step 6 Switch to the network console, choose EIPs, and click Buy EIP.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 85
Step 7 Configure the parameters as follows, click Next, confirm the parameters, and click
Submit.
Billing Mode: Pay-per-use
Region: AP-Singapore
EIP Type: Dynamic BGP
Billed By: Bandwidth
Bandwidth: 1 Mbit/s
Retain the default settings for other parameters.
Step 8 On the EIPs page, locate the newly purchased EIP, click Bind in the Operation
column, select ecs-S02, and click OK.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 86
Step 9 Install PuTTY and PuTTYgen on your local computer. Use PuTTYgen to convert the
key pair file format from .pem to .ppk, which is a required format of PuTTY.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 87
Step 10 Go to Conversions, and then click Import key to load the key pair file.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 88
Step 11 Click Save private key to save the key pair file in .ppk format to your local
computer.
Step 12 Open PuTTY, click Connection > Data in the left navigation pane, and set the
Auto-login username to root.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 89
Step 13 Click Connection > SSH > Auth in the left navigation pane, click the Browse…
button and select your private key file (.ppk file).
Step 14 Click Session in the left navigation pane, enter the EIP of ecs-S02 in Host Name
(or IP address), and click Open.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 90
Step 15 Run the ping baidu.com command to check whether ecs-S02 can access the
Internet. The ping is successful, indicating that ecs-S02 can access the Internet
through an EIP.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 91
Step 1 Remotely log in to ecs-S01 and ecs-S02 and enable port 8889, which is a default
port for HTTP communication.
curl 127.0.0.1:8889
Step 2 Use touch to create an empty file named SERVER1 on ecs-S01 and one called
SERVER2 on ecs-S02. Run the ls command to confirm the files are there.
touch SERVER1
touch SERVER2
Step 3 Log in to the management console. On the service list page, choose Networking >
Elastic Load Balance.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 93
Step 4 Click Buy Elastic Load Balancer and select Shared for Type.
Step 5 Configure the parameters and click Next. Confirm the configuration and click
Submit.
Type: Shared
Region: AP-Singapore
Network Type: Public network
VPC: vpc-S01
EIP: New EIP
EIP Type: Dynamic BGP
Billed By: Bandwidth
Bandwidth: 1 M/bits
Name: elb-name (Change it as needed.)
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 94
Step 6 Return to the load balancer list, locate the load balancer you just created, and click
Add listener.
Step 7 Add ecs-S01 and ecs-S02 to the backend server group and set the backend port to
8889.
The two ECSs, ecs-S01 and ecs-S02, are in different subnets (subnet-01 and subnet-02).
When you add them, each needs to be added separately. When you add ecs-S01, select
subnet-01. When you add ecs-S02, select subnet-02.
Step 8 Check the health check results for the two ECSs.
If the health check result is Unhealthy, security group rules may not have been configured
to allow traffic from and to the backend port or the health check configuration is incorrect.
Click Unhealthy and rectify the fault by following the instructions in the FAQ. The cause
here is that port 8889 is not enabled in the security group. Switch back to the Network
Console. In the left navigation pane, choose Access Control > Security Groups, locate the
security group that contains the two ECSs, and add security group rules.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 98
Step 9 Go back to the Backend Server Groups page, wait for 3 to 5 minutes and refresh
the page.
It takes about 3 to 5 minutes for the system to send heartbeat messages to backend servers
to check their health. If the listener has detected the heartbeat messages returned by the
backend servers, the health check result becomes Healthy.
Step 10 In the address box of the browser on your PC, enter http://Load balancer's EIP:8881
to check whether the ECSs can be accessed.
In the following figure, you can see the SERVER1 file we created earlier, indicating that
ecs-S01 is the one being accessed.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 99
This time SERVER2 is displayed, indicating that ecs-S02 is being accessed. As you continue
refreshing the browser, the different ECSs are accessed in turn, indicating that the load
balancer is balancing the load across the two ECSs.
You can see from this exercise how ELB automatically distributes incoming traffic across
multiple backend servers based on the listening rules you configure.
Step 1 On the VPC Console, choose VPC Peering and click Create VPC Peering
Connection.
Step 2 Configure the VPC peering connection parameters as follows and click OK. If the
parameters are correct, the status of VPC peering connection will be Accepted.
Name: peering-vivi (Change it as needed.)
Choose the local VPC and peer VPC in the same region. Ensure that the CIDR blocks
of the two VPCs do not overlap with each other.
Step 3 Click Add Route on the Information page or click the name of the VPC peering
connection and click Route Tables to add routes.
Step 4 In route table rtb-VPC-S01, click Add Route. Set Destination to the CIDR block of
VPC-S02, Next Hop Type to VPC peering connection, and Next Hop to Peering-vivi.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 102
Step 5 In route table rtb-VPC-S02, click Add Route. Set Destination to the CIDR block of
VPC-S01, Next Hop Type to VPC peering connection, and Next Hop to Peering-vivi.
Click OK.
Step 6 Switch to the ECS console, remotely log in to ecs-S01, and ping the private IP
address of ecs-S03 in VPC-S02. The ping is successful, indicating that ECSs from
different VPCs in the same region can communicate with each other over the VPC
peering connection.
Step 1 In the AF-Johannesburg region, access Network Console, choose Virtual Private
Network > VPN Gateways, and click Buy VPN Gateway.
Step 3 Switch to the LA-Santiago region, go to Network Console, choose Virtual Private
Network > VPN Gateways, and click Buy VPN Gateway.
Billing Mode: Pay-per-use
Region: LA-Santiago
Name: vpngw-Santiago
VPC: vpc-Sa01
Type: IPsec
Billed By: Bandwidth
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 106
Bandwidth (Mbit/s): 5
VPN connection
Name: vpn-Santiago
Local Subnet: Select subnet-01 of vpc-Sa01.
Remote Gateway: Enter an IP address and then replace it with the IP address of the
VPN gateway you created in the AF-Johannesburg region.
Remote Subnet: Enter subnet CIDR blocks of vpc-J01.
PSK: Enter the PSK you configured in the AF-Johannesburg region.
Advanced Settings: Default
Step 4 Go back to the Virtual Gateways page, locate vpngw-Santiago, and record
gateway IP address: 159.138.113.162. Switch to the AF-Johannesburg region. Go to
the VPN Connections page, locate VPN connection vpn-Johannesburg, and choose
More > Modify in the Operation column. On the Modify VPN Connection page,
enter 159.138.113.162 for Remote Gateway and click OK.
Step 5 On the Virtual Gateways page, locate vpn-Johannesburg, and record its IP
address: 159.138.161.172. Switch to the LA-Santiago region. Go to the VPN
Connections page, locate VPN connection vpn-Santiago, and choose More >
Modify in the Operation column. On the Modify VPN Connection page, enter
159.138.161.172 for Remote Gateway and click OK.
Step 6 Check the VPN connection status. The VPN connection status is Not connected.
Step 8 In the LA-Santiago region, remotely log in to ecs-Sa01 in vpc-Sa01 and ping ecs-
J01 in vpc-J01 in the AF-Johannesburg region. The result shows that ECSs in
different regions can communicate with each other.
Step 9 Go back to the VPN Connections page, and refresh the page to check whether
status of vpn-Santiago is Normal and whether status of vpn- Johannesburg is
Healthy.
This exercise proves that a VPN can enable communication between ECSs in different
regions.
Step 2 Remove the ECSs, delete the listener, and then delete the load balancer in the
corresponding region.
Step 4 Delete the VPN connection and gateways in the corresponding regions. If you
delete the VPN connection, the gateways will be automatically deleted.
3.3 Exercises
1. Create three ECSs in the same VPC, one as the client, and the other two as backend
servers to receive requests from the load balancer.
2. Use the client to access the private IP address of the load balancer.
If the web page can be accessed and the content changes after you refresh the web
page, the configuration was successful. (For details, see the procedure for using a
public network load balancer to route requests over the Internet.)
3. Delete the load balancer. If the load balancer cannot be deleted, locate the cause.
4. Verify a VPC peering connection.
After you create a VPC peering connection by following the instructions from earlier,
create a subnet in the local VPC with the same CIDR block as that of a subnet in the
peer VPC. Check network connectivity and explain what you find.
5. Test a VPN connection.
After you establish a VPN connection by following the instructions from earlier, modify
the pre-shared key of a VPN gateway and check network connectivity.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 111
4 Storage Services
4.1 EVS
4.1.1 Introduction
4.1.1.1 About This Exercise
EVS provides persistent block storage for ECSs and BMSs. With data redundancy and cache
acceleration techniques, EVS disks deliver high availability and durability as well as stable,
low latency. You can initialize EVS disks, create file systems on them, and store data
persistently on them. This exercise describes basic EVS operations, such as purchasing and
attaching EVS disks.
4.1.1.2 Objectives
Upon completion of this exercise, you will be able to:
Purchase EVS disks.
Attach EVS disks.
Initialize EVS disks on Windows and Linux servers.
Use EVS snapshots.
4.1.2 Tasks
4.1.2.1 Roadmap
EVS disks are usually used to increase user's storage space to meet their business needs.
You can buy EVS disks for use, or detach and delete them if they are no longer required.
This exercise introduces how to use an EVS disk in Windows and Linux.
EVS disks can be used as system disks or data disks for cloud servers. When a cloud
server is purchased, a system disk is automatically purchased and attached. You
cannot purchase a system disk separately.
Data disks can be purchased during or after the server purchase. If you add data
disks during the server purchase, the system will automatically attach the data disks
to the server. If you purchase data disks after the server has been purchased, you
need to manually attach the data disks.
In this exercise, we will buy two Windows ECSs ecs-vivi and ecs-test in the AP-
Singapore region, buy an EVS disk separately and attach it to ECS ecs-vivi, and
create a test file on the disk. Then, detach this disk and attach it to ECS ecs-test, and
log in to ECS ecs-test to check whether the test file exists.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 112
Step 2 Log in to the management console. In the service list, choose Elastic Volume
Service under Storage to go to the Elastic Volume Service page.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 113
Step 6 On the Details page, confirm the disk configuration. If you need to modify the
configuration, click Previous. If not, click Submit.
Step 7 Go back to the disk list page and view the disk status. When the disk status changes
to Available, the disk has been purchased.
System disks are purchased along with servers and are automatically attached. In the EVS
disk list, the function of such disks is System disk, and their status is In-use. After a system
disk is detached from a server, the disk function changes to Bootable disk, and the disk
status changes to Available. (A non-shared EVS disk is similar to a physical SSD or SATA
disk. After attached, a non-shared disk can be partitioned into the C, D, and E drives for
use.)
Step 1 In the EVS disk list, locate the EVS disk to be attached and click Attach in the
Operation column.
Step 2 Select the target Windows ECS and select a mount point from the drop-down list.
The ECS and EVS disk must be in the same AZ.
Step 3 Go back to the EVS disk list page. The disk status is Attaching, indicating that the
disk is being attached to the server. When the disk status changes to In-use, the
disk has been attached. You must initialize the disk before using it.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 116
Step 1 Locate the row that contains the target ECS and click Remote Login in the
Operation column.
Step 2 Log in using the RDP file or VNC. On the desktop of the ECS, choose Start > Server
Manager. On the dashboard, choose Tools > Computer Management.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 117
Step 3 In the navigation tree on the left, choose Storage > Disk Management.
Step 4 On the Disk Management page, if the status of new disk is Offline, right-click
Offline and choose Online to online the disk. If the status is Not Initialized, right-
click the status and choose Initialize Disk. In the Initialize Disk window, select the
target disk, click MBR (Master Boot Record) or GPT (GUID Partition Table), and
click OK.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 118
Step 5 Right-click the unallocated area and choose New Simple Volume.
Step 6 In the displayed New Simple Volume Wizard window, click Next.
Step 7 Specify the volume size and click Next. The default value is the maximum size.
Step 9 Select Format this volume with the following settings, set parameters based on
the requirements, and select Perform a quick format. Then, click Next.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 121
Step 10 Click Finish. Wait for the initialization to complete. When the volume status
changes to Healthy, the initialization is complete.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 122
Step 11 Open This PC. If a new volume appears, the disk has been attached.
Step 1 Locate the row that contains the target ECS and click Remote Login in the
Operation column.
Step 3 Open the Disk Management window and bring the EVS disk offline.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 124
Step 5 Buy another Windows ECS (Windows Server 2012 R2 Standard 64-bit English) by
referring to the preceding sections.
Step 6 Detach the EVS disk from ECS ecs-vivi and attach it to ECS ecs-test, the newly
purchased ECS.
Step 7 Log in to the ECS console, find ECS ecs-test, and click Remote Login.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 126
Step 8 Open the Disk Management window and check that the EVS disk is online.
Step 2 Purchase a non-shared EVS disk and name it volume-linuxadd by referring to the
preceding section, and attach the disk to the purchased ECS. (When purchasing the
disk, select the AZ where the Linux ECS resides for the disk.)
Step 3 Remotely log in to the Linux ECS and run the following command to view the new
data disk:
fdisk -l
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 128
The command output shows that the ECS has two disks, system disk /dev/vda and data
disk /dev/vdb.
Step 4 Run the following command to enter fdisk to partition the new data disk:
fdisk /dev/vdb
Step 5 In this example, a primary partition is created. Therefore, enter p and press Enter to
create a primary partition. Enter the partition number of the primary partition and
press Enter. Partition number 1 is used in this example.
First sector indicates the start sector. The value ranges from 2048 to 20971519, and the
default value is 2048.
Last sector indicates the end sector. The value ranges from 2048 to 20971519, and the
default value is 20971519.
Step 8 Enter p and press Enter to view details about the new partition.
Step 9 Enter w and press Enter to write the changes into the partition table.
In case that you want to discard the changes made before, you can exit fdisk by entering
q.
Step 10 Run the following command to synchronize the changes in the partition table to
the OS:
partprobe
Step 11 Run the following command to set the file system format for the new partition:
The formatting takes a period of time. Wait until the task status changes to done.
In this example, run the following command to create a mount point /mnt/sdc:
mkdir /mnt/sdc
Step 13 Run the following command to mount the new partition on the created mount
point:
In this example, run the following command to mount the new partition on /mnt/sdc:
df -TH
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 132
In this example, run the following command to obtain the UUID of /dev/vdb1:
blkid /dev/vdb1
vi /etc/fstab
Press i to enter editing mode and add the following content (replace the UUID with what
you have obtained):
Press Esc, enter :wq, and press Enter to exit editing mode.
Step 3 Run the command to unmount the partition. In this example, run the following
command:
umount /dev/vdb1
Step 4 Run the following command to reload all the content in the /etc/fstab file:
mount -a
Step 5 Run the following command to query the file system mounting information:
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 133
mkdir /mnt/sdc/snapshot
cd /mnt/sdc/snapshot
echo "snapshot test"> test.file
cat test.file
Step 2 Locate the EVS disk purchased before and choose More > Create Snapshot in the
Operation column.
Step 4 Go back to the disk list. Choose Snapshots in the navigation pane on the left,
locate the volume-linuxdata snapshot, and click Create Disk in the Operation
column.
Step 8 Log in to ECS ecs-linux and view the new data disk.
fdisk -l
mkdir /mnt/mdc
Step 10 Run the following command to mount the new partition /dev/vdc1 on /mnt/mdc:
Step 11 Switch to /mnt/sdc and check whether the snapshot file has been synchronized.
cd /mnt/sdc/snapshot
ls
cat test.file
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 137
If the preceding command output is returned, the snapshot file has been synchronized.
4.2 OBS
4.2.1 Introduction
4.2.1.1 About This Exercise
OBS provides a stable, secure cloud storage with high scalability and ease of use. It allows
users to store virtually any amount of unstructured data in any format, and allows them
to access data from anywhere using REST APIs. This exercise describes how to use OBS
Browser+ to manage object storage.
4.2.1.2 Objectives
Upon completion of this exercise, you will be able to:
Install OBS Browser+.
Use basic OBS Browser+ functions, such as creating buckets and folders, uploading,
downloading, and deleting files or folders, and deleting buckets.
4.2.2 Tasks
4.2.2.1 Roadmap
When users log in to OBS Console using their HUAWEI CLOUD account or as an IAM
user, OBS authenticates their account or IAM user credentials.
When users access OBS using the tools (OBS Browser+ or obsutil), SDKs, or APIs,
OBS requires access keys (AK and SK) for authentication. Therefore, users need to
obtain the access keys (AK and SK) before they access OBS using any methods other
than OBS Console.
Step 2 In the navigation pane, choose Access Keys. Click Create Access Key.
Step 3 In the displayed dialog box, enter the email or SMS verification code.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 139
Step 6 Open the downloaded file credentials.csv to obtain the AK and SK pair.
OBS Browser+ saves the login details for a maximum of 100 accounts. If a proxy is required
to access your network environment, configure the network proxy under More > Settings >
Network before login.
4.2.2.2.3 Creating a Bucket
Step 1 In the upper left corner of OBS Browser+ homepage, click Create Bucket.
Step 2 In the Create Bucket dialog box, configure the following parameters:
Region: AP-Singapore
Storage Class: Select Standard.
Bucket ACL: Private
Multi-AZ Mode: It is disabled by default.
Bucket Name: test-vivi is used as an example. You can hover your cursor over the
tooltip to view the bucket naming rules.
Step 3 Click OK. A dialog box is displayed, indicating whether the bucket is created.
Step 5 (Optional) Click Task Manager in the upper right corner of the page to go to the
task management page. The upload progress is displayed. You can suspend, run, or
cancel upload tasks as needed.
Step 2 In the dialog box, select a path for saving the downloaded file on your local PC.
Step 3 (Optional) In the navigation pane, click Task Management. The download progress
of the file or folder is displayed. You can suspend, run, or cancel download tasks as
needed.
Step 3 (Optional) Go to the Task Management page. The deletion progress of a file or
folder is displayed. You can suspend, run, or cancel deletion tasks as needed.
Step 2 Click the bucket name to go to the Overview page. In the Basic Information area,
move your cursor next to Versioning to view its status.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 145
Step 3 Click Edit next to Versioning. In the Versioning dialog box, select Enable and then
OK.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 146
Step 4 In the navigation pane, choose Objects. On the displayed page, click Upload Object
to upload two objects with the same name.
Step 5 Click the name of the uploaded object to view its properties.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 147
Step 7 Click Share in the Operation column of the row containing the object to be shared.
In the Share File dialog box, enter a URL validity period, and copy the link for
sharing.
4.3 SFS
4.3.1 Introduction
4.3.1.1 About This Exercise
SFS provides reliable, high-performance shared file storage hosted on HUAWEI CLOUD.
With SFS, you can enjoy shared file access spanning multiple ECSs, BMSs, and containers
created on CCE and CCI. This exercise describes basic SFS operations.
4.3.1.2 Objectives
Upon completion of this exercise, you will be able to:
Create an SFS file system.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 149
4.3.2 Tasks
4.3.2.1 Creating an SFS File System
4.3.2.1.1 Prerequisites
A VPC vpc-mp has been created.
A Linux ECS ecs-linux running CentOS 7.6 has been purchased. An EIP has been
bound to the ECS, and the ECS locates in VPC vpc-mp.
A Windows ECS ecs-windows running Windows Server 2012 has been purchased. An
EIP has been bound to the ECS, and the ECS locates in VPC vpc-mp.
4.3.2.1.2 Creating an SFS File System
Step 1 Log in to the HUAWEI CLOUD console and choose Scalable File Service in the
service list.
Step 3 On the displayed page, set the name, file system type, and VPC for the file system
you are creating.
File System Type: SFS
Region: AP-Bangkok
AZ: AZ1
Protocol Type: NFS
VPC: Select an existing VPC or create one.
Maximum Capacity: 1 GB
Name: sfs-mp
Quantity: 1
Retain the default settings for other parameters.
Step 5 On the Details page, confirm the configuration and click Submit.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 151
Step 6 A message is displayed indicating that the request has been submitted.
Step 3 Run the following command to check whether the NFS software package has been
installed in the operating system (generally available in the operating system):
If information similar to the preceding figure is returned, the NFS software package has
been installed. The command output varies with the operating system.
Step 4 If no command output is returned, the NFS software package is not installed. Run
the respective command to install the NFS software package. In this exercise,
CentOS 7.6 bit is used as an example.
In CentOS, Red Hat, EulerOS, Fedora, or Oracle Enterprise Linux, run the following
command:
Step 5 Run the following command to install the bind-utils software package:
Log in to the SFS console, click the file system to be mounted, and view the mount address.
Note that information in the red box is the domain name of the file system.
Step 6 Run the following command to check whether the file system domain name can be
resolved into corresponding IP addresses: (Replace the mount address with the one
you have obtained.)
nslookup sfs-nas01.ap-southeast-2a.myhuaweicloud.com
If information similar to the following is displayed, IP addresses have been mapped to the
file system domain name.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 154
Step 7 Run the mkdir /local path command to create a local directory for mounting the
file system.
mkdir /localfolder
Step 8 Run the following command to mount the file system on the local path:
mount -t nfs -o vers=3,timeo=600,nolock Mount address of the SFS file system /local
path
In this example, run the following command:
Step 9 Run the following command to view the mounted file system:
mount -l
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 155
vi /etc/fstab
Press i to enter editing mode. At the end of the file, add the file system information. In this
example, add the following content:
Press Esc, enter :wq, and press Enter to save and exit.
Replace Mount address and /localfolder with those used in your environment.
cat /etc/fstab
reboot
Step 13 Log in to the system and run the following command to view the mounted file
system:
mount -l
cd /localfolder
vim new
Step 15 Press i to enter editing mode. Enter Hello HuaweiCloud SFS, press Esc, and
enter :wq to exit editing mode and save the change.
cat /localfolder/new
Now that the file system has been mounted to the ECS and can be used.
Step 2 Click Add Roles and Features and click Next for three consecutive times to go to
the Server Roles page.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 158
Step 3 Under File and Storage Services, click Server for NFS. In the displayed window, click
Add Features.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 159
Step 4 Click Next. On the Features page, click Client for NFS.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 160
Step 7 After the installation is complete, restart the client and log to the ECS again as
prompted.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 162
Step 2 On the Control Panel, choose System and Security > Administrative Tools >
Services for Network File System (NFS).
Step 3 Right-click Client for NFS and choose Properties. In the displayed dialog box,
change the transport protocol to TCP and select Use hard mounts as the default
mount type.
Step 4 Run the following command in the Command Prompt of the Windows Server 2012
(X is the drive letter of the free disk):
4.3.2.3.4 Verification
Step 1 On the Windows ECS, open This PC to check that the mounted file system is
available.
Step 2 Access share-c343b993 and check that file new exists. This file is created in the file
system from ECS ecs-linux, indicating that the SFS file system can be shared among
servers.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 166
umount /localfolder
Step 2 Run the following command to check whether the file system has been unmounted:
mount –l
4.4 Exercises
1. Buy a Windows ECS and an EVS disk, attach the disk to the ECS, and create a test file
on the disk. Try to roll back the disk data from a snapshot.
2. Attach the object storage on the Windows ECS using OBS Browser+ and configure
synchronization policy to implement scheduled file synchronization.
3. Now that the file system has been mounted to the Linux ECS. Confirm that automatic
mounting has been configured in /etc/fstab, and then create an ECS from the private
image and verify whether the file system can be automatically mounted on the new
ECS and whether files can be shared.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 169
5 O&M Services
5.1 Introduction
5.1.1 About This Exercise
In this exercise, you will:
View the CTS console.
Use LTS to check ECS logs.
Run commands to increase ECS CPU usage and check for a generated alarm.
5.1.2 Objectives
Upon completion of this exercise, you will be able to:
Use CTS.
Configure and use Cloud Eye.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 170
5.2 Tasks
Perform a Increase
Configure key Use Cloud ECS CPU
CTS key operation Eye to usage to View ECS
event in VPC and monitor an check for a logs.
notifications. verify CTS ECS. generated
functions. alarm.
Step 2 Search for Cloud Trace Service to access the CTS console.
Step 3 Enable and authorize CTS. The CTS tracker created identifies and associates itself
with all cloud services you are using.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 171
Step 3 Simple Message Notification (SMN) pushes SMS, email, or app messages. A topic is
used to publish or subscribe to messages. To create a topic, access the SMN
console, choose Topic Management > Topics in the navigation pane, and click
Create Topic in the upper right.
Step 5 Click Add Subscription to add a subscription for the created topic.
Step 6 Select SMS for Protocol, enter your mobile number, and click OK.
Step 7 Choose Subscriptions in the navigation pane and see that the subscription status is
Unconfirmed. You will receive an SMS from HUAWEI CLOUD. Click the link in the
message to confirm the subscription, and you will receive an SMS of successful
subscription.
Step 8 On the Subscriptions page, if the subscription status has changed to Confirmed,
subscription was successful.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 175
Step 9 On the Topics page, click Publish Message to publish a message and check that
you receive it.
Step 10 Enter Subject, select Text for Message Format, enter Hello in Message, and click
OK. If you receive the Hello SMS message from HUAWEI CLOUD, the subscription
is verified.
Step 2 When the VPC is created, check for an SMS about the VPC creation from HUAWEI
CLOUD.
Step 3 Access the CTS console and choose Trace List in the navigation pane. These are
operation records generated in the last seven days. Information such as trace name,
trace status, and operation time is displayed. You can also search for the traces you
need.
Step 2 On the Cloud Eye console, in the navigation pane, on the left, choose Server
Monitoring. Click Configure.
Step 3 Go to the ECS console, locate ecs-linux, and in the Operation column, click
Remote Login.
Step 4 Run the following command to install the Agent (a Cloud Eye plug-in) on ecs-linux:
If you can see the following information, the Agent is installed successfully.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 178
Step 6 Go to the ECS console. In the ECS list, locate ecs-linux, and in the Operation
column, choose More > Restart.
Step 7 Go to the Cloud Eye Server Monitoring page, locate ecs-linux, and click View
Metric in the Operation column to view the running and performance parameters
of ecs-linux.
Step 1 On the Cloud Eye Server Monitoring page, locate ecs-linux and click Create Alarm
Rule in the Operation column.
Step 3 Go to the Alarm Rules page and check the status of alarm rule alarm-test.
Step 4 Go to the Server Monitoring page, locate ecs-linux, and in the Operation column,
click View Metric.
The current CPU usage does not meet the alarm triggering condition.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 181
Step 6 Go to the ECS console, log in to ecs-linux, and increase its CPU usage by running
the following command. (5 to 10 minutes later, you will see that the CPU usage has
been dramaticaly increased.)
for i in `seq 1 $(cat /proc/cpuinfo |grep "physical id" |wc –l)`; do dd if=/dev/zero of=/dev/null & done
Step 7 Go to the Cloud Eye console. In the navigation pane on the left, choose Alarm
Management > Alarm History. Refresh the Alarm History page.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 182
You have now completed the experiment of using Cloud Eye to monitor an ECS.
Step 2 Log groups and log streams are basic units for log management in LTS. Before
using LTS, create a log group and log stream. On the LTS console, choose Log
Management in the navigation pane, and click Create Log Group in the upper left.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 183
Step 3 Give your group a name and choose how many days you want to retain its logs,
and click OK.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 184
Step 4 On the Log Management page, click the name of your log group.
OS: Linux
Installation Mode: Obtain AK/SK
Step 3 Copy the command in Step 2 and run it in the ECS. If the following information is
displayed, the installation is successful.
Step 4 Refresh the Hosts tab under the Host Management page. If the ICAgent status for
the ECS is Running, ICAgent has been installed.
Step 2 On the Select Log Stream stage, select the log group and log stream you created.
Click Next: Select Host Group.
Step 3 Create a host group. Give the group a name. Select it in the list and go to the next
step.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 189
Step 4 Configure the collection configuration name and collection paths. Collection paths
are ECS log paths and the source of the logs ICAgent will collect.
Step 5 Configure the log format and log time, and click OK.
Step 6 Wait a minute to view the ingested logs on the Real-Time Logs tab under a log
stream.
Step 7 Click the Raw Logs tab. Search successful log events and check their context.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 191
Step 2 Check that all resources in the account have been deleted.
5.4 Exercises
1. Create a Windows ECS.
2. Configure tracking of operations on the ECS in CTS.
3. Modify ECS specifications.
4. View related traces on the CTS console.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 192
6.1 Background
An enterprise intends to deploy their website on HUAWEI CLOUD and they have the
following requirements:
Database nodes and service nodes are deployed on separate ECSs.
ECSs are added or removed as incoming traffic changes over time.
Incoming traffic is automatically distributed across the ECSs.
Service statuses are monitored and visualized.
6.2 Solution
Table 6-1 Solution configuration table
6.3 Preparations
6.3.1 Logging In to HUAWEI CLOUD
Step 1 Visit the HUAWEI CLOUD official website and click Log In in the upper right corner.
Step 2 On the login page, click HUAWEI CLOUD Account, enter your account and
password, and then click Log In.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 194
Step 3 Click Inbound Rules and then Add Rule to add an inbound rule with the following
parameter settings:
Protocol & Port: All
IP address in Source: 0.0.0.0/0
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 197
Basic settings:
Billing Mode: Pay-per-use
Region: AP-Singapore
AZ: Random
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 198
Network configuration:
Network: Select the VPC you have created.
Security Group: Select the security group you have created.
EIP: Auto assign, Dynamic BGP, Billed by Bandwidth, 2 Mbit/s
Advanced settings:
ECS Name: ecs-mp (Change it as needed.)
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 199
Step 3 Confirm the configuration, select I have read and agree to the Service Level
Agreement and Image Disclaimer, and click Buy Now.
Step 5 An EIP has been bound to the ECS. To enhance ECS login security, you are advised
to set the ECS login mode to key pair. For details, see Access to the Internet with an
EIP.
Step 4 Confirm the configuration, and click Submit. Go to the RDS DB instance list, and
wait for the creation to complete, which takes 6 to 10 minutes.
Step 2 In the VNC window, enter the username (root for Linux ECSs by default) and
password for login.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 203
Step 3 Run the following command to install LAMP and enable the services you will need:
vim /etc/httpd/conf/httpd.conf
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 204
Step 5 In the configuration file, press Shift+G to go to the last line of the configuration
file, press I to enter the editing mode, move the cursor to the end of the
configuration file, and press Enter. Then copy and paste the following content:
ServerName localhost:80
Step 6 Press Esc to exit the editing mode, enter :wq, and press Enter to save and exit the
configuration file.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 205
Step 7 Run the following command to download the WordPress installation package:
wget -c https://wordpress.org/wordpress-4.9.10.tar.gz
Step 8 Run the following command to decompress the WordPress installation package to
the /var/www/html directory:
Step 9 Run the following command to grant the read and write permissions to the
directory where the file is located:
Step 12 Run the following command to check the httpd status, which should be active
(running) and highlighted:
Step 13 Run the following command to check the php-fpm status, which should be active
(running) and highlighted:
Step 14 Run the following command to make httpd automatically start at boot. If
information similar to what shown in the figure is displayed, httpd has been
configured to automatically start at boot.
Step 15 Run the following command to configure php-fpm automatically start upon system
boot. If information similar to what shown in the figure is displayed, php-fpm has
been configured to automatically start upon system boot.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 208
Step 16 In the browser, access the EIP bound to the ECS. If the following figure is displayed,
LAMP has been installed.
Step 2 Enter the username (root by default) and password (you set when purchasing the
RDS instance). Select Remember Password, enable Collect Metadata Periodically
and Show Executed SQL Statements. If the connection test is successful, click Log
In.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 209
Step 3 On the top menu bar, choose SQL Operations > SQL Window, as shown in the
following figure. Delete the default content in the command line under SQL
Window.
Step 4 Enter the following SQL statement and click Execute SQL. If the following
information is displayed, the database for WordPress has been created.
Step 2 Click Let's go!. in the displayed page, enter the database access information, and
click Submit.
Database Name: wordpress
Username: root
Password: Enter the password you set.
Database Host: Enter the database floating IP address and port number obtained in
step 4 of section Buying an RDS DB Instance.
Table Prefix: Retain the default settings.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 211
Figure 6-46 Configuring the connection between WordPress and the database
Set Site Title, Username, Password, and Your Email, and click Install WordPress.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 212
Step 3 Enter the user name and password on the displayed login page. Then, click Log In.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 213
Now the initial configurations of the WordPress website server and its back-end database
instance are complete. Next, we will configure ELB and AS for the WordPress website server.
Step 5 Go back to the load balancer list and ensure that the load balancer is in the
Running state.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 216
Step 6 Click the name of the load balancer. Under Listeners, click Add Listener. Configure
the name, protocol, and port for the listener.
Step 7 Click Next, configure the backend server group, and click Finish.
Name: listener-mp (Change it as needed.)
Health Check: disabled
Remain the default settings for other parameters.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 217
Now that the ELB configuration is complete, we need to configure some backend servers
for AS. They will be added to or removed from the backend server group based on how
much traffic there is. Before you configure AS, create a private image on the IMS console.
This image will be used by the system to create these ECSs.
Step 2 Go back to the service list. Under Compute, click Image Management Service.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 218
Step 5 Wait until the image status becomes Normal. Then, switch back to the ECS console,
and start the ECS.
6.5.3 Configuring AS
Step 1 Go back to the service list. Under Compute, click Auto Scaling.
Step 3 Configure the parameters as shown in the following figures and then click Create
Now.
Select the system disk image and security group you just created and set EIP to Do not
use.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 220
Step 7 Select the AS configuration and load balancer you just created. AS will dynamically
adjust the number of ECSs in the backend server group using the image configured
or used in the AS configuration.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 222
Step 8 Locate the AS group you created and click View AS Policy in the Operation
column.
Step 10 Wait for about 2 minutes and check whether the AS policy has taken effect. As we
can see in the following figure, two ECSs have been added to the AS group. The AS
policy has taken effect.
Step 11 Switch back to the ELB console and click the load balancer name, elb-mp. Locate
the backend server group associated with the load balancer and view the two ECSs
added by the AS service.
Step 12 Verify that web servers where the website is deployed can be accessed using the EIP
bound to the load balancer. We have finished configuring AS and verified that AS
can dynamically adjust the number of ECSs in the backend server group associated
with the load balancer based on the configured AS policy.
Step 2 Check whether the website can be accessed. If the website can be accessed, web
servers where the website is deployed can provide Internet-accessible services using
the load balancer's EIP.
Step 2 On the Overview page, view overall resource information and alarm statistics.
Step 3 In the left navigation pane, choose Alarm Management > Alarm History. View
service alarms and handle any faults in a timely manner.
Step 4 In the left navigation pane, choose Server Monitoring > Elastic Cloud Server and
then view ECS monitoring information.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 227
Step 2 Locate the RDS DB instance you want to delete and click Delete in the Operation
column.
HCIA-Cloud Service Lab Guide for HUAWEI CLOUD Service Engineers Page 229
Step 2 Locate the load balancer and click Delete. In the displayed dialog box, click Yes.
Step 2 Locate the AS configuration you want to delete and click Delete. In the displayed
dialog box, click Yes.
Step 2 In the left navigation pane, choose Access Control > Security Groups and then
delete the security group. Then delete the VPC.
Step 3 On the Dashboard page of the Cloud Server Console and Network Console, and
on the IMS console, confirm that all of the purchased resources have been deleted
in all regions.
Step 4 Hover your cursor over Resources and click My Resources. Check whether there
are still billable cloud resources in the corresponding region. If there are such
services, delete the resources in that region.