Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
[在此处键入]
1
HCIA-Cloud Computing Training Courses
HCIA-Cloud Computing
Guide to Setting Up the Lab Environment
Version: 4.0
Huawei Technologies Co., Ltd.
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd. 2019. 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.
Trademarks and Permissions
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
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.
Huawei Technologies Co., Ltd.
Address: Huawei Industrial Base
Bantian, Longgang
Shenzhen 518129
People's Republic of China
Website: http://e.huawei.com
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page1
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page2
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Contents
1 Lab Environment Introduct ion .................................................................................................. 3
1.1 Lab Environment ............................................................................................................. 3
1.2 Devices in Lab Environments ............................................................................................. 3
1.3 Software and Tools .......................................................................................................... 3
2 Installing CentOS 7.3 ................................................................................................................. 3
2.1 Preparations................................................................................................................... 3
2.1.1 Downloading the CentOS 7.3 ISO Image from the Official Website ................................... 3
2.2Installing CentOS 7.3 ........................................................................................................ 4
2.2 Upgrading QEMU ............................................................................................................. 6
3 Init ial Configurat ions ................................................................................................................ 6
3.1 Enabling Nested Virtualization .......................................................................................... 6
3.2 Initial Network Configuration ........................................................................................... 7
3.3 Disabling SELinux ............................................................................................................ 9
3.4 Clearing iptables Rules ..................................................................................................... 9
3.5 Expanding the Root Partition ............................................................................................ 9
3.6 Other Configuration....................................................................................................... 11
4 Creat ing a CNA Node .............................................................................................................. 11
5 Adding Storage Configurat ions ............................................................................................... 12
5.1 Enabling the NFS Server ................................................................................................. 12
5.2 Configuring the iSCSI Target ........................................................................................... 13
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page3
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
1 Lab Environment Introduct ion
1.1 Lab Environment
This document describes how to build a HCIA-Cloud Computing v4.0 lab environment using CentOS 7.3 and nested virtualization. If the hardware configuration of the server is consistent with the recommended configuration, the lab environment should be able to support hands-on experience by five trainees at the same time.
Note:
The VMs used by the five trainees run on the same switch. Plan the IP addresses carefully to avoid IP address conflicts. During the lab, the trainees must use the planned IP addresses to perform the required operations.
1.2 Devices in Lab Environments
To meet the HCIA-Cloud Computing lab requirements, you are advised to use the following configurations in each lab environment:
The following table lists the devices required.
Device Model Quantity
Server RH1288V5 1
Switch S5700 1
1.3 Software and Tools
This lab allows you to install and experience FusionCompute R6.3.1. You will need to use the following tools:
FusionCompute 6.3
CentOS 7.3 image file
PuTTY
VNC-viewer
WinSCP
2 Installing CentOS 7.3
2.1 Preparations
2.1.1 Downloading the CentOS 7.3 ISO Image from the Official Website
Download address: http://archive.kernel.org/centos-vault/7.3.1611/isos/x86_64/
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page4
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
2.2Installing CentOS 7.3
Step 1 Log in to the server through the BMC. Mount the CentOS 7.3 ISO file to the server, and set the boot mode to booting from virtual DVD-ROM drive.
Mount the CentOS 7.3 image file as follows:
Step 2 Install CentOS 7.3.
Select Install CentOS Linux 7.
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page5
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Set LANGUAGE SUPPORT and DATE & TIME, and then set SOFTWARE SELECTION and INSTALLATION DESTINATION.
During the installation, set the password of the root user.
----End
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page6
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
2.2 Upgrading QEMU
When nested virtualization is used, the default QEMU cannot identify some of the parameters. You must upgrade QEMU to 3.1.0. After CentOS 7.3 is connected to the Internet, run the following commands to install QEMU. The installation process takes about 1.5 hours. The commands are as follows:
Command 1: wget http://www.qemu.org/download/qemu-3.1.0.tar.bz2
Command 2: yum -y install gcc gcc-c++ automake libtool zlib-devel glib2-devel bzip2-devel
libuuid-devel spice-protocol spice-server-devel usbredir-devel libaio-devel
Command 3: tar xf qemu-3.1.0.tar.bz2
Command 4: cd qemu-3.1.0
Command 5: ./configure --enable-usb-redir --enable-libusb --enable-spice --enable-uuid
--enable-kvm --enable-bzip2 --prefix=/usr/local/qemu --enable-linux-aio --enable-system
Command 6: make && make install
Command 7: ln -s /usr/local/qemu/bin/qemu-system-x86_64 /usr/bin/qemu-kvm
Command 8: qemu-kvm –version
After command 8 is executed, if version 3.1.0 is displayed, the installation is complete.
3 Init ial Configurat ions
3.1 Enabling Nested Virtualization
Step 1 Run the vi command to open the /etc/modprobe.d/kvm-nested.conf file and add the following content:
Step 2 Run the following command to enable nested virtualization:
modprobe -r kvm_intel
modprobe -a kvm_intel
Step 3 Run the following command to check whether nested virtualization is enabled:
cat /sys/module/kvm_intel/parameters/nested
If the output is N, nested virtualization is disabled. If the output is Y, it is enabled.
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page7
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
----End
3.2 Initial Network Configuration
If after recovery, the system cannot automatically identify the NICs of the server, you need to manually configure network information. Two bridges, br0 and br1, are planned. br0 is used to carry management traffic, and br1 storage traffic. Run the ethtool command to check the network port information.
Step 1 Enter the /etc/sysconfig/network-scripts directory.
Step 2 Add the NIC configuration file. The following uses enp129s0f0 and enp130s0f0 as an example.
Copy the existing configuration file of enp2s0f1 and rename them into enp129s0f0 and enp130s0f0.
Step 3 Modify the configuration files as follows:
Step 4 Copy the configuration file of br0 to add br1. If the configuration file of br0 does not exist, run the vi ifcfg-br0 command to add it.
Step 5 Modify the configuration files of br0 and br1 as follows:
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page8
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Step 6 Run the following command to restart the network service.
Step 7 Check the bridge configuration.
Step 8 Test the network connectivity.
----End
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page9
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
3.3 Disabling SELinux
Step 1 Run the vi command to modify the config file in /etc/selinux as follows:
Step 2 Restart the server for the change to take effect.
----End
3.4 Clearing iptables Rules
Step 1 To avoid the failure to log in to the VM using VNC, run the following command to clear all iptables rules:
iptables –F
iptables –P INPUT ACCEPT
iptables –P FORWARD ACCEPT
Because the iptables service is not installed, the change made to the iptables rules cannot be saved. The change will be lost after a server restart. You are advised to connect the server to the Internet and run the yum command to install iptables to have the configuration saved.
----End
3.5 Expanding the Root Partition
Step 1 Check the IDs of the existing disks.
In the following example, the entire sdc disk is added as the root partition.
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page10
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Step 2 Create a physical volume (PV).
Step 3 Add the created PV to an existing volume group (VG).
Check the existing VGs.
Run the vgextend command to add the created PV to an existing VG.
Step 4 Expand the logical volume corresponding to the root partition.
Step 5 Make the configuration take effect.
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page11
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Step 6 Check the size of the expanded root partition.
----End
3.6 Other Configuration
Step 1 Modify the permissions of /dev/kvm.
----End
4 Creat ing a CNA Node
Step 1 Upload the software package.
Use WinSCP to upload the CNA image file to the specified folder. The following uses /tmp/ISO as an example.
Log in to CentOS.
Enter /tmp/ISO to upload the software package.
Step 2 Create a disk file required by the CNA node.
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page12
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Step 3 Create a CNA VM.
Run the following command to create a CNA VM:
virt-install --name CNA1 --memory 20480 --vcpu sockets=2,cores=2,threads=8 --cpu host-model,+vmx
--sysinfo host --disk path=/tmp/img/CNA1.qcow2 --disk path=/tmp/ISO/F1.iso,device=cdrom
--network bridge=bridge0,model=e1000 --network bridge=bridge0,model=e1000 --network
bridge=bridge1,model=e1000 --network bridge=bridge1,model=e1000 --vnclisten=192.168.152.116
--vncport=5900 --vnc --noautoconsole --boot cdrom
Step 4 Modify the CNA configuration to set the memory upper limit.
Run the virsh edit CNA1 command to add the following parameters to the configuration file:
<memtune><soft_limit unit='KiB'>1677736</soft_limit></memtune>
----End
5 Adding Storage Configurat ions
5.1 Enabling the NFS Server
Step 1 Create a shared directory for the NFS service.
Step 2 Run the following command to modify the configuration file:
vi /etc/exports
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page13
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Add the following content to the configuration file:
Step 3 Run the following command to restart the NFS server:
Step 4 Start the NFS service to check whether the configuration has taken effect.
----End
5.2 Configuring the iSCSI Target
Step 1 Run the systemctl status target command to enable the service.
Step 2 Create an LV in the existing VG to use as the disk space.
HCIA-Cloud Computing Guide to Setting Up the Lab Environment Page14
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Step 3 Create the iSCSI target.
Create a block storage.
Configure the iSCSI target naming convention.
Create a LUN.
Create an IP Address and port.
Create an ACL and allow iSCSI client connections.
Create 10 clients in the same way.