Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Image Management Service/ Getting Started/ Scenario 2: Creating a Linux System Disk Image from an External Image File

Scenario 2: Creating a Linux System Disk Image from an External Image File

Updated on 2024-08-29 GMT+08:00

You can import a local image or a system disk image from another cloud platform. After an image is imported, you can use it to create an ECS or reinstall the OS of an existing ECS.

This guide describes how to create a Linux system disk image from an external image file.

Preparations

  1. Sign up for Huawei Cloud and complete real-name authentication.

    Before using IMS, sign up for a HUAWEI ID, enable Huawei Cloud services, and complete real-name authentication.

    If you have enabled Huawei Cloud services and completed real-name authentication, skip this step.

  2. Top up your account.

    Creating a private image is free, but you will be charged for the OBS bucket you use to store the uploaded image file. Ensure that your account has sufficient balance. If not, top up your account.

Step1: Prepare an Image File

You need to prepare an image file that meets the following requirements:

  • OS: SUSE, Oracle Linux, Red Hat, Ubuntu, etc. (32-bit or 64-bit)
  • Image format: VMDK, VHD, QCOW2, RAW, VHDX, QED, VDI, QCOW, ZVHD2, or ZVHD
  • Image size: no larger than 128 GB. If the image size is between 128 GB and 1 TB, convert the image file into RAW or ZVHD2 and import it using fast import.
  • Network: Files in the network rule directory are deleted and DHCP is configured for the NICs.
  • Tools: Cloud-Init has been installed.
  • Drivers: Native Xen and KVM drivers have been installed.
  • File system: The disk identifier in the GRUB configuration file and fstab file are set to UUID.
    NOTE:

    Click here to learn more about the file restrictions and how to check and configure an image file.

Step 2: Upload the Image File

You are advised to use OBS Browser+ to upload external image files to an OBS bucket. For details, see OBS Browser+ Best Practices.

For how to download OBS Browser+, see Downloading OBS Browser+.

Figure 1 Uploading an image file

Step 3: Register the Image File as a Private Image

  1. Log in to the management console. In the service list, choose Compute > Image Management Service.
  2. In the image list, click Create Image in the upper right corner.
  3. In the Image Type and Source area, select Import Image for Type and System disk image for Image Type. Select the bucket storing the image file from the list and then select the image file.
    Figure 2 Importing an image file
    Figure 3 Image information
    Table 1 Image parameters

    Parameter

    Example Value

    Description

    Enable automatic configuration

    Enable

    If you select this option, the system will automatically check and optimize the image file. For details, see What Will the System Do to an Image File When I Use the File to Register a Private Image?

    Function

    ECS system disk image

    This parameter specifies whether the image is used to create ECSs or BMSs. The value can be ECS system disk image or BMS system disk image.

    Architecture

    x86

    The value can be x86 or ARM.

    • If the system identifies that the architecture in the image file is different from what you set here, the identified architecture prevails.
    • If the system fails to identify an architecture, the architecture you set will be used.

    Boot Mode

    BIOS

    This parameter is optional. The value can be BIOS or UEFI. For details about the differences between them, see How Is BIOS Different from UEFI?

    For details about which OSs support UEFI boot, see OSs supporting UEFI Boot Mode.

    The boot mode must be the same as that in the image file. You need to confirm which boot mode is used in the image file. After you select the right boot mode, the boot mode will be configured for the image at the background. Select the right boot mode, or ECSs created using the image will not be able to boot up.

    OS

    Ubuntu

    20.04 server 64bit

    To ensure that the image can be created and used properly, select an OS consistent with that in the image file. If you do not select an OS, the system attempts to automatically identify the OS in the image file.

    NOTE:
    • If the system identifies that the OS in the image file is different from the one you select here, the identified OS prevails.
    • If the system fails to identify an OS, the OS you select will be used.
    • If the OS you selected or identified by the system is inconsistent with the actual one, ECSs created from the image file may not work properly.

    System Disk (GB)

    40

    The system disk capacity (value range: 40 GB to 1024 GB). Ensure that this value is not less than the system disk capacity in the image file.

    NOTE:

    If the uploaded VHD image is generated using qemu-img or similar tools, check the system disk capacity based on What Do I Do If the System Disk Capacity in a VHD Image File Exceeds the One I Have Specified on the Management Console When I Use This File to Register a Private Image?

    Data Disk (GB)

    Not add

    You can also add data disks to the image. You need to obtain an image file containing data disks in advance. This function is used to migrate VMs and data disks from other platforms to the current platform.

    To add data disks, click , configure the data disk capacity, and click Select Image File. In the displayed dialog box, select the target bucket and then the target image file containing the data disk.

    A maximum of three data disks can be added.

    Name

    UbuntuImage

    Enter a name for the image.

    Encryption

    Not select

    (Optional) If you want to encrypt the image, select KMS encryption and select the key to be used from the key list. After you select KMS encryption, the system will create a default key ims/default for you. You can also select a key from the key list.

    For how to encrypt an image, see Creating Encrypted Images.

    NOTE:

    If the encrypted image needs to be shared with other tenants, use a custom key to encrypt it. Otherwise, the key cannot be authorized to other tenants, causing the sharing failure.

    Enterprise Project

    default

    Select an enterprise project from the drop-down list. This parameter is available only if you have enabled enterprise projects or your account is an enterprise account.

    An enterprise project provides central management of cloud resources on a project.

    Tag

    Key: usage

    Value: project

    (Optional) Set a tag key and a tag value for the image to make identification and management of your images easier. You are advised to create predefined tags in TMS. For details, see Creating Predefined Tags .

    NOTE:

    If your organization has configured tag policies for images, you need to add tags to your images based on the policies. If you add a tag that does not comply with the tag policies, images may fail to be created. Contact the organization administrator to learn more about the tag policies.

    • Each tag consists of a key and a value. The key contains a maximum of 36 characters, and the value contains a maximum of 43 characters. The key cannot be left blank or be an empty string. The value cannot be left blank but can be an empty string.
    • An image can have a maximum of 10 tags.

    Description

    imageTest

    (Optional) Enter a description of the image.

  4. Read and agree to the image disclaimer. Click Next.
  5. Confirm the parameter settings and click Submit.
  6. Go back to the private image list. When the image status changes to Normal, the image is created successfully.

Follow-up Procedure

After a system disk image is created, you can use it to create an ECS or change the OS of an existing ECS. This way, you can migrate data from a server to another. For details, see:

For more information, see Creating a Linux System Disk Image from an External Image File.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback