user guide - static.huaweicloud.com · image management service user guide issue 09 date 2017-03-30...

89
Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD.

Upload: vanmien

Post on 28-Jul-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Image Management Service

User Guide

Issue 09

Date 2017-03-30

HUAWEI TECHNOLOGIES CO., LTD.

Page 2: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Copyright © Huawei Technologies Co., Ltd. 2017. All rights reserved.No part of this document may be reproduced or transmitted in any form or by any means without prior writtenconsent 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 respectiveholders. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei and thecustomer. All or part of the products, services and features described in this document may not be within thepurchase 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 orrepresentations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute a warranty of any kind, express or implied.

Huawei Technologies Co., Ltd.Address: Huawei Industrial Base

Bantian, LonggangShenzhen 518129People's Republic of China

Website: http://www.huawei.com

Email: [email protected]

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

i

Page 3: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Contents

1 Overview......................................................................................................................................... 11.1 Concept...........................................................................................................................................................................11.1.1 What Is Image Management Service?......................................................................................................................... 11.1.2 OSs for Public Images Supported by IMS...................................................................................................................21.1.3 Image Formats and OS Types of External Image Files............................................................................................... 41.2 Charging......................................................................................................................................................................... 71.2.1 Charging Standard....................................................................................................................................................... 71.3 IMS Access and Usage................................................................................................................................................... 71.3.1 Accessing IMS.............................................................................................................................................................71.3.2 IMS Relationships with Other Services.......................................................................................................................7

2 Getting Started............................................................................................................................... 82.1 Introduction.................................................................................................................................................................... 82.2 Creating a Windows Private Image Using an ECS.........................................................................................................82.2.1 Overview..................................................................................................................................................................... 82.2.2 Configuring a Windows ECS...................................................................................................................................... 82.2.3 Installing Cloudbase-Init........................................................................................................................................... 122.2.4 Creating a Windows Private Image........................................................................................................................... 162.3 Creating a Linux Private Image Using an ECS............................................................................................................ 172.3.1 Overview................................................................................................................................................................... 172.3.2 Querying and Configuring NIC Attributes................................................................................................................182.3.3 Querying and Deleting Network Rule Files.............................................................................................................. 192.3.4 Installing Cloud-Init.................................................................................................................................................. 202.3.5 Querying and Detaching EVS Data Disks from the ECS..........................................................................................272.3.6 Creating a Private Linux Image.................................................................................................................................282.4 Creating a Linux Private Image Using an External Image File....................................................................................292.4.1 Overview................................................................................................................................................................... 292.4.2 Uploading an External Image File.............................................................................................................................312.4.3 Registering an External Image File as a Private Image.............................................................................................312.4.4 Creating an ECS........................................................................................................................................................ 342.4.5 Configuring a Linux ECS.......................................................................................................................................... 342.4.6 Creating a Private Image Using an ECS....................................................................................................................352.4.7 (Optional) Cleaning Up the Environment................................................................................................................. 35

3 Management................................................................................................................................. 37

Image Management ServiceUser Guide Contents

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

ii

Page 4: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

3.1 Modifying Image Attributes......................................................................................................................................... 373.2 Creating an ECS Using an Image................................................................................................................................. 383.3 Deleting an Image.........................................................................................................................................................393.4 Sharing an Image.......................................................................................................................................................... 393.4.1 Overview................................................................................................................................................................... 393.4.2 Obtaining the Domain Name and Project Name....................................................................................................... 403.4.3 Sharing Specified Images.......................................................................................................................................... 413.4.4 Accepting or Refusing Shared Images...................................................................................................................... 413.4.5 Removing Accepted Images......................................................................................................................................433.4.6 Canceling Image Sharing...........................................................................................................................................433.4.7 Adding Tenants Who Can Use Shared Images..........................................................................................................443.4.8 Deleting Tenants Who Can Use Shared Images........................................................................................................ 443.5 Exporting an Image...................................................................................................................................................... 453.6 Optimizing a Windows Private Image..........................................................................................................................463.6.1 Overview................................................................................................................................................................... 463.6.2 Uninstalling Tools from a Windows ECS..................................................................................................................483.6.3 Installing Tools on a Windows ECS.......................................................................................................................... 493.6.4 Installing UVP VMTools on a Windows ECS...........................................................................................................503.6.5 Configuring an SID for an ECS.................................................................................................................................523.6.6 Configuring Windows ECS Specifications................................................................................................................553.7 Optimizing a Linux Private Image............................................................................................................................... 573.7.1 Overview................................................................................................................................................................... 573.7.2 Uninstalling Tools from a Linux ECS....................................................................................................................... 583.7.3 Changing UUIDs of fstab and grub and Installing Native Xen and KVM Drivers...................................................593.7.4 Configuring Linux ECS Network Attributes.............................................................................................................653.7.5 Configuring Linux ECS Specifications..................................................................................................................... 703.8 Encrypting an Image.....................................................................................................................................................703.8.1 Overview................................................................................................................................................................... 703.8.2 Creating an Encrypted Image.................................................................................................................................... 713.9 Replicating an Image.................................................................................................................................................... 71

4 FAQs...............................................................................................................................................734.1 Image FAQs.................................................................................................................................................................. 734.1.1 What Are the Charging Standards of IMS?...............................................................................................................734.1.2 Will I Be Charged for Creating an Image Using an ECS?........................................................................................ 734.1.3 Is the OBS for Private Images Charged?...................................................................................................................734.1.4 How Many Private Images Can Be Created Using One Account?........................................................................... 734.1.5 Can Specifications of ECSs Created Using a Private Image Differ from Those of ECSs Used to Create the Image?............................................................................................................................................................................................ 734.1.6 How Long Does It Take to Create a Private Image Using an ECS?..........................................................................744.1.7 Should I Stop the ECS Before Creating a Private Image Using that ECS?...............................................................744.1.8 What Can I Do If I Configure an Incorrect System Disk Size During Private Image Registration Using an ImageFile?.................................................................................................................................................................................... 744.1.9 What Are the Impacts If the ECS That Has Not Been Configured Is Used to Create the Private Image?................74

Image Management ServiceUser Guide Contents

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

iii

Page 5: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

4.1.10 Can I Use Images in Formats Other Than Those Specified in This Document?.....................................................744.1.11 What Can I Do If the Disks of ECS Created Using a CentOS Image Cannot Be Found?...................................... 754.1.12 How Can a Refused Image Be Used?......................................................................................................................764.1.13 What Changes Will Be Made to an Image File Used for Registering a Private Image?......................................... 764.1.14 What Should I Do If No Partition Is Found During the Startup of an ECS Created Using a Private Image That IsCreated Using an External Image File?..............................................................................................................................774.1.15 What Initial Configuration Needs to Be Performed for an External Image File Used to Create a Private Image?............................................................................................................................................................................................ 794.1.16 How Can I Share an Encrypted Image or Publish It in Marketplace?.....................................................................804.1.17 How Can I Change an Unencrypted Image to an Encrypted One?......................................................................... 804.2 OS FAQs.......................................................................................................................................................................804.2.1 Can I Specify the Size of the EVS System Disk When Using a Private Image to Create an ECS?..........................804.2.2 What Should I Do If the Provided OS Images Cannot Meet My Requirement?.......................................................804.2.3 What Are the Usage Requirements of Each Type of OS?......................................................................................... 804.2.4 Why Is the Sysprep Operation Required for Creating Private Images Using a Windows ECS?.............................. 814.2.5 What Impact Will Be Brought by an Inconsistency Between the Image OS I Select or Identified by the System andThat of the Actual Image During Creation of a Private Image Using an External Image File?.........................................81

A Change History........................................................................................................................... 83

Image Management ServiceUser Guide Contents

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

iv

Page 6: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

1 Overview

1.1 Concept

1.1.1 What Is Image Management Service?

Image and IMSAn image is an Elastic Cloud Server (ECS) template containing mandatory software, such asthe operating system (OS). The template may also contain application software, such asdatabase software, and proprietary software. Images are classified into public images, privateimages, and shared images. The system provides public images by default, and you can createprivate images by yourself.

Image Management Service (IMS) provides easy-to-use self-service image managementfunctions. You can apply for an ECS using either a private image or a public image. You canalso create a private image using an existing ECS or an external image file.

NOTICEThe public cloud platform has supported Cloud-Init since November 28, 2016. This feature isavailable only in Eastern China and Southern China, and will be available in Northern andNortheastern China in the near future.The Cloud-Init feature described in this document applies only in Eastern and SouthernChina. If you are not in these regions, click Document Download in the navigation tree onthe left to obtain the Image Management Service User Guide (Northern and NortheasternChina).

Image Management ServiceUser Guide 1 Overview

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

1

Page 7: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Image Type

Table 1-1 Image type

Image Type Description

Public image A widely used, standard image. It contains an OS and pre-installed publicapplications and is visible to all users. You can configure the OS andsoftware in the public image as needed.

Private image Contains an OS, pre-installed public applications, and users' privateapplications. It is visible only to the user who creates it. Using a privateimage to create an ECS can eliminate the time required for repeatedlyconfiguring the ECS. You can create private images using one of the twomethods:l Using ECSsl Using external image files

You can upload external image files and register the images on thepublic cloud platform to make them function as private images.External image files can be in VMDK, VHD, QCOW2, or ZVHDformat.

Sharingimages

A private image that is shared by other tenants on the public cloud systemand accepted by you as your own private image

IMS Functions

IMS has the following functions:

l Provides public images that contain mainstream OSs. For details about supported OSs,see 1.1.2 OSs for Public Images Supported by IMS.

l Creates private images.– Creating private images using ECSs– Creating private images using image files

l Manages images.– Modifying attributes of private images– Deleting existing private images– Sharing images– Exporting images– Encrypting images– Copying image

l Creates an ECS using an image.For details, see the Elastic Cloud Server User Guide.

1.1.2 OSs for Public Images Supported by IMSTable 1-2 lists the OSs supported by IMS for public images.

Image Management ServiceUser Guide 1 Overview

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

2

Page 8: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Table 1-2 OSs supported by IMS for public images

OS Version

Windows Windows 2012 R2 Datacenter EnglishWindows 2012 R2 Standard EnglishWindows 2012 R2 StandardWindows 2012 R2 DatacenterWindows Server Standard 2008 R2 64bitWindows Server Datacenter 2008 R2 64bitWindows Server Enterprise 2008 R2 64bitWindows Server Enterprise 2008 SP2 64bitWindows Web Server 2008 R2 64bit

Ubuntu Server Ubuntu Server 14.04 64bitUbuntu Server 14.04 32bitUbuntu Server 12.04 64bitUbuntu Server 12.04.2 32bitUbuntu Server 10.04 64bit

CentOS CentOS 7.0 64bitCentOS 7.1 64bitCentOS 6.5 64bitCentOS 6.3 64bitCentOS 5.11 64bitCentOS 5.11 32bitCentOS 5.8 64bitCentOS 5.5 64bit

Debian Debian 8.2 64bitDebian 8.6.0 64bitDebian 7.5 64bitDebian 7.5 32bit

OpenSUSE OpenSUSE 13.2 64bit

The following table lists the supported OSs of public images used to create special types ofECSs. OSs of ECSs not listed in the table are consistent with those supported for publicimages.

Image Management ServiceUser Guide 1 Overview

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

3

Page 9: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Table 1-3 Special ECSs and OSs supported by them

ECS Supported OS

GPU-optimized (g1) ECS Windows Server 2008 R2 Enterprise SP164bitWindows Server 2012 R2 Standard 64bitWindows Server 2016 DataCenter

GPU-optimized (g2) ECS Windows Server 2008 R2 Enterprise SP164bitWindows Server 2012 R2 Standard 64bit

Disk-intensive ECS CentOS 7.2 64bitCentOS 7.3 64bitCentOS 6.8 64bitSUSE Enterprise Linux Server 11 SP3 64bitSUSE Enterprise Linux Server 11 SP4 64bitSUSE Enterprise Linux Server 12 SP1 64bitSUSE Enterprise Linux Server 12 SP2 64bitRed Hat Enterprise Linux 6.8 64bitRed Hat Enterprise Linux 7.3 64bit

High-performance ECS CentOS 6.8 64bitCentOS 7.2 64bitCentOS 7.3 64bitWindows Server 2008Windows Server 2012Windows Server 2016SUSE Linux Enterprise Server 11 SP3 64bitSUSE Linux Enterprise Server 11 SP4 64bitSUSE Linux Enterprise Server 12 SP1 64bitSUSE Linux Enterprise Server 12 SP2 64bitRed Hat Enterprise Linux 6.8 64bitRed Hat Enterprise Linux 7.3 64bit

1.1.3 Image Formats and OS Types of External Image Files

Image FormatExternal image files in VMDK, VHD, QCOW2, or ZVHD format can be used to createprivate images. You can select an appropriate image format based on your servicerequirements.

Image Management ServiceUser Guide 1 Overview

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

4

Page 10: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

OS TypeFor how to register an image, see section 2.4.3 Registering an External Image File as aPrivate Image. For Linux, if the required OS version is not listed in Table 1-4, Other Linux(64bit) will be selected automatically.

NOTE

Images running OSs not listed in Table 1-4 may fail to be uploaded. You are advised to contact customerservice.

Table 1-4 Supported image OSs

OS Type OS Version

SUSE SUSE Linux Enterprise Server 12 SP2 64bitSUSE Linux Enterprise Server 12 SP1 64bitSUSE Linux Enterprise Server 11 SP4 64bitSUSE Linux Enterprise Server 11 SP3 64bitSUSE Linux Enterprise Server 11 SP3 32bit

Oracle Linux Oracle Linux Server release 7.3 64bitOracle Linux Server release 7.2 64bitOracle Linux Server release 7.0 64bitOracle Linux Server release 6.8 64bitOracle Linux Server release 6.7 64bitOracle Linux Server release 6.5 64bit

Redhat Redhat Linux Enterprise 7.3 64bitRedhat Linux Enterprise 7.2 64bitRedhat Linux Enterprise 7.1 64bitRedhat Linux Enterprise 7.0 64bitRedhat Linux Enterprise 6.8 64bitRedhat Linux Enterprise 6.7 64bitRedhat Linux Enterprise 6.6 64bitRedhat Linux Enterprise 6.6 32bitRedhat Linux Enterprise 6.4 64bitRedhat Linux Enterprise 6.4 32bit

Image Management ServiceUser Guide 1 Overview

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

5

Page 11: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

OS Type OS Version

Ubuntu Ubuntu 16.04 server 64bitUbuntu 14.04.4 server 64bitUbuntu 14.04.4 server 32bitUbuntu 14.04.3 server 64bitUbuntu 14.04.3 server 32bitUbuntu 14.04.1 server 64bitUbuntu 14.04.1 server 32bitUbuntu 14.04 server 64bitUbuntu 14.04 server 32bit

OpenSUSE OpenSUSE 42.2 64bitOpenSUSE 42.1 64bitOpenSUSE 13.2 64bitOpenSUSE 11.3 64bit

CentOS CentOS 7.3 64bitCentOS 7.2 64bitCentOS 7.1 64bitCentOS 7.0 64bitCentOS 7.0 32bitCentOS 6.8 64bitCentOS 6.7 64bitCentOS 6.7 32bitCentOS 6.6 64bitCentOS 6.6 32bitCentOS 6.5 64bitCentOS 6.5 32bitCentOS 6.4 64bitCentOS 6.4 32bitCentOS 6.3 64bitCentOS 6.3 32bit

Debian Debian GNU/Linux 8.7.0 64bitDebian GNU/Linux 8.6.0 64bitDebian GNU/Linux 8.5.0 64bitDebian GNU/Linux 8.4.0 64bitDebian GNU/Linux 8.2.0 64bit

Image Management ServiceUser Guide 1 Overview

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

6

Page 12: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

OS Type OS Version

Fedora Fedora 25 64bitFedora 24 64bitFedora 23 64bitFedora 22 64bit

EulerOS EulerOS 2.2 64bit

NOTE

If you upload an image file not listed in Table 1-4, the OS type will be set to Other Linux (64bit).

1.2 Charging

1.2.1 Charging StandardThe IMS service and the OS license are free. You are required to pay for storing your privateimages in the Object Storage Service (OBS) bucket. You can use the OBS storage free ofcharge during the trial period.

1.3 IMS Access and Usage

1.3.1 Accessing IMSThe public cloud system provides web-based service management. You can use themanagement console or HTTPS-based application programming interfaces (APIs) to managethe service.

l APIYou can access IMS using APIs. For details, see the Image Management Service APIReference.

l Management consoleYou can perform other operations provided by the IMS service on the managementconsole. If you have registered an account in the public cloud system, log in to themanagement console and choose Image Management Service on the homepage.

1.3.2 IMS Relationships with Other Servicesl Elastic Cloud Server (ECS)

You can use an image to create an ECS or convert an ECS to an image.l Object Storage Service (OBS)

Images are stored in OBS buckets.l Key Management Service (KMS)

Keys used for encrypting images are provided by KMS.

Image Management ServiceUser Guide 1 Overview

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

7

Page 13: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

2 Getting Started

2.1 IntroductionPublic images are the standard images provided by the public cloudsystem. You can use theseimages to create ECSs.

Private images are visible only to their creators. Private images contain OSs, pre-installedpublic applications, and users' private applications. Creating ECSs using private images canreduce ECS configuration time. Private images can be created using an ECS or an externalimage file.

This chapter describes the following private image creation methods:

l Create a Windows private image using an ECS.l Create a Linux private image using an ECS.l Create a Linux private image using an external image file.

2.2 Creating a Windows Private Image Using an ECS

2.2.1 OverviewYou can create a Windows private image using an ECS running Windows.

If the Windows ECS that will be used to create the private image is using a static IP address,you must log in to the ECS and set its IP address obtaining mode to DHCP before using it tocreate a private image. This section describes how to configure a Windows ECS and use it tocreate a Windows private image.

2.2.2 Configuring a Windows ECS

ScenariosIf the Windows ECS that will be used to create a private image is using a static IP address, setits IP address obtaining mode to DHCP.

This section uses Windows Server 2008 R2 as an example to describe how to configureDHCP on an ECS running Windows. For details about how to configure DHCP on ECSsrunning other OSs, see the relevant OS documentation.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

8

Page 14: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

PrerequisitesYou have logged in to the ECS that will be used to create the private Windows image.

For how to log in to an ECS, see the Elastic Cloud Server User Guide.

Procedure1. On the ECS, choose Start > Control Panel.2. Click Network and Internet Connections.3. Click Network and Sharing Center. Figure 2-1 shows the Network and Sharing

Center window.

Figure 2-1 Network and Sharing Center

4. Select the connection configured with the static IP address. For example, click LocalArea Connection 2.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

9

Page 15: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 2-2 Local Area Connection 2 Status

5. Click Properties and select the configured Internet protocol version.6. On the General tab, select Obtain an IP address automatically and Obtain DNS

server address automatically and click OK. Figure 2-3 shows the dialog box forconfiguring the IP address obtaining mode.

NOTE

You are advised to record the original network information so that you can restore it if necessary.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

10

Page 16: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 2-3 Configuring the IP address obtaining mode

The system will automatically obtain an IP address.

(Optional) Install the GPU driver.

If an independent GPU is configured for the ECS, you must first install the GPU driver beforecreating the ECS image.

7. Visit the official NVIDIA website http://www.nvidia.com/grid-eval to obtain the GPUdriver software package. Select 4.1 as the NVIDIA GRID version and software packageGRID for UVP.

8. Copy the Windows driver package in the downloaded software package to the ECS. Thedriver package version must match the ECS OS version.

9. Install the driver on the ECS.10. Set the ECS resolution to 1920 x 1080 (recommended) or smaller.

(Optional) Enable the Remote Desktop Connection function.

You must enable the Remote Desktop Connection function of the ECSs if you want to connectto them using this function subsequently.

This function must be enabled for GPU-deployed ECSs.

11. Choose Start, right-click Computer, and choose Properties from the shortcut menu.12. Click Remote settings.13. In the Remote tab, select Allow connections from computers running any version of

Remote Desktop (less secure).14. Click OK.15. Choose Start > Control Panel and navigate to Windows Firewall.16. Choose Allow a program or feature through Windows Firewall in the left pane.17. Select programs and features that are allowed through by the Windows firewall for

Remote Desktop based on user network requirements and click OK in the lower part.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

11

Page 17: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 2-4 Configuring Remote Desktop

2.2.3 Installing Cloudbase-Init

Scenarios

To ensure that ECSs created using a private image support custom configurations, you areadvised to install Cloudbase-Init before creating the private image. To install Cloudbase-Initon an ECS running Windows, download Cloudbase-Init from the official website. You need toconfigure an elastic IP address for the ECS.

If you do not install Cloudbase-Init, you can log in to the ECS only with the original imagepassword, and you will be unable to customize ECS configurations.

Prerequisitesl An elastic IP address has been bound to the Windows ECS.l You have logged in to the Windows ECS.l The IP address obtaining mode of the Windows ECS has been set to DHCP.

Procedure1. On the Windows Start menu, choose Control Panel > Programs >Programs and

Features to check whether Cloudbase-Init is installed.– If yes, go to 16.– If no, go to 2.

2. Check whether the OS is a Windows desktop version:– If yes, go to 3.– If no and the OS is a Windows Server version, go to 4.

3. Perform the following operations to ensure that the administrator account is enabled(Windows 7 is used as an example):

a. Click Start and choose Control Panel > System and Security > AdministrativeTools.

b. Double-click Computer Management.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

12

Page 18: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

c. Choose System Tools > Local Users and Groups > Users.d. Right-click Administrator and select Properties.e. Ensure that Account is disabled is not selected.

4. Download the Cloudbase-Init installation package.Download the appropriate version of Cloudbase-Init installation package based on theOS bit version from the Cloudbase-Init official website http://www.cloudbase.it/cloud-init-for-windows-instances/.Cloudbase-Init has two versions, the stable and Beta version.The current stable version v0.9.9 has security vulnerabilities because it uses fixedpasswords for its internal accounts. You are advised to install v0.9.10 or the Betaversion.To obtain the stable version, visit the following paths:– 64-bit: https://www.cloudbase.it/downloads/

CloudbaseInitSetup_Stable_x64.msi– 32-bit: https://www.cloudbase.it/downloads/

CloudbaseInitSetup_Stable_x86.msiTo obtain the Beta version, visit the following paths:– 64-bit: https://www.cloudbase.it/downloads/CloudbaseInitSetup_x64.msi– 32-bit: https://www.cloudbase.it/downloads/CloudbaseInitSetup_x86.msi

5. Double-click the Cloudbase-Init installation package.6. Click Next.7. Select I accept the terms in the License Agreement, and click Next.8. Retain the default path and click Next.9. In the Configuration options window, enter Administrator for Username and select

COM1 for Serial port for logging. Figure 2-5 shows the parameters to be specified.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

13

Page 19: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 2-5 Parameters

10. Click Next.11. Click Install.12. In the Files in Use dialog box, select Close the application and attempt to restart

them and click OK.13. Check whether the OS is a Windows desktop version:

– If yes, go to 15.– If no, go to 14.

14. In the Completed the Cloudbase-Init Setup Wizard window, ensure that Run Sysprepto create a generalized Image. This is necessary if you plan to duplicate thisinstance, for example by creating a Glance image and Shutdown when Sysprepterminates are not selected.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

14

Page 20: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 2-6 Completing the Cloudbase-Init installation

15. Click Finish.16. Add configuration item netbios_host_name_compatibility=false to the last row in the

C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf file.This will allow the host name to contain a maximum of 63 characters.

NOTE

The length of NetBIOS is limited by Windows and can contain at most 15 characters.

17. Release the current DHCP address so that created ECSs can obtain the correct addresses.In the Windows command line, run the following command to release the current DHCPaddress:ipconfig /release

NOTE

This operation will interrupt network connection and adversely affect the use of the ECS. After theECS is restarted, network connection will restore.

18. Check whether the ECS needs to be added to a domain.– If yes, go to 19.– If no, the installation is complete.

19. Perform the following Sysprep operations on Windows:– Enter the Cloudbase-Init installation directory.

In this example, C:\Program Files\Cloudbase Solutions\ is the Cloudbase-Initinstallation directory. Switch to the root directory of drive C:\ and run the followingcommand to enter the installation directory:cd C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf

– Run the following command to encapsulate Windows:

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

15

Page 21: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /unattend:Unattend.xmlAfter the command is executed, the ECS will stop automatically.

NOTE

l Ensure that /unattend:Unattend.xml is contained in the preceding command.Otherwise, the username, password, and other important configuration information ofthe ECS will be reset, and you must configure the OS manually when you use the ECScreated using the Windows private image.

l After the Sysprep operation is performed on the ECS running Windows Server 2012 orWindows Server 2012 R2, the administrator account and password of the ECS will bedeleted. You need to log in to the ECS and configure the password of the administratoraccount. After this, the ECS password configured on the management console willbecome invalid. Keep the new password secure.

l If the domain account is required to log in to Windows, perform the Sysprep operationbefore creating the private image. For details about the impact of the Sysprep operation,see Why Is the Sysprep Operation Required for Creating Private Images Using aWindows ECS?

l Do not start a Windows ECS on which the Sysprep operation has been performed.Otherwise, you need to perform the Sysprep operation again on the ECS.

l The cloudbase-init account of a Windows ECS is an internal account of the Cloudbase-Init agent. This account is used for obtaining metadata and completing relevantconfiguration when the Windows ECS starts. If you modify or delete this account, oruninstall the Cloudbase-Init agent, you will be unable to inject the initialized customizedinformation into an ECS created using a Windows private image. Therefore, you areadvised not to modify or delete the cloudbase-init account.

2.2.4 Creating a Windows Private Image

ScenariosCreate a Windows private image using an ECS.

Prerequisitesl A Windows ECS is available and is stopped.l The IP address obtaining mode of the Windows ECS NIC has been set to DHCP. For

details, see 2.2.2 Configuring a Windows ECS.l Cloudbase-Init has been installed.

Procedure1. Log in to the management console.2. Under Computing, click Image Management Service.3. On the Image Mgmt Service page, click Create Private Image.4. On the image configuration page, click Select and select the required ECS on the

displayed page. Set the required information, such as Name and Description on thedisplayed page shown in Figure 2-7 .

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

16

Page 22: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 2-7 Creating an image

5. Click Apply Now.

6. Confirm image parameters as prompted.

7. Read and agree to the ECS agreement and system image disclaimer and click SubmitApplication.

8. Switch back to the Image Mgmt Service page to view the image status.

The time required to create the image varies depending on the image file size. Generally,creating an image takes about 20 minutes. The image is created when the image status onthe Image Mgmt Service changes to Normal.

NOTE

l Do not perform any operation on the selected ECS or its associated resources during imagecreation.

l An ECS created using an encrypted image is an encrypted ECS. The key of the encrypted ECSis the same as that of the encrypted image.

2.3 Creating a Linux Private Image Using an ECS

2.3.1 OverviewYou can create a Linux private image using an ECS running Linux.

Before creating the Linux private image, you need to log in to the Linux ECS used to createthe image and perform the following operations:

l Query and configure NIC attributes.

l Query and delete files in the network rule directory.

l Install Cloud-Init.

l Query and detach EVS data disks from the ECS.

The following introduces how to configure a Linux ECS and use it to create a private Linuximage.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

17

Page 23: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

2.3.2 Querying and Configuring NIC Attributes

ScenariosIf the Linux ECS that will be used to create a private image is using a static IP address,configure the ECS NIC to obtain an IP address using DHCP.

The configuration method varies depending on OSs.

l For Red Hat, CentOS, Oracle Enterprise Linux, and EulerOS OSs, use vi editor to addPERSISTENT_DHCLIENT="y" to the configuration file /etc/sysconfig/network-scripts/ifcfg-ethX.

l For SUSE Linux Enterprise OSs, use vi editor to set DHCLIENT_USE_LAST_LEASEto no in the configuration file /etc/sysconfig/network/dhcp.

l For Ubuntu 12.04, upgrade dhclient to ISC dhclient 4.2.4 so that the NIC canconsistently obtain IP addresses from the DHCP server. For the detailed upgrade method,see associated OS documentations.

This section uses Ubuntu14.04 as an example to describe how to query and configure NICattributes.

PrerequisitesYou have logged in to the ECS used to create the Linux private image.

For how to log in to an ECS, see the Elastic Cloud Server User Guide.

Procedure1. Run the following command on the ECS to open the /etc/network/interfaces file using

the vi editor and query the IP address obtaining mode:vi /etc/network/interfaces– If the IP address obtaining mode of all NICs is DHCP, as shown in Figure 2-8,

enter :q to exit the vi editor.

Figure 2-8 DHCP IP address obtaining mode

– If the IP address obtaining mode of a NIC is static, as shown in Figure 2-9, go tostep 2.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

18

Page 24: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 2-9 Static IP address obtaining mode

2. Press i to enter the editing mode.3. Delete the static IP address configuration and configure the NIC to obtain an IP address

using DHCP. Figure 2-10 shows the configuration commands.You can insert the number sign (#) in front of each line of the static IP addressconfiguration to comment it out.

Figure 2-10 Setting the IP address obtaining mode of a NIC to DHCP

If the ECS has multiple NICs, configure all other NICs in the same way. Figure 2-11shows the configuration commands.

Figure 2-11 Setting the IP address obtaining mode of multiple NICs to DHCP

4. Press Esc. Type :wq and press Enter.The system saves the configuration and exits the vi editor.

2.3.3 Querying and Deleting Network Rule Files

ScenariosThis section describes how to query and delete network rule files when using an ECS to createa Linux private image.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

19

Page 25: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Prerequisites

You have logged in to the ECS that is used to create the private Linux image.

Procedure1. Run the following command on the ECS to view the files in the network rule directory:

ls -l /etc/udev/rules.dCheck whether the command output contains the following information (the file namecontains both persistent and net):70-persistent-net.rules

– If yes, go to step 2.– If no, you do not need to clear the files in the network rule directory.

2. Run the following commands to delete the rule files whose names contain persistent andnet:rm /etc/udev/rules.d/30-net_persistent-names.rulesrm /etc/udev/rules.d/70-persistent-net.rulesThe italic content in the commands varies based on your service environment.

NOTE

Do not restart the ECS after deleting the network rule files. Otherwise, the deleted rule files will begenerated again.

2.3.4 Installing Cloud-Init

Scenarios

To ensure that ECSs created using private images support custom configurations, you areadvised to install Cloud-Init before creating private images. To install Cloud-Init on an ECSrunning Linux, download Cloud-Init from the official website. Therefore, you need toconfigure an elastic IP address for the ECS.

If you do not install Cloud-Init, you can log in to the ECS only with the original imagepassword, and cannot customize ECS configuration.

NOTICEThe public cloud platform has supported Cloud-Init since November 28, 2016. This feature isavailable only in Eastern China and Southern China, and will be available in Northern andNortheastern China in the near future.The Cloud-Init feature described in this document applies only in Eastern and SouthernChina. If you are not in these regions, click Document Download in the navigation tree onthe left to obtain the Image Management Service User Guide (Northern and NortheasternChina).

Prerequisitesl An elastic IP address has been bound to the Linux ECS.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

20

Page 26: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

l You have logged in to the Linux ECS.

l DHCP has been enabled for the Linux ECS.

Procedure

Check whether Cloud-Init is installed.

The methods of checking whether Cloud-Init is installed vary depending on the OSs. Take theCentOS 6 as an example. Run the following command to check whether Cloud-Init isinstalled:

rpm -qa |grep cloud-init

l Cloud-Init has been installed if the following command output is displayed:cloud-init-0.7.5-10.el6.centos.2.x86_64

– Check whether to continue to use the certificate in the ECS OS. If the certificate isno longer used, delete it.

n If the certificate is stored in a directory of user root, such as .ssh/authorized_keys in the /$path/$to/$root directory, run the followingcommands:

cd /root/.ssh

rm authorized_keys

n If the certificate is not stored in a directory of user root, such as .ssh/authorized_keys in the /$path/$to/$none-root directory, run the followingcommands:

cd /home/centos/.ssh

rm authorized_keys

– Run the following command to ensure that the ECS created using the Linux imagesupports login using the certificate:

sudo rm -rf /var/lib/cloud/*

NOTE

After the configuration is complete, do not restart the ECS. Otherwise, you must configure theECS again.

l If Cloud-Init has not been installed, install it.

Install Cloud-Init.

The methods of installing Cloud-Init on ECSs running different OSs vary. Perform theinstallation operations as user root.

The following describes how to install Cloud-Init on ECSs running SUSE Linux, CentOS,Red Hat, Fedora, Debian, and Ubuntu. For other types of OSs, install the required type ofCloud-Init. For example, you need to install coreos-cloudinit on ECSs running CoreOS.

l SUSE Linux

Table 2-1 lists the Cloud-Init's network installation addresses for different versions ofSUSE Linux OSs.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

21

Page 27: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Table 2-1 Cloud-Init's network installation addresses for different versions of SUSELinux OSs

OS Type Version How to Obtain

SUSE SUSE EnterpriseLinux Server 12 SP2

http://download.opensuse.org/repositories/Cloud:/Tools/SLE_12_SP2/Cloud:Tools.repo

SUSE EnterpriseLinux Server 12 SP1

http://download.opensuse.org/repositories/Cloud:/Tools/SLE_12_SP1/Cloud:Tools.repo

SUSE EnterpriseLinux Server 11 SP4

http://download.opensuse.org/repositories/Cloud:/Tools/SLE_11_SP4/Cloud:Tools.repo

SUSE EnterpriseLinux Server 11 SP3

https://anorien.csc.warwick.ac.uk/mirrors/download.opensuse.org/repositories/Cloud:/Tools/SLE_11_SP3/Cloud:Tools.repo

OpenSUSE openSUSE Leap42.3

http://download.opensuse.org/repositories/Cloud:/Tools/openSUSE_Leap_42.3/Cloud:Tools.repo

openSUSE Leap42.2

http://download.opensuse.org/repositories/Cloud:/Tools/openSUSE_Leap_42.2/Cloud:Tools.repo

openSUSE Leap42.1

http://download.opensuse.org/repositories/Cloud:/Tools/openSUSE_Leap_42.1/Cloud:Tools.repo

Take the SUSE Enterprise Linux Server 11 SP3 as an example. Perform the followingsteps to install Cloud-Init:

a. Log in to the ECS used to create the private Linux image.b. Run the following command to install the network installation source for SUSE

Enterprise Linux Server 11 SP3:zypper arhttp://ftp5.gwdg.de/pub/opensuse/repositories/Cloud:/Tools/SLE_11_SP3/Cloud:Tools.repo

c. Run the following command to update the network installation source:zypper refresh

d. Run the following command to install Cloud-Init:zypper install cloud-init

e. Run the following command to enable Cloud-Init to automatically start upon systemstartup:

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

22

Page 28: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

service cloud-init-local start; service cloud-init start; service cloud-config start;service cloud-final startchkconfig cloud-init-local on; chkconfig cloud-init on; chkconfig cloud-configon; chkconfig cloud-final on

f. Run the following command to check whether Cloud-Init will automatically startwhen the system starts:service cloud-init-local status; service cloud-init status; service cloud-configstatus; service cloud-final status

l CentOS and RedHatTable 2-2 lists the Cloud-Init's network installation addresses for CentOS and RedHat.

Table 2-2 Cloud-Init's network installation addresses for CentOS and RedHat

OS Type Version How to Obtain

CentOS 7 series https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm

6 series 32-bit https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

6 series 64-bit https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

RedHat 7 series https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm

6 series 32-bit https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

6 series 64-bit https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

The following uses CentOS 6.5 64bit as an example to describe how to install Cloud-Init.– CentOS 6.5 64bit

i. Log in to the ECS used to create the private Linux image.ii. Run the following command to install the network installation source for

CentOS 6.5 64-bit:yum install https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

iii. Run the following command to install Cloud-Init:yum install cloud-init

l FedoraBefore installing Cloud-Init, ensure that the network installation source address has beenconfigured for the OS by checking whether the /etc/yum.repo.d/fedora.repo filecontains the installation source address of the software package. If it does not, configurethe installation source address of the software package by following the instructions atthe Fedora official website.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

23

Page 29: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Run the following command to install Cloud-Init:yum install cloud-init

l Debian and UbuntuBefore installing Cloud-Init, ensure that the network installation source address has beenconfigured for the OS by checking whether the /etc/apt/sources.list file contains theinstallation source address of the software package. If it does not, configure theinstallation source address of the software package by following the instructions at theDebian or Ubuntu official website.Run the following command to install Cloud-Init:apt-get updateapt-get install cloud-init

NOTICEFor SUSE and OpenSUSE, perform the following steps to disable dynamic change of the ECSname:1. Run the following command to open the dhcp file using the vi editor:

vi etc/sysconfig/network/dhcp2. Change the value of DHCLIENT_SET_HOSTNAME in the dhcp file to no.

Configure permissions of the user for logging in to the ECS.

1. Select the type of the user.– If you select a common user (not user root), disable the SSH permissions of user

root and disable remote login to the ECS using the password to improve security ofthe ECS. Perform steps 2 to 5.

– If you select user root, enable the SSH permissions of user root and enable remotelogin to the ECS using the password. Perform steps 6 to 8.

2. Run the following command to open the sshd_config file using the vi editor:vi /etc/ssh/sshd_config

3. Change the value of PasswordAuthentication in the sshd_config file to no.

NOTE

For SUSE and openSUSE, change the values of the following parameters in the sshd_config fileto no:

l PasswordAuthentication

l ChallengeResponseAuthentication

4. Run the following command to open the cloud.cfg file using the vi editor:vi /etc/cloud/cloud.cfg

5. Disable the SSH permissions of user root, add a common user (used for logging in to theECS using VNC), and configure a password for the added user and assign the sudopermissions to it.Take Ubuntu as an example.– Disable the SSH permissions of user root. Set the value of field disable_root to

true, indicating that the SSH permissions are disabled (false indicates that the SSH

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

24

Page 30: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

permissions are enabled). This method applies to SUSE, openSUSE, Debian,Ubuntu, and Fedora Linux. In some OSs, including Red Hat, CentOS, and OracleLinux, 1 indicates that the SSH permissions are disabled, and 1 indicates that theSSH permissions are enabled.# Adapted default config users: - default # If this is set, 'root' will not be able to ssh in and they # will get a message to login instead as the above \$user (ubuntu) disable_root: true

– Add a common login user to the configuration file, configure a password for theuser, and assign the sudo permissions to it.

NOTICEEnsure that the configuration file format (such as alignment and spaces) isconsistent with the provided example.

system_info: # This will affect which distro class gets used distro: rhel # Default user name + that default users groups (if added/used) default_user: name: linux //Username for login lock_passwd: False //Login using a password is enabled. Note that some OSs use value 0 to enable the password login. gecos: Cloud User groups: users //Optional. Add users to other groups that have been configured in /etc/group. passwd: $6$I63DBVKK$Zh4lchiJR7NuZvtJHsYBQJIg5RoQCRLS1X2Hsgj2s5JwXI7KUO1we8WYcwbzeaS2VNpRmNo28vmxxCyU6LwoD0sudo: ["ALL=(ALL) NOPASSWD:ALL"] //Grant user sudo all root rights. shell: /bin/bash //Execute shell in bash mode. # Other config here will be given to the distro class and/or path classes paths: cloud_dir: /var/lib/cloud/ templates_dir: /etc/cloud/templates/ ssh_svcname: sshd

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

25

Page 31: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

NOTICEThe value of passwd is a password encrypted using SHA512 that is used as anexample. For details about more parameters, see https://cloudinit.readthedocs.io/en/latest/topics/examples.html.For details about how to encrypt a password and generate ciphertext, see thefollowing (encrypting password cloud.1234 is used as an example):[root@** ~]# python -c "import crypt, getpass, pwd; print crypt.mksalt()"$6$I63DBVKK[root@** ~]# python -c "import crypt, getpass, pwd; print crypt.crypt('cloud.1234','\$6\$I63DBVKK')"$6$I63DBVKK$Zh4lchiJR7NuZvtJHsYBQJIg5RoQCRLS1X2Hsgj2s5JwXI7KUO1we8WYcwbzeaS2VNpRmNo28vmxxCyU6LwoD0

6. Run the following command to open the /etc/cloud/cloud.cfg file using the vi editor:vi /etc/cloud/cloud.cfgEnable remote login using the password of user root and enable the SSH permissions ofuser root. Take CentOS 6.7 as an example. If the value of disable_root in theconfiguration file is 1, the permissions are disabled. If the value is 0, the permissions areenabled. In some OSs, the value true indicates that the permissions are disabled andfalse indicates that the permissions are enabled). Set the value of disable_root to 0 andthat of ssh_pwauth to 1.users: -root

disable_root: 0ssh_pwauth: 1

7. Run the following command to open the /etc/ssh/sshd_config file using the vi editor:vi /etc/ssh/sshd_config

8. Change the value of PasswordAuthentication in the sshd_config file to yes.

NOTE

For SUSE and openSUSE, change the values of the following parameters in the sshd_config fileto yes:l PasswordAuthenticationl ChallengeResponseAuthentication

Figure 2-12 indicates that the current user is centos, and password login is available.

Figure 2-12 User settings

Check whether the Cloud-Init configuration is successful.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

26

Page 32: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Run the following command (if no error occurs, Cloud-Init is properly configured):

cloud-init init --local

If Cloud-Init is properly installed, the version information will be displayed and no errorinformation is displayed. such as a message indicating lack of files, will be displayed. If amessage is displayed indicating a configuration error, contact technical support.

2.3.5 Querying and Detaching EVS Data Disks from the ECS

ScenariosYou must detach all EVS data disks attached to the ECS before using it to create a privateimage, because if the ECS used to create the private image has multiple EVS data disksattached, new ECSs created using the private image may be unavailable. Therefore, you mustdetach all EVS data disks attached to the ECS before using it to create a private image.

PrerequisitesYou have logged in to the ECS used to create the private Linux image.

Procedure1. Run the following command to check the EVS disks attached to the ECS:

mount– If the command output does not contain any EVS disk information, no EVS data

disks need to be detached.– If information similar to the following is displayed, go to 2:

/dev/xvde1 on /mnt/test type ext4 (rw)2. Ensure that no data read and write operations are being performed on the EVS disks that

will be detached. Otherwise, the detaching operation will fail.Run the following command to detach the EVS data disks attached to the ECS:umount /dev/xvde1

3. Run the following command to edit the fstab file:vi /etc/fstab

4. Delete the configuration information of the EVS data disks from the fstab file.The /etc/fstab file contains information about the file systems and storage devicesautomatically attached to the ECS when the ECS starts. The configuration informationabout data disks automatically attached to the ECS needs to be deleted. For example, thelast row shown in Figure 2-13 is the data disk configuration information to be deletedfrom the fstab file.

Figure 2-13 EVS configuration information contained in the fstab file

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

27

Page 33: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

5. Run the following command to check the data partitions attached to the ECS:mountIf the command output does not contain information about the EVS data disks, they havebeen successfully detached.

2.3.6 Creating a Private Linux Image

Scenarios

Create a private Linux image using an ECS.

Prerequisitesl A Linux ECS is available and is stopped.l The IP address assignment mode of the Linux ECS NIC has been set to DHCP.l The udev rules on the Linux ECS have been deleted.l Cloud-Init has been installed and configured.l All EVS data disks attached to the Linux ECS have been detached.

Procedure1. Log in to the management console.2. Under Computing, click Image Management Service.3. On the Image Mgmt Service page, click Create Private Image.4. On the image configuration page, click Select and select the required ECS on the

displayed page.5. Set the required information, such as Name and Description on the displayed page

shown in Figure 2-14 .

Figure 2-14 Creating an image

6. Click Apply Now.7. Confirm image parameters as prompted.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

28

Page 34: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

8. Read and agree to the ECS agreement and system image disclaimer and click SubmitApplication.

9. Switch back to the Image Mgmt Service page to view the image status.The time required to create the image varies depending on the image file size. Normally,creating an image takes about 20 minutes. The image is created when the image status onthe Image Mgmt Service changes to Normal.

NOTE

l Do not perform any operations on the selected ECS or its associated resources during imagecreation.

l An ECS created using an encrypted image is an encrypted ECS. The key of the encrypted ECSis the same as that of the encrypted image.

2.4 Creating a Linux Private Image Using an ExternalImage File

2.4.1 Overview

Application ScenariosIf you have an external Linux image file and the file meets the type and OS requirementslisted in 1.1.3 Image Formats and OS Types of External Image Files, you can use thisexternal image file to create a private Linux image.

Creation ProcessTo initialize an image, delete network rule files, configure the NIC attribute, and install andconfigure Cloud-Init. For details, see section What Initial Configuration Needs to BePerformed for an External Image File Used to Create a Private Image?.

The procedure of creating a private image using an external image file varies depending onwhether the image file has been initialized.

l If the external image file has been initialized, the procedure of creating a private image isas follows.

Figure 2-15 Creating a private image using an initialized image file

The procedure is as follows:

a. Upload the external image file to your OBS bucket. For details, see 2.4.2Uploading an External Image File.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

29

Page 35: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

b. On the management console, select the uploaded image file and register it as aprivate image. For details, see 2.4.3 Registering an External Image File as aPrivate Image.

l If the external image file has not been initialized, the procedure of creating a privateimage is as follows.

Figure 2-16 Creating a private image using an uninitialized image file

The procedure is as follows:

a. Upload the external image file to your OBS bucket. For details, see 2.4.2Uploading an External Image File.

b. On the management console, select the uploaded image file and register it as aprivate image that has not been initialized. For details, see 2.4.3 Registering anExternal Image File as a Private Image.

c. Use the private image to create an ECS. For details, see 2.4.4 Creating an ECS.d. Log in to the ECS created in c remotely and configure it. For details, see 2.4.5

Configuring a Linux ECS.

NOTE

Linux ECSs running on the public cloud platform must use PVOPS.

e. Create a private image in normal state using the ECS. For details, see 2.4.6Creating a Private Image Using an ECS.

Restrictions and Limitationsl Image files in QCOW2 format must not be encrypted.l Images with EVS data disks cannot be created. Therefore, external image files contain

only EVS system disks.l If the private image uses Linux, the /etc/fstab file must not contain configuration items

for automatic data disk attaching. Otherwise, ECSs created using a private image cannotbe logged in to.

l An external image file cannot be greater than 128 GB.l The external image file system disk size must be greater than 1 GB and less than or equal

to 255 GB.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

30

Page 36: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

l Ensure that the image file contains the password or certificate used to log in to the ECScreated using the image, or ensure that Cloud-Init has been installed and configured inthe image system.

l Username root and its password must have been configured for the private image thatuses Linux. In subsequent operations, you may use the username and password to log into and configure the ECS.

l To prevent ECSs created using the image file from being attacked, ensure that the initialpassword of the image file contains at least the following types of characters:– Uppercase letters– Lowercase letters– Digits– Special characters, including !@$%^-_=+[{}]:,./?

l The image must support the Integrated Drive Electronics (IDE) and ParaVirtualOPerationS (PVOPS) device driver. The driver must be automatically loaded when thesystem starts.

l The boot partition and system partition of the image must be on the same disk.l You must use BIOS to boot the ECS used to create the image.l If the disk of the external image file uses specific encryption mechanisms, the ECS

created using the private image may become unavailable.l Some drivers are not supported on the public cloud platform. Therefore, you cannot use

external image files containing OEM OSs to create private images.l OSs in external image files cannot be bound to specified hardware.l The OSs in your external image files must support full virtualization.l If the external image file uses the LVM as the system disk, ECSs created using the

private image from the external image file do not support file injection.

2.4.2 Uploading an External Image FileUpload the external image file to your OBS bucket. For details, see the Object StorageService User Guide. Any image file uploaded to an OBS bucket must be an unencrypted oneor one encrypted using SSE-KMS.

2.4.3 Registering an External Image File as a Private Image

Scenarios

This section describes how to register an uninitialized image file as an uninitialized privateimage on the public cloud platform, or register an initialized image file as a private image innormal state.

Prerequisites

You have uploaded the external image file to the OBS bucket.

Procedure1. Log in to the management console.2. Under Computing, click Image Management Service.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

31

Page 37: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

3. On the Image Mgmt Service page, click Create Private Image.Select Image File to use an external image file as the source, as shown in Figure 2-17.

Figure 2-17 Registering an external image file as a private image

4. Click Select to choose the external image file.5. Select the bucket that stores the external image file in the left navigation tree and select

the external image file. Figure 2-18 shows the page for you to select the bucket and theexternal image file.

Figure 2-18 Select Image File

6. Click OK.7. Check whether the image file has been initialized.

– If yes, select Initial configuration has been performed for this image file..– If no, go to 8.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

32

Page 38: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

NOTE

To initialize an image, delete network rule files, configure the NIC attribute, and install andconfigure Cloud-Init. For details, see section What Initial Configuration Needs to BePerformed for an External Image File Used to Create a Private Image?.

8. Enter the image name.9. (Optional) Select the OS required by the image.

To ensure that images can be created and used, select the OS consistent with that of theimage file. If you do not select an OS for the image file, the system will automaticallyidentify the OS of the image file.

NOTE

l If the system detects that the image file OS is different from that you configure, the OSdetected by the system will prevail.

l If the system cannot detect the OS of the image file, the OS you select will prevail.

l If the OS you select or identified by the system is inconsistent with that of the actual image,ECSs created using this image may be affected. For detailed impact, see section What ImpactWill Be Brought by an Inconsistency Between the Image OS I Select or Identified by theSystem and That of the Actual Image During Creation of a Private Image Using anExternal Image File?.

10. (Optional) Encrypt the image.If the image needs to be encrypted, select KMS encryption and select the key to be usedfrom the list of keys. For how to encrypt an image, see section 3.8 Encrypting anImage.

NOTE

If you select KMS encryption, the system will create a default master private key ims/default foryou. You can also select a private key from the private key list.

11. Enter a system disk size and the image description as required.12. Select Enable automatic configuration. The system will perform the following

operations on the image file:Modify the grub and syslinux configuration files to add the OS kernel boot parametersand change the disk partition name to UUID=UUID of the disk partition.– Change the names of the disk partitions in the /etc/fstab file to UUID=UUID of the

disk partition.– Check whether the initrd file has the Xen and IDE drivers. If no, load the Xen and

IDE drivers.– Modify the xwindows configuration file /etc/X11/xorg.conf to prevent display

failures.– Delete services of VMware tools.

If the image file has the preceding configuration, you can choose not to selectEnable automatic configuration. Otherwise, select Enable automaticconfiguration.

13. Click Apply Now.14. On the resource details page, confirm the specifications and click Submit Order.

NOTE

The time required for image registration is determined by the image file size. You may need to wait along period of time for the external image file to be successfully registered as a private image that is notinitialized.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

33

Page 39: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

2.4.4 Creating an ECS

Scenarios

Create an ECS using a private image that is not initialized.

Prerequisites

The private image that is not initialized is available.

Procedure1. Log in to the management console.2. Under Computing, click Image Management Service.3. On the Image Mgmt Service page, click the Private Image tab to switch to the page

that displays all private images.4. Locate the row that contains the newly registered private image that is not initialized,

and click Apply for ECS in the Operation column to create an ECS. You need toconfigure and delete this ECS later. Therefore, you are advised to choose the on-demandcharging mode when creating it.

5. Complete ECS creation as prompted.For how to create an ECS, see the Elastic Cloud Server User Guide.If the image file system has Cloud-Init installed and configured, log in to the ECS usingthe password as prompted. If the image file system does not have Cloud-Init installed,log in to the ECS using the password or certificate contained in the image file.

2.4.5 Configuring a Linux ECS

Scenarios

Configure the ECS created using the private image which is not initialized on the public cloudplatform to ensure that the ECS can be properly used.

The following describes how to configure a Linux ECS.

Procedure1. Log in to the Linux ECS.

For how to log in to an ECS, see the Elastic Cloud Server User Guide.

2. Check whether the private IP address of the ECS is consistent with that displayed on themanagement console. The methods of checking this vary depending on the OSs. TakeCentOS 6 as an example and run the following command to check the private IP addressof the ECS:ifconfigIf the IP address is incorrect, check and delete network udev rules on the Linux ECS. Fordetails, see 2.3.3 Querying and Deleting Network Rule Files.

3. Check and configure the IP address assignment mode of the ECS NIC to DHCP. If theLinux ECS is using a static IP address, configure it by following the instructionsprovided in 2.3.2 Querying and Configuring NIC Attributes.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

34

Page 40: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

4. Enable SSH for remote access and ensure that your host firewall (such as Linux iptables)allows access to SSH.

5. Check whether Cloudbase-Init has been installed and configured:– If yes, go to 6.– If no, install and configure Cloudbase-Init by following the instructions in 2.3.4

Installing Cloud-Init.6. Perform the following steps to check and delete automatic attaching information about

data disks in the /etc/fstab configuration file to prevent adverse impacts on future datadisk attaching operations:– Run the following command to edit the fstab file:

vi /etc/fstab– Delete the configuration information about relevant data disks from the fstab file.

The /etc/fstab file contains configuration information about all disks automaticallyattached to the ECS when the ECS starts. Such configuration information needs tobe deleted. For example, the last row shown in Figure 2-19 is the data diskconfiguration information which needs to be deleted from the fstab file.

Figure 2-19 EVS configuration information contained in the fstab file

NOTE

l To use an image to create a memory-optimized generation II (m2) ECS, ensure that the virtio driveris installed.

l To use an image to create a high-performance generation II (h2) ECS, ensure that the VirtIO andInfiniBand drivers are installed. Download the appropriate version of the InfiniBand NIC driverbased on the IB type from the Mellanox official website and install the driver by following theinstructions provided by Mellanox.

InfiniBand NIC type: Mellanox Technologies ConnectX-4 Infiniband HBA (MCX455A-ECAT)

Mellanox official website: http://www.mellanox.com/

2.4.6 Creating a Private Image Using an ECSSelect the private image creation method based on the ECS OS. If the ECS runs Linux, createa private image using the ECS by following the steps provided in 2.3.6 Creating a PrivateLinux Image.

2.4.7 (Optional) Cleaning Up the Environment

Scenarios

The private image registered in 2.4.3 Registering an External Image File as a PrivateImage and the ECS created in 2.4.4 Creating an ECS incur additional fees. Therefore, you

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

35

Page 41: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

are advised to perform the following steps to clean up the environment after the private imageis created.

Procedure1. Delete the uninitialized private image registered using the external image file. For

details, see 3.3 Deleting an Image.2. Delete the ECS created in 2.4.3 Registering an External Image File as a Private

Image. For details, see the Elastic Cloud Server User Guide.3. Delete the image file stored in the OBS bucket. For details, see the Object Storage

Service User Guide.

Image Management ServiceUser Guide 2 Getting Started

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

36

Page 42: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

3 Management

3.1 Modifying Image Attributes

ScenariosYou can only modify private images that are in Normal or Normal (Uninitialized) state. Youcan modify the name, description, and status of a private image.

ProcedureYou can modify the name and description of a private image using either of the followingmethods:

Method 1:

1. Log in to the management console.2. Under Computing, click Image Management Service.3. Click Private Image to display the image list.4. Locate the row that contains the image and click Modify in the Operation column.5. Modify the image name and description.

Method 2:

1. Log in to the management console.2. Under Computing, click Image Management Service.3. Click Private Image to display the image list.

In the image list on the Private Image page, locate the row that contains the image, click on the left of the row, and click the modification icon highlighted in Figure 3-1.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

37

Page 43: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 3-1 Modifying attributes of an image

You can change the image status based on whether initial configuration has been performedfor the image.

1. Log in to the management console.2. Under Computing, click Image Management Service.3. Click Private Image to display the image list.4. Locate the row that contains the image and click Modify in the Operation column.5. Check whether initial configuration has been performed for the image.

– If yes, select Initial configuration has been performed for this image. andchange the image status to Normal.

– If no, deselect Initial configuration has been performed for this image. andchange the image status to Normal (Uninitialized).

For how to perform initial configuration for an image, see What Initial ConfigurationNeeds to Be Performed for an External Image File Used to Create a PrivateImage?.

6. Click OK.

3.2 Creating an ECS Using an Image

Scenarios

You can use a private or public image to create an ECS.

The difference is as follows:

l If you use a public image to create an ECS, the ECS contains only the OS and pre-installed public applications. You will need to install your private applications ifrequired.

l If you use a private image to create an ECS, the ECS contains the OS, pre-installedpublic applications, and your private applications.

Procedure1. Log in to the management console.2. Under Computing, click Image Management Service.3. Click Public Image or Private Image to display the image list.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

38

Page 44: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

4. Locate the row that contains the target image and click Apply for ECS in the Operationcolumn.For how to create an ECS, see the Elastic Cloud Server User Guide.

3.3 Deleting an Image

Scenarios

Delete an image if it is unneeded.

You can delete only private images that are in the Normal or Normal (Uninitialized) state,and that are Not Released.

Procedure1. Log in to the management console.2. Under Computing, click Image Management Service.3. Click Public Image or Private Image to display the image list.

To view the status of an image, click on the right of the row that contains the image.– To delete a single image, go to 4.– To delete images in batches, go to 5.

4. Locate the row that contains the image, click More in the Operation column and selectDelete. Go to 7.

5. Select the image you are to delete on the image list.6. Click Delete on top of the image list.7. Click OK.

3.4 Sharing an Image

3.4.1 Overview

Application Scenarios

You can use the image sharing function to share your private images with other users on thepublic cloud platform.

If you are a DeC user, the image sharing function allows you to use images conveniently inmultiple projects in the same region.

The image provider can share specified images, cancel sharing images, and add or deletetenants with whom they share images. The recipient can choose to accept or refuse imagesshared by other users, and can remove the images they have accepted.

Procedure

User A (image provider) shares a private image with user B (image recipient). The procedureis as follows:

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

39

Page 45: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

1. User B provides the domain name to user A. If user B is a DeC user, user B must alsoprovide the project name.

2. User A shares an image with user B.3. User B accepts the shared image.

User B uses the image shared by user A to perform operations, such as creating ECSs.

Restrictions and Limitations1. Users can only share private images that have not been published as market images.2. A user can share 30 images at most.3. A user can only share images with other users within the same region.4. An image can be shared with 128 users at most.5. You can cancel image sharing anytime without notifying the user with whom you share

an image.6. You can delete the shared image anytime without notifying the user with whom you

share an image.7. An encrypted image cannot be shared.

3.4.2 Obtaining the Domain Name and Project Name

ScenariosBefore user A shares an image with user B, user B needs to provide the domain name to userA. If user B is a DeC user, user B also needs to provide the project name. This sectiondescribes how user B obtains the domain name and project name.

Procedure1. User B logs in to the management console.

2. Click the username in the upper right corner and select My Credential from the drop-down list.On the My Credential page, view the domain name and project name in the project list.

Figure 3-2 Domain name and project name

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

40

Page 46: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

3.4.3 Sharing Specified Images

ScenariosAfter user A obtains the domain name of user B (if user B is a DeC user, user A needs toobtain the domain name and project name of user B), user A can share a specified privateimage with user B. A user can share a single image or share images in batches based on yourrequirements.

PrerequisitesUser A has obtained the domain name of user B (if user B is a DeC user, user A has obtainedthe domain name and project name of user B).

Procedure1. User A logs in to the management console.

1. Under Computing, click Image Management Service.2. On the Image Mgmt Service page, click the Private Image tab to switch to the page

that displays all private images.3. Determine the next step based on how many images you are to share:

– To share images in batches, go to 4.– To share a single image, go to 6.

4. Select the private images to share, click Share on top of the image list.

Figure 3-3 Sharing images in batches

5. In the Share Image window, enter user B's domain name (if user B is a DeC user, enteruser B's account name and project name). Go to 8.

6. Locate the row that contains the private image you are to share, click More in theOperation column and select Share.

7. In the Share Image window, enter user B's domain name (if user B is a DeC user, enteruser B's account name and project name).

8. Click Add.9. To add multiple image recipients, enter the domain names and project names of these

recipients.10. Click OK.

3.4.4 Accepting or Refusing Shared Images

ScenariosAfter user A shares specified images, user B will receive a message. User B can choose toaccept or refuse all or part of the shared images. User B can only use accepted images.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

41

Page 47: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

PrerequisitesUser A has shared specified images.

Procedure1. User B logs in to the management console.

1. Under Computing, click Image Management Service.2. On the Image Mgmt Service page, click the Shared Image tab to switch to the page

that displays all private images.A message is displayed on top of the image list inquiring whether user B wants to acceptthe shared images. Figure 3-4 shows the message page.

Figure 3-4 Message asking whether to accept the shared images

– To refuse all shared images, click Refuse All.– To accept the shared images or refuse part of the shared images, click View details

and then go to 3.3. Accept the shared images or refuse part of the shared images.

– To accept the shared images, select the images on the Shared Image page and clickAccept. You can use images only after you have accepted them.

– To refuse part of the shared images, select the images on the Shared Image pageand click Refuse.

Figure 3-5 Shared Image page

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

42

Page 48: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

3.4.5 Removing Accepted Images

Scenarios

After you have accepted images shared by other users, you can remove them from the imagelist if you no longer need them.

Prerequisites

You have accepted images shared by other users.

Procedure1. Log in to the management console.

1. Under Computing, click Image Management Service.2. On the Image Mgmt Service page, click the Shared Image tab to switch to the page

that displays all private images.3. Determine the next step based on how many images you are to delete:

– To remove images in batches, go to 4.– To remove a single image, go to 5.

4. Select the images you are to remove and click Delete on top of the image list. Then go to6.

Figure 3-6 Removing images in batches

5. Locate the row that contains the private image you are to remove, click More in theOperation column and select Delete.

6. In the displayed dialog box, confirm the images you are to remove and click OK.

3.4.6 Canceling Image Sharing

Application Scenarios

Cancel sharing of images with other users.

Prerequisites

You have shared private images with other users.

Procedure1. Log in to the management console.2. Under Computing, click Image Management Service.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

43

Page 49: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

3. On the Image Mgmt Service page, click the Private Image tab to switch to the pagethat displays all private images.

4. Locate the row that contains the private images whose sharing you are to cancel, clickMore in the Operation column and select Stop Sharing.

5. In the displayed dialog box, confirm the images and click OK.

3.4.7 Adding Tenants Who Can Use Shared Images

Scenarios

Add tenants who can use the shared images.

Prerequisitesl You have shared private images.

l You have obtained the domain name (and project name if the tenant to be added is a DeCuser) of the tenant to be added.

Procedure1. Log in to the management console.

1. Under Computing, click Image Management Service.2. On the Image Mgmt Service page, click the Private Image tab to switch to the page

that displays all private images.

3. Click to view the image details.4. In the image details area, click Add Tenant.

Figure 3-7 Image details

5. In the Add Tenant window, enter the domain name (and project name if the tenant to beadded is a DeC user) of the tenant to be added, and click Add.

6. To add multiple image recipients, enter the domain names and project names of theserecipients.

7. Click OK.

3.4.8 Deleting Tenants Who Can Use Shared Images

Scenarios

Delete tenants who can use shared images.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

44

Page 50: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Prerequisitesl You have shared private images.l You have obtained the domain name of the tenant to be deleted.

Procedure1. Log in to the management console.

1. Under Computing, click Image Management Service.2. On the Image Mgmt Service page, click the Private Image tab to switch to the page

that displays all private images.

3. Click to view the image details.4. In the image details area, click the number of tenants with whom the images are shared.

Figure 3-8 Image details

5. Determine the operation to perform based on how many members you are to delete:– To delete a single tenant, click Delete in the row that contains the tenant.– To delete all tenants, click Delete All on top of the tenant list.

6. Click OK.

3.5 Exporting an Image

Scenarios

If you need to export private images to specified storage devices or use private images of thepublic cloud platform on other platforms, you can use the image export function.

You can export private images in available status on the public cloud platform to OBS bucketsand specify the export format. and download images in OBS buckets to specified storagedevices.

Images exported in different formats may vary in size. The Object Storage Service (OBS) willcharge you for storage based on the exported image size.

Restrictions and Limitationsl You can export private images in available status, which can be Normal or Normal

(Uninitialized).l You are not allowed to export public images or private images created using public

images.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

45

Page 51: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

l You can only export images smaller than 128 GB.l You can export images in VMDK, VHD, QCOW2, and ZVHD formats.l You cannot create private images that are created using ECSs created by market images.

Prerequisites

You have an OBS bucket.

For details, see the Object Storage Service User Guide.

Procedure1. Log in to the management console.2. Under Computing, click Image Management Service.3. On the Image Mgmt Service page, click the Private Image tab to switch to the page

that displays all private images.4. Locate the row that contains the image to be exported, click More in the Operation

column and select Export.5. In the displayed Export Image dialog box, enter the name of the image file to be

exported.6. Select the format of the image to be exported.7. Select the bucket in which the image is to be stored.8. Click OK.

You can view the image export progress on the Task Center console. After the image issuccessfully exported, you can download the image from the OBS bucket on the OBSconsole or client.

3.6 Optimizing a Windows Private Image

3.6.1 Overview

Overview

After the KVM POD is deployed, some images in the public cloud system need to supportboth FusionCompute and KVM virtualization. These images need to be optimized.

Images that run the OSs listed in the following table need to be optimized.

Table 3-1 OSs of images to be rectified

OS Bit

Windows Server 2008 Enterprise R2 SP1 64bit

Windows Server 2008 DataCenter R2 SP1 64bit

Windows Server 2012 R2 Standard 64bit

Windows Server 2012 R2 DataCenter 64bit

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

46

Page 52: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Obtaining Software Packagesl Table 3-2 lists the pvdriver Tools software packages required for optimizing a Windows

private image.

Table 3-2 pvdriver Tools software packages

SoftwarePackage

Operating System How to Obtain

pvdriver-win2008R2-64bit-2.2.0.308-388.zip

Windows Server 2008 Enterprise R2 SP1 http://support.hwclouds.com/usermanual-ecs/pvdriver-win2008R2-64bit-2.2.0.308-388.zip

Windows Server 2008 DataCenter R2SP1

pvdriver-win2012-64bit-2.2.0.308-388.zip

Windows Server 2012 R2 Standard http://support.hwclouds.com/usermanual-ecs/pvdriver-win2012-64bit-2.2.0.308-388.zip

Windows Server 2012 R2 DataCenter

l Table 3-3 lists the UVP VMTools software packages required for optimizing a Windows

private image.

Table 3-3 UVP VMTools software packages

SoftwarePackage

Operating System How to Obtain

vmtools-WIN2008R2-x64.zip

Windows Server 2008 Enterprise R2 SP1 http://support.hwclouds.com/usermanual-ecs/vmtools-WIN2008R2-x64.zip

Windows Server 2008 DataCenter R2 SP1

vmtools-WIN2012-x64.zip

Windows Server 2012 R2 Standard http://support.hwclouds.com/usermanual-ecs/vmtools-WIN2012-x64.zip

Windows Server 2012 R2 DataCenter

l Table 3-4 lists the software packages required for configuring SIDs for Windows ECSs.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

47

Page 53: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Table 3-4 Software packages required for configuring SIDs for Windows ECSs

SoftwarePackage

Operating System How to Obtain

customization-sysprep-win2008

Windows Server 2008 Enterprise R2SP1

http://support.hwclouds.com/usermanual-ecs/customization-sysprep-win2008.zip

Windows Server 2008 DataCenter R2SP1

customization-sysprep-win2012

Windows Server 2012 R2 StandardWindows Server 2012 R2 DataCenter

http://support.hwclouds.com/usermanual-ecs/customization-sysprep-win2012.zip

Procedure1. Use the Windows private image to be optimized to create an ECS, and start and log in to

the created ECS.

For details, see the Elastic Cloud Server User Guide.

2. Uninstall the old version of Tools from the ECS.

For details, see 3.6.2 Uninstalling Tools from a Windows ECS.

3. Install the new version of Tools on the ECS.

For details, see 3.6.3 Installing Tools on a Windows ECS.

4. Install the Tools required for creating ECSs in the KVM virtual resource pool.

For details, see 3.6.4 Installing UVP VMTools on a Windows ECS.

5. In the OS of the ECS, choose Control Panel > Power Options. Click Choose when toturn off the display, select Never for Turn off the display, and save the change.

6. Delete system logs and stop the ECS.

On Windows 2008 and Windows 2012, right-click Computer and select Manage. In thedisplayed dialog box, choose System Tools > Event Viewer > Windows Logs anddelete logs of five items.

7. Create a Windows private image using the ECS.

For details, see 2.2 Creating a Windows Private Image Using an ECS.

3.6.2 Uninstalling Tools from a Windows ECS

Scenarios

If a misoperation on the ECS occurs and Tools cannot function properly, you need to reinstallTools again. You can uninstall Tools in the same way as any other software. Beforeuninstalling Tools from the ECS running Windows, download a new version of Tools from theofficial website. You need to configure an elastic IP address for the ECS to enable it to accessthe Internet.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

48

Page 54: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

NOTICEBefore uninstalling Tools, you must ensure that Tools of a version listed in step 2 ofProcedure has been installed on the ECS. After uninstalling Tools, you must reinstall it in atimely manner to prevent the ECS performance from degrading.

Prerequisitesl You have bound an elastic IP address to the ECS.l The ECS has Tools installed.

Procedure1. Log in to the ECS using VNC.

For how to log in to an ECS, see the Elastic Cloud Server User Guide.2. Download the appropriate version of Tools from the paths provided in Table 3-2, Table

3-3, and Table 3-4 in the Obtaining Software Packages part in section 3.6.1 Overview.3. On the ECS OS, choose Start > Control Panel.4. Ensure that Tools of a version listed in 2 has been installed on the ECS and click

Uninstall a program.5. Uninstall GPL PV Drivers for Windows x.x.x.xx as prompted.

3.6.3 Installing Tools on a Windows ECS

ScenariosAfter an ECS is created and an OS is installed on it, you can install Tools on the ECS toimprove its I/O processing performance, and enable the ECS hardware monitoring and otheradvanced functions.

Prerequisitesl The ECS has the OS installed and an elastic IP address bound to it.l The ECS has no Tools installed on it. If Tools of another version has been installed on

the ECS, uninstall the Tools by following the instructions in 3.6.2 Uninstalling Toolsfrom a Windows ECS.

l The ECS's system disk must have an available capacity of larger than 32 MB.l If the ECS runs Windows 2008, you must install Tools as the administrator.l The pvdriver Tools software package has been installed on the ECS. For how to obtain

the software package, see Obtaining Software Packages.

Procedure1. Log in to the Windows ECS using VNC.

For details about how to log in to the ECS, see the Elastic Cloud Server User Guide.2. Decompress the pvdriver Tools software package.3. Right-click GPL PV Drivers for Windows x.x.x.xx, select Run as administrator, and

complete the installation as prompted.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

49

Page 55: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

4. Restart the ECS as prompted to make the installed Tools take effect.If the ECS runs Windows Server 2008, you must restart the ECS twice to make the Toolstake effect.

NOTE

After Tools is installed, NIC configuration of the ECS will be lost. If you have configured a NICfor the ECS, you need to configure it again.

3.6.4 Installing UVP VMTools on a Windows ECS

ScenariosTo enable an image to support KVM virtualization, you need to UVP VMTools on theWindows ECS. This section uses vmtools-WIN2008R2-x64.exe extracted from vmtools-WIN2008R2-x64.zip as an example to describe how to install UVP VMTools.

Prerequisitesl You have bound an elastic IP address to the ECS.l You have downloaded the UVP VMTools installation package on the ECS. For how to

obtain the installation package, see Obtaining Software Packages.l Ensure that the ECS has at least 50 MB disk space.

Procedure1. Log in to the Windows ECS using VNC.

For details about how to log in to the ECS, see the Elastic Cloud Server User Guide.2. Decompress the UVP Tools software package. This section uses vmtools-WIN2008R2-

x64.exe extracted from vmtools-WIN2008R2-x64.zip as an example to describe how todecompress the UVP Tools software package.

3. Right-click vmtools-WIN2008R2-x64.exe, select Run as administrator, and completethe installation as prompted.

4. Double-click the installation package to install VMTools.5. In the displayed dialog box, select I accept the terms in the License Agreement and

click Install.

Figure 3-9 Installing UVP VMTools

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

50

Page 56: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

6. Install UVP VMTools as prompted.

7. The installation procedure for Windows 2008 is as follows:

a. The Windows Security dialog box shown in Figure 3-10 may be displayed duringinstallation. In the dialog box, select Always trust software from "HuaweiTechnologies Co.,Ltd". and click Install. Otherwise, the installation will fail.

Figure 3-10 Windows Security dialog box

b. Click Finish.

Figure 3-11 Completing the installation

Verify the Installation

Perform the following steps to verify the installation of UVP VMTools.

1. On the ECS OS, choose Start.

2. Right-click Computer and select Properties.

3. Click Device Manager.

4. Click Storage controllers and Network adapters. If information shown in Figure 3-12is displayed, UVP VMTools is installed successfully.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

51

Page 57: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 3-12 Device manager information

If UVP VMTools is not installed successfully, contact technical support.

3.6.5 Configuring an SID for an ECS

ScenariosTo customize the SID of an ECS created using an image or ensure that the ECS can be addedto a domain, you need to configure the SID.

If there are no special requirements for the SID, this operation is not required.

A Windows ECS can be added to a Windows domain only if it has a unique SID. Therefore,before creating an image using the Windows ECS, you must configure its SID so that eachECS created using the image has a unique SID.

NOTICEl If an ECS is restarted, or stopped and started again before it is used to create an image, the

ECS SID configuration will become invalid and needs to be configured again.l If you have configured an SID for an ECS, you do not need to configure the ECS

specifications.

Prerequisitesl You have bound an elastic IP address to the ECS.l The ECS has the OS, pvdriver Tools, and UVP VMTools installed.l The software package for configuring the SID has been downloaded on the ECS. For

how to obtain the software package, see Table 3-4.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

52

Page 58: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Delete historical files.

1. On the ECS OS interface in the VNC login window, enable user administrator anddisable all other users.

2. Check whether the C:\ root directory contains files setpass.vbs, getInterfaceIndex.bat,network.inf, os.inf, and passwd.inf.If these files exist, delete them.

Determine the ECS OS type.

3. Determine the next step based on the ECS OS type:– If the ECS runs Windows Server 2008, go to 4.– If the ECS runs Windows Server 2012, go to 17.

NOTE

If the ECS runs Windows Server 2012 R2 Datacenter 64-bit, SID cannot be configured forthe ECS.

Configure SID for an ECS running Windows Server 2008.

4. Copy the X64 folder in the customization-sysprep-win2008 package to the C:\Windows\System32 directory of the ECS.

5. Modify the ECS directory file.For example, if the ECS directory file is C:\Windows\System32\X64\professional\Untitled.xml, modify the file as follows:

a. In the ECS directory file, locate the Password and AdministratorPassword tagsand configure the ECS password in Value.

b. Modify the following fields to make the language defined in the ECS directory fileconsistent with that of the OS:<InputLocale>zh-CN</InputLocale> <SystemLocale>zh-CN</SystemLocale><UILanguage>zh-CN</UILanguage> <UILanguageFallback>zh-CN</UILanguageFallback> <UserLocale>zh-CN</UserLocale>The default language is zh-CN, which indicates simplified Chinese. To change thelanguage to English, set the field value to en-US.For IDs of more languages, visit the Microsoft Windows official website and searchfor "language package default values".

c. Change the value in the RegisteredOwner tag to the name of the current countryand that in the TimeZone tag to the current time zone.To obtain the standard names of time zones, visit http://msdn.microsoft.com/en-usand search "Microsoft Time Zone Index Values".

6. In the command line window, run the following command to configure the SID for theECS.If the ECS runs a 64-bit OS, run the following command:C:\Windows\System32\X64\professional\SysprepCmd.cmd

NOTE

l If no error message is displayed, the command is executed successfully.

l Do not run the command repeatedly.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

53

Page 59: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

7. In the command line window, enter regedit and press Enter.A dialog box is displayed.

8. Choose HKEY_LOCAL_MACHINE > SYSTEM > Setup.All the registry entries are displayed.

9. Change the value of Cmdline from oobe\windeploy.exe to X64\professional\deploy.cmd.

10. Choose HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows NT >CurrentVersion > Winlogon.All the registry entries are displayed.

11. Change the value of DefaultPassword to the ECS password.If DefaultPassword does not exist, create a character string and name it asDefaultPassword.

12. Change the value of AutoAdminLogon to 1.If AutoAdminLogon does not exist, create a character string and name it asAutoAdminLogon.

13. Choose HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows >CurrentVersion > Run.All the registry entries are displayed.

14. Double-click (Default).A dialog box is displayed.

15. Enter c:\setpass.vbs.16. Click OK.

Close the dialog box.

Configure SID for an ECS running Windows Server 2012.

NOTE

If the ECS runs Windows Server 2012 R2 Datacenter 64-bit, SID cannot be configured for the ECS.

17. Copy the X64 folder in the customization-sysprep-win2012 to the C:\Windows\System32 directory.

18. Modify the ECS directory file.For example, if the ECS directory file is C:\Windows\System32\X64\professional\Untitled.xml, modify the file as follows:

a. In the ECS directory file, locate the Password and AdministratorPassword tagsand configure the ECS password in Value.

b. Modify the following fields to make the language defined in the ECS directory fileconsistent with that of the OS:<InputLocale>zh-CN</InputLocale> <SystemLocale>zh-CN</SystemLocale><UILanguage>zh-CN</UILanguage> <UILanguageFallback>zh-CN</UILanguageFallback> <UserLocale>zh-CN</UserLocale>The default language is zh-CN, which indicates simplified Chinese.To change the language to English, set the field value to en-US.For IDs of more languages, visit the Microsoft Windows official website and searchfor "language package default values".

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

54

Page 60: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

c. Change the value in the TimeZone tag to the current time zone, and that in theRegisteredOwner tag to the name of the current country.To obtain the standard names of time zones, visit http://msdn.microsoft.com/en-usand search "Microsoft Time Zone Index Values".

19. In the command line window, run the following command to configure the SID for theECS.C:\Windows\System32\X64\professional\SysprepCmd.cmd

20. In the command line window, enter regedit and press Enter.A dialog box is displayed.

21. Choose HKEY_LOCAL_MACHINE > SYSTEM > Setup.All the registry entries are displayed.

22. Change the value of Cmdline from oobe\windeploy.exe to X64\professional\deploy.cmd.

23. Choose HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows NT >CurrentVersion > Winlogon.All the registry entries are displayed.

24. Change the value of DefaultPassword to the ECS password.If DefaultPassword does not exist, create a character string and name it asDefaultPassword.

25. Change the value of AutoAdminLogon to 1.If AutoAdminLogon does not exist, create a character string and name it asAutoAdminLogon.

26. Choose HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows >CurrentVersion > Run.All the registry entries are displayed.

27. Double-click (Default).A dialog box is displayed.

28. Enter c:\setpass.vbs.29. Click OK.

Close the dialog box.

3.6.6 Configuring Windows ECS Specifications

ScenariosIf an ECS is used as an image to create other ECSs, you need to configure specifications ofthe source ECS so that ECSs created using it meet the following requirements:

l Random passwordl Customized specifications, such as host name, password, and IP address.

You do not need to configure ECS specifications if:

l You do not use the random password or customized ECS specifications.l An SID has been configured for the ECS. This is because ECS specifications have been

configured during the SID configuration. For how to configure the ECS SID, see section3.6.5 Configuring an SID for an ECS.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

55

Page 61: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

NOTE

l To add an ECS to a domain, you need to configure an SID for the ECS.l After you configure ECS specifications, new ECSs created using this ECS as an image will automatically

restart upon its first startup to make the configuration take effect.

Prerequisitesl The ECS has the OS and Tools installed.l No SID has been configured for the ECS.

ProcedureDelete historical files.

1. On the ECS OS interface in the VNC login window, enable user administrator anddisable all other users.

2. Check whether the C:\ root directory contains files setpass.vbs, getInterfaceIndex.bat,network.inf, os.inf, and passwd.inf.If these files exist, delete them.Modify the registry table.

3. On the ECS OS interface in the VNC login window, click Start, enter regedit in thesearch column, and press Enter.A dialog box is displayed.

4. Choose HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows NT >CurrentVersion > Winlogon.All the registry entries are displayed.

5. Check whether the registry table contains DefaultUserName, DefaultPassword, andAutoAdminLogon.– If yes, go to 9.– If no, go to 6.

6. Choose Edit > New > String Value.The default name New Value #1 is displayed in the window on the right.

7. Right-click New Value #1 and select Rename.Rename the generated default name New Value #1 as DefaultUserName.

8. Repeat 6 and 7 to rename DefaultPassword and AutoAdminLogon.9. Double-click DefaultUserName, DefaultPassword, and AutoAdminLogon. In the

displayed dialog box, enter Administrator, Administrator password of the ECS, and 1in Value data.User Administrator password of new ECSs created using the ECS as an imageconforms to the following rules:– If the ECS attribute is configured during ECS creation, password of the created

ECSs is the same as the configured password.– If the ECS attribute is not configured during ECS creation, password of the created

ECSs is random.

NOTE

If user Administrator password of the ECS is not configured, you do not need to specifyDefaultPassword.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

56

Page 62: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

10. If the registry table contains AutoLogonCount, delete it.

11. Choose HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows >CurrentVersion > Run.

All the registry entries are displayed.

12. Double-click (Default).A dialog box is displayed.

13. Enter c:\setpass.vbs.

14. Click OK.

Close the dialog box.

3.7 Optimizing a Linux Private Image

3.7.1 Overview

Overview

After the KVM POD is deployed, some images in the public cloud system need to supportboth FusionCompute and KVM virtualization. These images need to be optimized.

Images that run the OSs listed in the following table need to be optimized.

Table 3-5 OSs of images to be rectified

OS Bit

CentOS 6.3 64bit

CentOS 6.5 64bit

CentOS 7.0 64bit

Ubuntu 14.04 server 64bit

Procedure1. Use the Linux image to be optimized to create an ECS, and start and log in the ECS.

2. Uninstall Tools from the ECS.

For details, see 3.7.2 Uninstalling Tools from a Linux ECS.

3. Change the UUIDs of fstab and grub and install PVOPS.

For details, see 3.7.3 Changing UUIDs of fstab and grub and Installing Native Xenand KVM Drivers.

4. Configure the ECS NIC.

For details, see 3.7.4 Configuring Linux ECS Network Attributes.

5. Delete logs and historical records, and stop the ECS.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

57

Page 63: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

NOTICEl Run the following commands to delete redundant key files:

echo > /$path/$to/$root/.ssh/authorized_keysAn example command is echo > /root/.ssh/authorized_keys.

echo > /$path/$to/$none-root/.ssh/authorized_keysAn example command is echo > /home/linux/.ssh/authorized_keys.

l Run the following command to delete all logs in the /var/log directory:

rm -rf /var/log/*l Run the following command to delete historical records:

history -w;echo > /root/.bash_history;history -c;history -c;history -c;

6. Use the ECS to create a private Linux image.

For details, see 2.3 Creating a Linux Private Image Using an ECS.

3.7.2 Uninstalling Tools from a Linux ECS

Scenarios

If a misoperation on the ECS occurs and Tools cannot function properly, you need to reinstallTools again.

NOTICEAfter uninstalling Tools, you must reinstall it in a timely manner to prevent the ECSperformance from degrading.

Prerequisites

The ECS has Tools installed.

Procedure1. Log in to the ECS using VNC as user root.2. On the ECS OS interface in the VNC login window, open the CLI (for details about how

to open the CLI, see the OS manual).

Switch to the CLI mode.

3. Run the following command to uninstall Tools:

/etc/.uvp-monitor/uninstallTools is uninstalled successfully if the following command output is displayed:The PV driver is uninstalled successfully. Reboot the system for the uninstallation to take effect.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

58

Page 64: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

3.7.3 Changing UUIDs of fstab and grub and Installing NativeXen and KVM Drivers

ScenariosWhen optimizing a Linux private image, you need to change the UUIDs of fstab and grub onthe ECS, and install native Xen and KVM drivers.

ECSs that use native Linux Xen and KVM drivers rather than Tools must have a kernel laterthan the 2.6.24 version.

PrerequisitesThe Linux kernel version must be later than 2.6.24.

Procedure1. Add the native Linux xen-pv and virtio frontend drivers to initrd or initramfs.

– For CentOS (CentOS 7.0, for example), modify the /etc/dracut.conf file. Add thexen-pv and virtio drivers (xen-blkfront and xen-netfront for the xen-pv driver, andvirtio_blk, virtio_scsi, virtio_net, virtio_pci, virtio_ring, and virtio for the virtiodriver) to the add_driver item, separate drivers with spaces, and save and exitthe /etc/dracut.conf file. Then run the dracut -f command to generate initrd again.For details, see section CentOS Operations.

– For Ubuntu, modify the /etc/initramfs-tools/modules file. Add the xen-pv andvirtio drivers (xen-blkfront and xen-netfront for the xen-pv driver, and virtio_blk,virtio_scsi, virtio_net, virtio_pci, virtio_ring, and virtio for the virtio driver),separate drivers with spaces, and save and exit the /etc/initramfs-tools/modulesfile. Then run the update-initramfs -u command to generate initrd again.For details, see section Ubuntu Operations.

2. Modify the menu.lst or grub.cfg configuration (/boot/grub/menu.lst or /boot/grub/grub.cfg, or /boot/gurb2/grub.cfg or /boot/grub/grub. conf) and configure the bootpartition using the UUID.– Take Ubuntu14.04 for example. Run blkid to obtain the UUID of the root partition.

Modify the /boot/grub/grub.cfg file and use the UUID of the root partition toconfigure the boot item. If the root partition already uses UUID, no modification isrequired. The procedure is as follows:

i. Log in to the ECS as user root.ii. Run the following command to query all types of mounted file systems and the

device UUIDs:blkidThe command output is as follows./dev/xvda1: UUID="ec51d860-34bf-4374-ad46-a0c3e337fd34" TYPE="ext3"/dev/xvda5: UUID="7a44a9ce-9281-4740-b95f-c8de33ae5c11" TYPE="swap"

iii. Run the following command to query the grub.cfg file:cat /boot/grub/grub. cfgThe command output is as follows.......menuentry 'Ubuntu Linux, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os --unrestricted

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

59

Page 65: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

$menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-ec51d860-34bf-4374-ad46-a0c3e337fd34' {recordfailload_videogfxmode $linux_gfx_modeinsmod gzioinsmod part_msdosinsmod ext2if [ x$feature_platform_search_hint = xy ]; thensearch --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34elsesearch --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34fiecho 'Loading Linux 3.13.0-24-generic ...'linux /boot/vmlinuz-3.13.0-24-generic root=/dev/xvda1 ro echo 'Loading initial ramdisk ...'initrd /boot/initrd.img-3.13.0-24-generic }

iv. Check whether the root partition in the /boot/grub/grub.cfg configuration filecontains root=/dev/xvda1 or root=UUID=ec51d860-34bf-4374-ad46-a0c3e337fd34.○ If root=UUID=ec51d860-34bf-4374-ad46-a0c3e337fd34 is contained,

the root partition is in the UUID format and requires no change.○ If root=/dev/xvda1 is contained, the root partition is in the device name

format. Go to 2.5.

v. Identify the UUID of the root partition device based on root=/dev/xvda1(device name of the root partition) and the partition information obtained byrunning the blkid command.

vi. Run the following command to open the grub.cfg file:vi /boot/grub/grub.cfg

vii. Press i to enter the editing mode and change the root partition to the UUIDformat, for example, from root=/dev/xvda1 toroot=UUID=ec51d860-34bf-4374-ad46-a0c3e337fd34.

viii. Press Esc, enter :wq, and press Enter. The system saves the configuration andexits the vi editor.

ix. Run the following command to verify the change:cat /boot/grub/grub. cfgThe change is successful if information similar to the following is displayed:......menuentry 'Ubuntu Linux, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-ec51d860-34bf-4374-ad46-a0c3e337fd34' {recordfailload_videogfxmode $linux_gfx_modeinsmod gzioinsmod part_msdosinsmod ext2if [ x$feature_platform_search_hint = xy ]; thensearch --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34elsesearch --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34fiecho 'Loading Linux 3.13.0-24-generic ...'

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

60

Page 66: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

linux /boot/vmlinuz-3.13.0-24-generic root=UUID=ec51d860-34bf-4374-ad46-a0c3e337fd34 roecho 'Loading initial ramdisk ...'initrd /boot/initrd.img-3.13.0-24-generic}

– Take CentOS6.5 for example. Run blkid to obtain the UUID of the root partition.Modify the /boot/grub/grub.conf file and use the UUID of the root partition toconfigure the boot item. If the root partition already uses UUID, no modification isrequired. The procedure is as follows:

i. Log in to the ECS as user root.ii. Run the following command to query all types of mounted file systems and the

device UUIDs:blkidThe command output is as follows./dev/xvda1: UUID="749d6c0c-990a-4661-bed1-46769388365a" TYPE="swap" /dev/xvda2: UUID="f382872b-eda6-43df-9516-5a687fecdce6" TYPE="ext4"

iii. Run the following command to query the grub.conf file:cat /boot/grub/grub. confThe command output is as follows.default=0 timeout=5 splashimage=(hd0,1)/boot/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.32-573.8.1.el6.x86_64) root (hd0,1) kernel /boot/vmlinuz-2.6.32-573.8.1.el6.x86_64 ro root=/dev/xvda2 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=autoKEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet initrd /boot/initramfs-2.6.32-573.8.1.el6.x86_64.img

iv. Check whether the root partition in the /boot/grub/grub.conf configurationfile contains root=/dev/xvda2 or root=UUID=f382872b-eda6-43df-9516-5a687fecdce6.○ If root=UUID=f382872b-eda6-43df-9516-5a687fecdce6 is contained,

the root partition is in the UUID format and requires no change.○ If root=/dev/xvda2 is contained, the root partition is in the device name

format. Go to 2.5.

v. Identify the UUID of the root partition device based on root=/dev/xvda2(device name of the root partition) and the partition information obtained byrunning the blkid command.

vi. Run the following command to open the grub.conf file:vi /boot/grub/grub.conf

vii. Press i to enter the editing mode and change the root partition to the UUIDformat, for example, from root=/dev/xvda2 to root=UUID=f382872b-eda6-43df-9516-5a687fecdce6.

viii. Press Esc, enter :wq, and press Enter. The system saves the configuration andexits the vi editor.

ix. Run the following command to verify the change:cat /boot/grub/grub. cfgThe change is successful if information similar to the following is displayed:

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

61

Page 67: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

default=0 timeout=5 splashimage=(hd0,1)/boot/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.32-573.8.1.el6.x86_64) root (hd0,1) kernel /boot/vmlinuz-2.6.32-573.8.1.el6.x86_64 ro root=UUID=f382872b-eda6-43df-9516-5a687fecdce6 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=autoKEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet initrd /boot/initramfs-2.6.32-573.8.1.el6.x86_64.img

– Take CentOS7.0 for example. Run blkid to obtain the UUID of the root partition.Modify the /boot/grub2/grub.cfg file and use the UUID of the root partition toconfigure the boot item. If the root partition already uses UUID, no modification isrequired.

i. Log in to the ECS as user root.

ii. Run the following command to query all types of mounted file systems and thedevice UUIDs:

blkid

The command output is as follows./dev/xvda2: UUID="4eb40294-4c6f-4384-bbb6-b8795bbb1130" TYPE="xfs" /dev/xvda1: UUID="2de37c6b-2648-43b4-a4f5-40162154e135" TYPE="swap"

iii. Run the following command to query the grub.cfg file:

cat /boot/grub2/grub. cfg

The command output is as follows.......menuentry 'Red Hat Enterprise Linux Server 7.1 (Maipo), with Linux 3.10.0-229.el7.x86_64' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-4eb40294-4c6f-4384-bbb6-b8795bbb1130' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod xfs set root='hd0,msdos2' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='hd0,msdos2'4eb40294-4c6f-4384-bbb6-b8795bbb1130 else search --no-floppy --fs-uuid --set=root 4eb40294-4c6f-4384-bbb6-b8795bbb1130 fi linux16 /boot/vmlinuz-3.10.0-229.el7.x86_64 root=/dev/xvda2 ro crashkernel=auto rhgb quiet LANG=en_US.UTF-8 initrd16 /boot/initramfs-3.10.0-229.el7.x86_64.img }

iv. Check whether the root partition in the /boot/grub/grub.cfg configuration filecontains root=/dev/xvda2 or root=UUID=4eb40294-4c6f-4384-bbb6-b8795bbb1130.

○ If root=UUID=4eb40294-4c6f-4384-bbb6-b8795bbb1130 is contained,the root partition is in the UUID format and requires no change.

○ If root=/dev/xvda2 is contained, the root partition is in the device nameformat. Go to 2.5.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

62

Page 68: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

v. Identify the UUID of the root partition device based on root=/dev/xvda2(device name of the root partition) and the partition information obtained byrunning the blkid command.

vi. Run the following command to open the grub.cfg file:vi /boot/grub2/grub.cfg

vii. Press i to enter the editing mode and change the root partition to the UUIDformat, for example, from root=/dev/xvda2 toroot=UUID=4eb40294-4c6f-4384-bbb6-b8795bbb1130.

viii. Press Esc, enter :wq, and press Enter. The system saves the configuration andexits the vi editor.

ix. Run the following command to verify the change:cat /boot/grub2/grub. cfgThe change is successful if information similar to the following is displayed:......menuentry 'Red Hat Enterprise Linux Server 7.1 (Maipo), with Linux 3.10.0-229.el7.x86_64' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-4eb40294-4c6f-4384-bbb6-b8795bbb1130' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod xfs set root='hd0,msdos2' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='hd0,msdos2'4eb40294-4c6f-4384-bbb6-b8795bbb1130 else search --no-floppy --fs-uuid --set=root 4eb40294-4c6f-4384-bbb6-b8795bbb1130 fi linux16 /boot/vmlinuz-3.10.0-229.el7.x86_64 root=UUID=4eb40294-4c6f-4384-bbb6-b8795bbb1130 ro crashkernel=auto rhgb quiet LANG=en_US.UTF-8 initrd16 /boot/initramfs-3.10.0-229.el7.x86_64.img }

3. Modify the fstab file and change the partition form to UUID.Take CentOS7.0 for example. Run blkid to obtain the UUIDs of all partitions. Modifythe /etc/fstab file and use the UUIDs of the partitions to configure automatic partitionmounting.

a. Log in to the ECS as user root.b. Run the following command to query all types of mounted file systems and the

device UUIDs:blkidThe command output is as follows./dev/xvda2: UUID="4eb40294-4c6f-4384-bbb6-b8795bbb1130" TYPE="xfs" /dev/xvda1: UUID="2de37c6b-2648-43b4-a4f5-40162154e135" TYPE="swap"

c. Run the following command to query the fstab file:cat /etc/fstabThe command output is as follows.[root@CTU1000028010 ~]# cat /etc/fstab /dev/xvda2 / xfs defaults 0 0 /dev/xvda1 swap swap defaults 0 0

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

63

Page 69: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

d. Check the form of disk in the fstab file.n If the form is UUID, no modification is required.n If the form is device name, go to 3.5.

e. Run the following command to open the fstab file:vi /etc/fstab

f. Press i to enter the editing mode and change the disk form in the fstab file to UUID.g. Press Esc, enter :wq, and press Enter. The system saves the configuration and exits

the vi editor.h. Run the following command to verify the change:

cat /etc/fstabThe change is successful if information similar to the following is displayed:[root@CTU1000028010 ~]# cat /etc/fstab UUID=4eb40294-4c6f-4384-bbb6-b8795bbb1130 / xfs defaults 0 0 UUID=2de37c6b-2648-43b4-a4f5-40162154e135 swap swap defaults 0 0

CentOS Operations1. Run the following command to open the /etc/dracut.conf file:

vi /etc/dracut.conf2. Press i to enter the editing mode and add the xen-pv and virtio drivers to add-driver (the

format depends on the OS requirements).[root@CTU10000xxxxx ~]# vi /etc/dracut.conf # additional kernel modules to the default add_drivers+="xen-blkfront xen-netfront virtio_blk virtio_scsi virtio_net virtio_pci virtio_ring virtio" ......

3. Press Esc, enter :wq, and press Enter. The system saves the change and exits the /etc/dracut.conf file.

4. Run the following command to generate initrd again:dracut -f

5. Run the following commands to check whether native Xen and KVM drivers have beeninstalled:lsinitrd /boot/initramfs-`uname -r`.img | grep xenlsinitrd /boot/initramfs-`uname -r`.img | grep virtio[root@CTU10000xxxxx home]# lsinitrd /boot/initramfs-`uname -r`.img | grep xen -rwxr--r-- 1 root root 54888 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/block/xen-blkfront.ko -rwxr--r-- 1 root root 45664 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/net/xen-netfront.ko [root@CTU10000xxxxx home]# lsinitrd /boot/initramfs-`uname -r`.img | grep virtio -rwxr--r-- 1 root root 23448 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/block/virtio_blk.ko -rwxr--r-- 1 root root 50704 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/net/virtio_net.ko -rwxr--r-- 1 root root 28424 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/scsi/virtio_scsi.ko drwxr-xr-x 2 root root 0 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio -rwxr--r-- 1 root root 14544 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio/virtio.ko

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

64

Page 70: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

-rwxr--r-- 1 root root 21040 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio/virtio_pci.ko -rwxr--r-- 1 root root 18016 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio/virtio_ring.ko

Ubuntu Operations1. Run the following command to open the /etc/dracut.conf file:

vi /etc/initramfs-tools/modules

2. Press i to enter the editing mode and add the xen-pv and virtio drivers to the /etc/initramfs-tools/modules file (the format depends on the OS requirements).[root@CTU10000xxxxx ~]#vi /etc/initramfs-tools/modules ......# Examples: # # raid1 # sd_mOd xen-blkfront xen-netfront virtio_blk virtio_scsi virtio_net virtio_pci virtio_ring virtio......

3. Press Esc, enter :wq, and press Enter. The system saves the change and exits the /etc/initramfs-tools/modules file.

4. Run the following command to generate initrd again:

update-initramfs -u

5. Run the following commands to check whether native Xen and KVM drivers have beeninstalled:

lsinitramfs /boot/initrd.img-`uname -r` |grep xen

lsinitramfs /boot/initrd.img-`uname -r` |grep virtio[root@ CTU10000xxxxx home]# lsinitramfs /boot/initrd.img-`uname -r` |grep xen lib/modules/3.5.0-23-generic/kernel/drivers/net/ethernet/qlogic/netxen lib/modules/3.5.0-23-generic/kernel/drivers/net/ethernet/qlogic/netxen/netxen_nic.ko lib/modules/3.5.0-23-generic/kernel/drivers/net/xen-netback lib/modules/3.5.0-23-generic/kernel/drivers/net/xen-netback/xen-netback.ko lib/modules/3.5.0-23-generic/kernel/drivers/block/xen-blkback lib/modules/3.5.0-23-generic/kernel/drivers/block/xen-blkback/xen-blkback.ko [root@ CTU10000xxxxx home]# lsinitramfs /boot/initrd.img-`uname -r` |grep virtio lib/modules/3.5.0-23-generic/kernel/drivers/scsi/virtio_scsi.ko

3.7.4 Configuring Linux ECS Network Attributes

Scenarios

This section describes how to configure the network attributes of a Linux ECS, includingquerying and clearing network rule files. If the Linux ECS that will be used to create a privateimage is using a static IP address, configure the ECS NIC to obtain an IP address usingDHCP.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

65

Page 71: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Prerequisites

The ECS has the OS and Tools installed.

Procedure1. Query and delete network rule files.

– UbuntuFor details, see section Delete Network Rules of an ECS Running Ubuntu.

– CentOSFor details, see section Delete Network Rules of an ECS Running CentOS.

2. After you delete a network rule, if the Linux ECS that will be used to create a privateimage is using a static IP address, configure the ECS NIC to obtain an IP address usingDHCP.– Ubuntu

For details, see section Change the IP Address Assignment Mode of ECSsRunning Ubuntu to DHCP.

– CentOSFor details, see section Change the IP Address Assignment Mode of ECSsRunning CentOS to DHCP.

3. Configure DHCP to enable the ECS to obtain the IP address continuously.– CentOS: Use vi editor to add PERSISTENT_DHCLIENT="y" to the /etc/

sysconfig/network-scripts/ifcfg-ethX configuration file.– Ubuntu: No operation is required.

Delete Network Rules of an ECS Running Ubuntu1. Run the following command to query the files in the network rule directory:

ls -l /etc/udev/rules.d2. Run the following commands to delete the rule files whose names contain persistent and

net in the network rule directory:Example:rm /etc/udev/rules.d/30-net_persistent-names.rulesrm /etc/udev/rules.d/70-persistent-net.rules //Replace the italic part in the commandwith the actual value at your site.

3. Run the following command to check whether the inittramfs image files starting withinitrd and ending with generic contain persistent and net rule files.lsinitramfs /boot/initrd.img-`uname -r` |grep persistent|grep net– If no, no further action is required.– If yes, go to 4.

4. Run the following command to back up the initrd image file:cp /boot/initrd.img-`uname -r` /boot/initrd.img-`uname -r`_bak

5. Run the following command to generate the inittramfs image file again:update-initramfs –u

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

66

Page 72: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

NOTE

Do not restart the ECS after deleting the network rule files. Otherwise, the deleted rule files will begenerated again.

Delete Network Rules of an ECS Running CentOS1. Run the following command to query the files in the network rule directory:

ls -l /etc/udev/rules.d2. Run the following commands to delete the rule files whose names contain persistent and

net in the network rule directory:Example:rm /etc/udev/rules.d/30-net_persistent-names.rulesrm /etc/udev/rules.d/70-persistent-net.rules //Replace the italic part in the commandwith the actual value at your site.

3. Run the following command to check whether the inittramfs image files starting withinitrd and ending with generic contain persistent and net rule files.lsinitrd /boot/initramfs-`uname -r`.img |grep persistent|grep net– If no, no further action is required.– If yes, go to 4.

4. Run the following command to back up the initrd image file:cp /boot/initramfs-`uname -r`.img/boot/ initramfs-`uname -r`.img _bak

5. Run the following command to generate the inittramfs image file again:dracut -f

NOTE

Do not restart the ECS after deleting the network rule files. Otherwise, the deleted rule files will begenerated again.

Change the IP Address Assignment Mode of ECSs Running Ubuntu to DHCP1. Run the following command on the ECS to open the /etc/network/interfaces file using

the vi editor and query the IP address assignment mode:vi /etc/network/interfaces– If the IP address assignment mode of all NICs is DHCP, as shown in Figure 3-13,

enter :q to exit the vi editor.

Figure 3-13 DHCP IP address assignment mode

– If the IP address assignment mode of a NIC is the static mode, as shown in Figure3-14, go to 2.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

67

Page 73: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 3-14 Static IP address assignment mode

2. Press i to enter editing mode.3. Delete the static IP address and configure the NIC to obtain an IP address using DHCP.

Figure 3-15 shows the configuration commands.You can insert the pound sign (#) before each line of the static IP address configurationto comment it out.

Figure 3-15 Configuring the NIC to obtain an IP address using DHCP

If the VM has multiple NICs, configure the IP address assignment mode of all the otherNICs to DHCP. Figure 3-16 shows the configuration commands.

Figure 3-16 Configuring other NICs to obtain an IP address using DHCP

4. Press Esc. Type :wq and press Enter.The system saves the configuration and exits the vi editor.

Change the IP Address Assignment Mode of ECSs Running CentOS to DHCP1. Run the following command to enter the directory where the ECS NIC information is

stored:

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

68

Page 74: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

cd /etc/sysconfig/network-scripts2. Run the following command to open the NIC configuration file:

vi ifcfg-ethXXAn example command is vi ifcfg-eth0.– If the IP address assignment mode of all NICs is DHCP, as shown in Figure 3-17,

enter :q to exit the vi editor.

Figure 3-17 DHCP IP address assignment mode

– If the IP address assignment mode of a NIC is the static mode, as shown in Figure3-18, go to 3.

Figure 3-18 Static IP address assignment mode

3. Press i to enter the editing mode.4. Delete the static IP address and configure the NIC to obtain an IP address using DHCP.

Figure 3-19 shows the configuration commands.You can insert the pound sign (#) before each line of the static IP address configurationto comment it out.

Figure 3-19 DHCP IP address assignment mode

5. Press Esc, enter :wq, save the modification, and exit the vi editor.No further action is required.

NOTE

This section uses eth0 as an example. If the ECS has multiple NICs, perform the preceding operationson each NIC configuration file.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

69

Page 75: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

3.7.5 Configuring Linux ECS Specifications

Scenarios

To ensure that the passwords of ECSs created using a private image are configurable,configure a password initialization script on the ECS used to create the private image.

If the system disk partitions of the OS are the Logical Volume Manager (LVM) file systems,the primary partition is default logical volume lv_root. If multiple partitions are configured inthe volume group to which the system disk belongs, this function is unavailable

Prerequisites

The ECS has the OS and Tools installed.

Procedure1. Run a command to open the rc file using the vi editor.

– If the ECS runs Ubuntu, run the following command:vi /etc/init.d/rc

– CentOS 7n Run the following command to set the file to be configurable:

chmod +x /etc/rc.d/rc.localn Run the following command to open the file:

vi /etc/rc.d/rc.local– If the ECS runs other OSs, run the following command:

vi /etc/rc.d/rc2. Press i to enter the editing mode and add commands to the file as follows:

– If exit 0 is displayed at the end of the file, add the following statement to the rowjust before exit 0:/bin/bash /etc/init.d/setpasswd.sh

– If exit 0 is not displayed, add the following statement to the last row of the file:/bin/bash /etc/init.d/setpasswd.sh

3. Press Esc, enter :wq, and press Enter. The system saves the configuration and exits thevi editor.

3.8 Encrypting an Image

3.8.1 Overview

Application Scenarios

Image encryption can improve data security. You can create an encrypted image to ensuresecurity of the image data.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

70

Page 76: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Restrictions and Limitationsl KMS has been enabled.

l An encrypted image cannot be shared with other users.

l An encrypted image cannot be published in the Marketplace.

l If an ECS has an encrypted system disk, the private image created using the ECS is alsoencrypted.

l The key used for encrypting an image cannot be changed.

l If the key used for encrypting an image is disabled or deleted, the image is unavailable.

l The system disk of an ECS created using an encrypted image is also encrypted, and itskey is the same as the image key.

3.8.2 Creating an Encrypted ImageYou can create an encrypted image using an encrypted ECS or an external image file.

l Create an encrypted image using an encrypted ECS.

When you use an ECS to create a private image, if the system disk of the ECS isencrypted, the private image created using the ECS is also encrypted. The key used forencrypting the image is the one used for creating the system disk. For details, seesections 2.2 Creating a Windows Private Image Using an ECS and 2.3 Creating aLinux Private Image Using an ECS.

l Create an encrypted image using an external image file.

When you use an external image file that has been uploaded to an OBS bucket to create aprivate image, you can select KMS encryption and the key when registering the image toencrypt the image. For details, see 2.4 Creating a Linux Private Image Using anExternal Image File.

3.9 Replicating an Image

Scenarios

You can replicate an image in the following scenarios:

l Replicate an encrypted image to generate an unencrypted image.

Encrypted images cannot be shared or published. If you want to publish or share anencrypted image, you can replicate the encrypted image to generate an unencrypted one,and then publish or share the unencrypted image.

l Replicate an encrypted image to generate an encrypted image.

Encryption keys of encrypted images cannot be changed. If you want to change theencryption key of an encrypted image, you can use the image replication function, andselect a new encryption key to encrypt the image and generate a new private image.

l Replicate an unencrypted image to generate an encrypted image.

If you want to store an unencrypted image in an encrypted way, you can select anencryption key and replicate the image to generate a new encrypted image.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

71

Page 77: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Restrictions and LimitationsYou can replicate a private image in Normal or Normal (Uninitialized) status.

PrerequisitesThe image to be replicated is in Normal or Normal (Uninitialized) status.

Procedure1. Log in to the management console.2. Under Computing, click Image Management Service.3. On the Image Mgmt Service page, click the Private Image tab to enter the page that

displays all private images.4. Locate the row that contains the image to be replicated and click More in the Operation

column.5. Select Replicate.6. In the displayed Replicate Image dialog box, enter the name of the new image.7. (Optional) Encrypt the image.

If you want to encrypt the image or change a key, select KMS encryption and select thekey to be used from the drop-down list.

8. Click OK.

Image Management ServiceUser Guide 3 Management

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

72

Page 78: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

4 FAQs

4.1 Image FAQs

4.1.1 What Are the Charging Standards of IMS?The IMS service and the OS license are free. You are required to pay for storing your privateimages in the Object Storage Service (OBS) bucket. You can use the OBS storage free ofcharge during the trial period.

4.1.2 Will I Be Charged for Creating an Image Using an ECS?Creating an image using an ECS is free of charge. Object Storage Service (OBS) required forstoring the image a paid service with a free trial period.

4.1.3 Is the OBS for Private Images Charged?OBS for private images is free of charge. However, the OBS will be charged later based onstorage capacity. OBS for private images is now in the service trial period and free.

4.1.4 How Many Private Images Can Be Created Using OneAccount?

In this version, you can create a maximum of 10 private images per account per region. Tocreate more private images, submit a work order to increase your quota.

4.1.5 Can Specifications of ECSs Created Using a Private ImageDiffer from Those of ECSs Used to Create the Image?

If you use a private image to create an ECS, the ECS system disk size must be the same asthat of image.

However, specifications of the CPU, memory, bandwidth, and data disk specifications can bedifferent if necessary.

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

73

Page 79: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

4.1.6 How Long Does It Take to Create a Private Image Using anECS?

It takes about 20 minutes to create a private image using an ECS.

4.1.7 Should I Stop the ECS Before Creating a Private ImageUsing that ECS?

You must stop the ECS when creating a private image using that ECS. If the ECS is running,the ECS memory may buffer data to be read, which may result in data loss in the createdimage. To prevent this issue, stop the ECS before creating an image.

4.1.8 What Can I Do If I Configure an Incorrect System Disk SizeDuring Private Image Registration Using an Image File?

If you configure a system disk size smaller than the size of the image file system disk duringprivate image registration using an image file, ECS creation using the registered private imagewill fail.

If this happens, delete the incorrect image and create a private image again using the correctparameter settings.

4.1.9 What Are the Impacts If the ECS That Has Not BeenConfigured Is Used to Create the Private Image?

If the IP address assignment mode of the ECS NIC is not set to DHCP or the network udevrules are not deleted, the ECS created using the registered private image may fail to obtain thecorrect network configuration, or the ECS NIC is not started from eth0. Then, you must log inremotely to the ECS and configure it.

If you do not configure the image used for creating the ECS running Linux before thecreation, the following conditions may occur:

l Customized passwords cannot be injected.l Certificated cannot be injected.l Some customized ECS configurations may not be supported.

If you do not delete the automatic attaching detection information of user disks from the fstabfile, the ECS created using the private image may fail to start.

4.1.10 Can I Use Images in Formats Other Than Those Specifiedin This Document?

No, you cannot. Currently, only VMDK, VHD, QCOW2, and ZVHD formats are supported.

Images of the -flat.vmdk format and image file packages containing snapshot volumes ordelta volumes are not supported. You can use qemu-img to convert the format of an imageinto a supported one before uploading it to the public cloud platform.

For how to install and use qemu-img on Windows, visit the following website:

https://cloudbase.it/qemu-img-windows/

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

74

Page 80: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

4.1.11 What Can I Do If the Disks of ECS Created Using a CentOSImage Cannot Be Found?

This is caused by the xen-blockfront.ko module not being installed before ECS startup. Youneed to modify OS kernel boot parameters.

Log in to the ECS using VNC.

The page shown in Figure 4-1 is displayed.

Figure 4-1 VNC login page

NOTE

This step must be performed after the OS starts. Modify kernel boot parameters in the original ECS usedfor creating the image (recommended).

Perform the following operations to modify OS kernel boot parameters:

1. Run the following command to log in to the OS:

lsinitrd /boot/initramfs-OS kernel version.img |grep -i xen

– If the command output contains xen-blockfront.ko, contact technical support.

– If no command output is displayed, go to 2.

2. Back up the original GRUB configuration file grub.conf.

– If the ECS runs CentOS 6, run the following command:

cp /boot/grub/grub.conf /boot/grub/grub.conf.bak

– If the ECS runs CentOS 7, run the following command:

cp /boot/grub2/grub.conf /boot/grub2/grub.conf.bak

3. Use the vi editor to open the GRUB configuration file. Run the following command(using CentOS 7 as an example):

vi /boot/grub2/grub.conf

4. Add xen_emul_unplug=never to the right of the related default boot kernel on the pageshown in Figure 4-2.

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

75

Page 81: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Figure 4-2 Adding a parameter

5. Press Esc, enter :wq, and press Enter to exit the vi editor.

6. Create an image using the ECS, upload the created image, and register the image as aprivate image of the public cloud system.

4.1.12 How Can a Refused Image Be Used?If user B has refused an image shared by user A, but wants to use the image, user A mustperform the following operations:

1. Delete user B's account name from the tenant list of the shared image. For details, seesection 3.4.8 Deleting Tenants Who Can Use Shared Images.For details, see sectionDeleting Tenants Who Can Use Shared Images.

2. Add user B again as a tenant with whom the image is shared. For details, see section3.4.7 Adding Tenants Who Can Use Shared Images.For details, see section AddingTenants Who Can Use Shared Images.

4.1.13 What Changes Will Be Made to an Image File Used forRegistering a Private Image?

If you choose automatic configuration when registering a private image using an image file,the system will perform the following operations:

For Linux:

l Modify the grub and syslinux configuration files to add the OS kernel boot parametersand change the disk partition name to UUID=UUID of the disk partition.

l Change the names of the disk partitions in the /etc/fstab file to UUID=UUID of the diskpartition.

l Check whether the initrd file has the Xen and IDE drivers. If no, load the Xen and IDEdrivers.

l Modify the xwindows configuration file /etc/X11/xorg.conf to prevent display failures.

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

76

Page 82: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

l Delete services of VMware tools.

4.1.14 What Should I Do If No Partition Is Found During theStartup of an ECS Created Using a Private Image That Is CreatedUsing an External Image File?

The disk partition ID changes and the image cannot query the partition name using theoriginal partition ID. You need to change the partition name to UUID=UUID of the diskpartition.

The following uses OpenSUSE 13.2 as an example to describe how to change the partitionname.

1. Run the following command to query the disk partition ID:ls -l /dev/disk/by-id/The example command output is as follows.total 0lrwxrwxrwx 1 root root 10 Jul 22 01:35 ata-QEMU_HARDDISK_QM00001 -> ../../xvdalrwxrwxrwx 1 root root 11 Jul 22 01:35 ata-QEMU_HARDDISK_QM00001-part1 -> ../../xvda1lrwxrwxrwx 1 root root 12 Jul 22 01:35 ata-QEMU_HARDDISK_QM00001-part10 -> ../../xvda10lrwxrwxrwx 1 root root 11 Jul 22 01:35 ata-QEMU_HARDDISK_QM00001-part2 -> ../../xvda2lrwxrwxrwx 1 root root 11 Jul 22 01:35 ata-QEMU_HARDDISK_QM00001-part5 -> ../../xvda5lrwxrwxrwx 1 root root 11 Jul 22 01:35 ata-QEMU_HARDDISK_QM00001-part6 -> ../../xvda6lrwxrwxrwx 1 root root 11 Jul 22 01:35 ata-QEMU_HARDDISK_QM00001-part7 -> ../../xvda7lrwxrwxrwx 1 root root 11 Jul 22 01:35 ata-QEMU_HARDDISK_QM00001-part8 -> ../../xvda8lrwxrwxrwx 1 root root 11 Jul 22 01:35 ata-QEMU_HARDDISK_QM00001-part9 -> ../../xvda9lrwxrwxrwx 1 root root 10 Jul 22 01:35 ata-QEMU_HARDDISK_QM00005 -> ../../xvdelrwxrwxrwx 1 root root 10 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00001 -> ../../xvdalrwxrwxrwx 1 root root 11 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00001-part1 -> ../../xvda1lrwxrwxrwx 1 root root 12 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00001-part10 -> ../../xvda10lrwxrwxrwx 1 root root 11 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00001-part2 -> ../../xvda2lrwxrwxrwx 1 root root 11 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00001-part5 -> ../../xvda5lrwxrwxrwx 1 root root 11 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00001-part6 -> ../../xvda6lrwxrwxrwx 1 root root 11 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00001-part7 -> ../../xvda7lrwxrwxrwx 1 root root 11 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00001-part8 -> ../../xvda8lrwxrwxrwx 1 root root 11 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00001-part9 -> ../../xvda9lrwxrwxrwx 1 root root 10 Jul 22 01:35 scsi-SATA_QEMU_HARDDISK_QM00005 -> ../../xvde

ata-QEMU_HARDDISK_xxx and scsi-SATA_QEMU_HARDDISK_xxx indicate thatthe disk of the ECS is simulated using Quick EMUlator (QEMU). The content at the leftof -> is the disk partition ID, and that at the right of -> is the partition name.

2. Run the following command to query the disk partition UUID:ls -l /dev/disk/by-uuid/

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

77

Page 83: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

The example command output is as follows.total 0lrwxrwxrwx 1 root root 11 Jul 22 01:35 45ecd7a0-29da-4402-a017-4564a62308b8 -> ../../xvda5lrwxrwxrwx 1 root root 11 Jul 22 01:35 55386c6a-9e32-41d4-af7a-e79596221f51 -> ../../xvda9lrwxrwxrwx 1 root root 11 Jul 22 01:35 55f36660-9bac-478c-a701-7ecc5347f789 -> ../../xvda8lrwxrwxrwx 1 root root 11 Jul 22 01:35 780f36bc-0ada-4c98-9a8d-44570d65333d -> ../../xvda1lrwxrwxrwx 1 root root 11 Jul 22 01:35 b3b7c47f-6a91-45ef-80d6-275b1cc16e19 -> ../../xvda6lrwxrwxrwx 1 root root 11 Jul 22 01:35 ea63b55d-3b6e-4dcd-8986-956b72bac3e9 -> ../../xvda7lrwxrwxrwx 1 root root 12 Jul 22 01:35 eb3cc645-925e-4bc5-bedf-c2a6f3b65809 -> ../../xvda10

The content at the left of -> is the disk partition UUID, and that at the right of -> is thepartition name. Obtain the relationship between the disk partition name, partition ID, andpartition UUID.

3. Run the following command to check the partition names in the /etc/fstab file:vi /etc/fstabThe example command output is as follows./dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part5 / ext3 defaults,errors=panic 1 1/dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part1 /boot ext3 defaults,errors=panic 1 2/dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part6 /home ext3 nosuid,errors=panic 1 2/dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part10 /opt ext3 defaults,errors=panic 1 2/dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part7 /tmp ext3 nodev,nosuid,errors=panic 1 2/dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part9 /usr ext3 defaults,errors=panic 1 2/dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part8 /var ext3 nodev,nosuid,errors=panic 1 2sysfs /sys sysfs noauto 0 0proc /proc proc defaults 0 0usbfs /proc/bus/usb usbfs noauto 0 0devpts /dev/pts devpts mode=0620,gid=5 0 0/dev/cdrom /media/ udf,iso9660 noexec,noauto,nouser,nodev,nosuid 1 2tmpfs /dev/shm tmpfs noexec,nodev,nosuid 0 0

The values in the first column are the disk partition IDs.4. Press i to enter the editing mode. Change the disk partition ID in the row that

contains /dev/disk/xxx in the /etc/fstab file in 3 to UUID=UUID of the disk partitionbased on the query results in 1 and 2.The modified content is as follows.UUID=45ecd7a0-29da-4402-a017-4564a62308b8 / ext3 defaults,errors=panic 1 1UUID=780f36bc-0ada-4c98-9a8d-44570d65333d /boot ext3 defaults,errors=panic 1 2UUID=b3b7c47f-6a91-45ef-80d6-275b1cc16e19 /home ext3 nosuid,errors=panic 1 2UUID=eb3cc645-925e-4bc5-bedf-c2a6f3b65809 /opt ext3 defaults,errors=panic 1 2UUID=ea63b55d-3b6e-4dcd-8986-956b72bac3e9 /tmp ext3 nodev,nosuid,errors=panic 1 2UUID=55386c6a-9e32-41d4-af7a-e79596221f51 /usr ext3 defaults,errors=panic 1 2UUID=55f36660-9bac-478c-a701-7ecc5347f789 /var ext3 nodev,nosuid,errors=panic 1 2sysfs /sys sysfs noauto 0 0proc /proc proc defaults 0 0usbfs /proc/bus/usb usbfs noauto 0 0devpts /dev/pts devpts mode=0620,gid=5 0 0/dev/cdrom /media/ udf,iso9660 noexec,noauto,nouser,nodev,nosuid 1 2tmpfs /dev/shm tmpfs noexec,nodev,nosuid 0 0

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

78

Page 84: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

NOTE

Ensure that the UUIDs are modified correctly so that ECSs can start properly.

5. Press Esc, enter :wq, and press Enter. The system saves the configuration and exits thevi editor.

6. Check the partition names in the system boot configuration file.The system boot configuration files for different OSs vary. Confirm the bootconfiguration file of the current OS.– Grand Unified Boot Loader (GRUB) configuration file

n /boot/grub/grub.confn /boot/grub/menu.lstn /boot/grub/grub.cfgn /boot/grub2/grub.cfg

– Syslinux configuration filen /extlinux.confn /boot/syslinux/extlinux.confn /boot/extlinux/extlinux.confn /boot/syslinux/syslinux.cfgn /syslinux/syslinux.cfgn /syslinux.cfg

The boot file in this example is /boot/grub/menu.lst. Run the following command tocheck it:vi /boot/grub/menu.lstdefault 0timeout 3title xxx Server OS - xxxxxxkernel /boot/vmlinuz-3.0.101-0.47.52-default root=/dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part5 resume= memmap=0x2000000$0x3E000000 nmi_watchdog=2 crashkernel=512M-:256M console=ttyS0,115200 console=tty0 xen_emul_unplug=allinitrd /boot/initrd-3.0.101-0.47.52-default

7. Press i to enter the editing mode and change the partition names in the system bootconfiguration file.Change the disk partition name in the /boot/grub/menu.lst file in 6 to UUID=UUID ofthe disk partition based on the query results in 1 and 2.default 0timeout 3title xxx Server OS - xxxxxxkernel /boot/vmlinuz-3.0.101-0.47.52-default root=UUID=45ecd7a0-29da-4402-a017-4564a62308b8 resume= memmap=0x2000000$0x3E000000 nmi_watchdog=2 crashkernel=512M-:256M console=ttyS0,115200 console=tty0 xen_emul_unplug=allinitrd /boot/initrd-3.0.101-0.47.52-default

8. Press Esc, enter :wq, and press Enter. The system saves the configuration and exits thevi editor.

4.1.15 What Initial Configuration Needs to Be Performed for anExternal Image File Used to Create a Private Image?

When an external image file is used to create a private image, initial configuration needs to beperformed on the image file so that the created private image is normal.

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

79

Page 85: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

If initial configuration has been performed on the external image file, you can select Initialconfiguration has been performed for this image. when registering the image file as aprivate image.

The following initial configuration needs to be performed for the external image file used tocreate a private Linux image:

l Query and delete files in the network rule directory.l Query and configure NIC attributes.l Install and configure Cloud-Init.

For details, see sections Creating an ECS and Configuring a Linux ECS.

4.1.16 How Can I Share an Encrypted Image or Publish It inMarketplace?

You are not allowed to share an encrypted image or publish it in Marketplace. If you want todo this, you can replicate the image to generate an unencrypted one, and share theunencrypted image in Marketplace.

4.1.17 How Can I Change an Unencrypted Image to an EncryptedOne?

If you want to store an unencrypted image in an encrypted way, you can select an encryptionkey and replicate the image to generate a new encrypted image.

4.2 OS FAQs

4.2.1 Can I Specify the Size of the EVS System Disk When Usinga Private Image to Create an ECS?

If you use an image to create an ECS, the system disk size of the ECS must be the same asthat of the image.

4.2.2 What Should I Do If the Provided OS Images Cannot MeetMy Requirement?

Contact 4000-955-988 or send emails to [email protected].

4.2.3 What Are the Usage Requirements of Each Type of OS?l Windows

Applies to development platforms or services developed on Windows.The EVS system disk size must be at least 40 GB, and the memory size must be at least1 GB.Internet Information Server (IIS) and Structured Query Language (SQL) servers can beinstalled on ECSs running Windows.

l Linux

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

80

Page 86: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Applies to development platforms or services developed on Linux. CentOS and UbuntuOSs are supported. CentOS is recommended.The system disk must be at least 40 GB, and system memory must be at least 512 MB.

l OS with greater than 4 GB memoryA 64-bit or higher OS must be used. This is because a 32-bit OS can access only memoryunder 4 GB.

4.2.4 Why Is the Sysprep Operation Required for Creating PrivateImages Using a Windows ECS?

For a user that needs to be added to the domain and uses the domain account to log in toWindows, the Sysprep operation is required before creating private images. Otherwise, theimage will contain information about the original ECS, especially the SID information. AnECS with multiple same SIDs cannot be added to the domain. For details about the Sysprepoperation, visit the following website:

https://technet.microsoft.com/en-us/library/cc721940(v=ws.10).aspx

If Windows does not require any user or ECS to be added to the domain, you can choose toskip the Sysprep operation.

Due to OS limitations, Sysprep can only be used for configuring a new Windows installation.You can perform the Sysprep operation multiple times to install and configure Windows.However, you can reset and activate Windows OS only three times, and you are not allowedto use Sysprep to re-configure the existing Windows OS.

In the Windows command line, enter the following command and check the number ofSysprep operations you can still perform in the displayed Windows Script Host dialog box:

slmgr /dlv

If the value of Remaining Windows rearm count is 0, you cannot perform the Sysprepoperation.

4.2.5 What Impact Will Be Brought by an Inconsistency Betweenthe Image OS I Select or Identified by the System and That of theActual Image During Creation of a Private Image Using anExternal Image File?

Each type of special ECS supports specified OSs. If the OS you select or identified by thesystem is inconsistent with that of the image, ECSs created using this image cannot runproperly. For details, see the Elastic Cloud Server User Guide.

Table 4-1 lists the OSs supported by each type of special ECS. OSs of ECSs not listed in thetable are consistent with those supported for public images.

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

81

Page 87: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Table 4-1 Special ECSs and OSs supported by them

ECS Supported OS

GPU-optimized (g1) ECS Windows Server 2008 R2 Enterprise SP164bitWindows Server 2012 R2 Standard 64bitWindows Server 2016 DataCenter

GPU-optimized (g2) ECS Windows Server 2008 R2 Enterprise SP164bitWindows Server 2012 R2 Standard 64bit

Disk-intensive ECS CentOS 7.2 64bitCentOS 7.3 64bitCentOS 6.8 64bitSUSE Enterprise Linux Server 11 SP3 64bitSUSE Enterprise Linux Server 11 SP4 64bitSUSE Enterprise Linux Server 12 SP1 64bitSUSE Enterprise Linux Server 12 SP2 64bitRed Hat Enterprise Linux 6.8 64bitRed Hat Enterprise Linux 7.3 64bit

High-performance ECS CentOS 6.8 64bitCentOS 7.2 64bitCentOS 7.3 64bitWindows Server 2008Windows Server 2012Windows Server 2016SUSE Linux Enterprise Server 11 SP3 64bitSUSE Linux Enterprise Server 11 SP4 64bitSUSE Linux Enterprise Server 12 SP1 64bitSUSE Linux Enterprise Server 12 SP2 64bitRed Hat Enterprise Linux 6.8 64bitRed Hat Enterprise Linux 7.3 64bit

Image Management ServiceUser Guide 4 FAQs

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

82

Page 88: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

A Change History

Release Date What's New

2017-03-30 This issue is the ninth official release, which incorporates the followingchanges:l Added the OSs supported for external image files, including Debian

8.7.0 64bit and Oracle Linux Server release 6.8 64bit.l Optimized the steps to install Cloudbase-Init.l Modified steps in section "Sharing an Image" (users need to obtain

the domain name of the image recipient with whom they shareimages).

l Updated the table that lists special ECSs and OSs supported by them.

2017-02-28 This issue is the eighth official release, which incorporates the followingchanges:l The image replication feature is added.l Added EulerOS 2.2 64bit to the supported OSs of public images.l Added the followings to the supported OSs of external image files:

SUSE Linux Enterprise Server 12 SP2 64bit, Oracle Linux Serverrelease 6.5 64bit, Oracle Linux Server release 7.3 64bit, Redhat 6.764bit, OpenSUSE 42.2 64bit, CentOS 7.3 64bit, and Fedora 25 64bit.

2017-02-08 This issue is the seventh official release, which incorporates thefollowing change:Added support for external images running Redhat 7.3 64bit.

2017-01-20 This issue is the sixth official release, which incorporates the followingchanges:l Added the image encryption feature.l Added new OSs supported for external image files, including SUSE

Linux Enterprise Server 12 SP1 64bit, SUSE Linux Enterprise Server11 SP4 64bit, Oracle Linux Server release 7.0 64bit, Redhat 7.1 64bit,OpenSUSE 42.1 64bit, and EulerOS 2.2 64bit.

l Added descriptions of the step to select the OS required by the imageduring image registration.

Image Management ServiceUser Guide A Change History

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

83

Page 89: User Guide - static.huaweicloud.com · Image Management Service User Guide Issue 09 Date 2017-03-30 HUAWEI TECHNOLOGIES CO., LTD

Release Date What's New

2016-12-30 This issue is the fifth official release, which incorporates the followingchange:Added support for external image files running OpenSUSE 11.3 64bit.

2016-11-28 This issue is the fourth official release, which incorporates the followingchanges:l Supported Debian 8.6.0 64bit for public images and external image

files.l Added GPU driver installation operations for configuring a Windows

ECS.l Added the Cloud-Init feature.l Added the function of optimizing Windows and Linux private images.

2016-10-19 This issue is the third official release, which incorporates the followingchanges:l Added the function for exporting images.l Updated the OSs supported by IMS for public images.

2016-07-15 This issue is the second official release, which incorporates the followingchanges:l Supported image sharing.l Added the interface for creating a private image using an external

image file.l Updated the OSs supported by IMS for public images.

2016-03-14 This issue is the first official release.

Image Management ServiceUser Guide A Change History

Issue 09 (2017-03-30) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

84