Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

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
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
Situation Awareness
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
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Scalable File Service Turbo
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
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

Importing an Image File Quickly

Updated on 2024-04-17 GMT+08:00

Function

This API is used to quickly create a private image from an oversized external image file that has uploaded to the OBS bucket. Currently, only ZVHD2 and RAW image files are supported, and the size of an image file cannot exceed 1 TB.

The fast image creation function is only available for image files in RAW or ZVHD2 format. For other formats of image files that are smaller than 128 GB, you are advised to import these files with the common method.

The API is an asynchronous one. If it is successfully called, the cloud service system receives the request. However, you need to use the asynchronous job query API to query the image creation status. For details, see Querying the Status of an Asynchronous Job.

Constraints

Before importing image files, ensure that the file format is RAW or ZVHD2 and the following have been done:
  • RAW image files have been optimized, and bitmap files have been generated.
  • ZVHD2 image files have been optimized as required.
NOTE:

For how to convert image file formats and generate a bitmap file, see section "Quickly Importing an Image File" in the Image Management Service User Guide.

URI

POST /v2/cloudimages/quickimport/action

Request

  • Parameters in the request body when an image file is used to create a system disk image

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    String

    Specifies the image name.

    For detailed description, see Image Attributes.

    description

    No

    String

    Provides supplementary information about the image.

    For detailed description, see Image Attributes.

    The value contains a maximum of 1024 characters and consists of only letters and digits. Carriage returns and angle brackets (< >) are not allowed. This parameter is left blank by default.

    os_version

    Yes

    String

    Specifies the OS version.

    This parameter is valid if an external image file uploaded to the OBS bucket is used to create an image. For its value, see Values of Related Parameters.

    image_url

    Yes

    String

    Specifies the URL of the external image file in the OBS bucket.

    This parameter is mandatory if an external image file in the OBS bucket is used to create an image. The format is OBS bucket name:Image file name.

    NOTE:

    The storage class of the OBS bucket must be Standard.

    min_disk

    Yes

    Integer

    Specifies the minimum size (GB) of the system disk.

    • This parameter is mandatory if an external image file in the OBS bucket is used to create an image.
    • The value ranges from 1 to 1024 and must be greater than the size of the selected image file.

    tags

    No

    Array of strings

    Lists the image tags. This parameter is left blank by default.

    Set either tags or image_tags.

    image_tags

    No

    Array of objects

    Lists the image tags. This parameter is left blank by default.

    Set either tags or image_tags.

    type

    No

    String

    Specifies the image type. The parameter value is ECS/BMS for system disk images. The default value is ECS.

    enterprise_project_id

    No

    String

    Specifies the enterprise project that the image belongs to.

    • If the value is 0 or left blank, the image belongs to the default enterprise project.
    • If the value is a UUID, the image belongs to the enterprise project corresponding to the UUID.

      For more information about enterprise projects and how to obtain enterprise project IDs, see Enterprise Management User Guide.

    architecture

    No

    String

    Specifies the image architecture type. Available values include:

    • x86
    • arm

    The default value is x86.

    NOTE:

    If the image architecture is ARM, the boot mode is automatically changed to UEFI.

  • Parameters description when an image file uploaded to the OBS bucket is used to create an image

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    String

    Specifies the image name. For detailed description, see Image Attributes.

    description

    No

    String

    Provides supplementary information about the image. For detailed description, see Image Attributes. The value contains a maximum of 1024 characters and consists of only letters and digits. Carriage returns and angle brackets (< >) are not allowed. This parameter is left blank by default.

    os_type

    No

    String

    Specifies the OS version.

    When a data disk image created, the value can be Linux or Windows. The default is Linux.

    image_url

    Yes

    String

    Specifies the URL of the external image file in the OBS bucket.

    This parameter is mandatory if an external image file in the OBS bucket is used to create an image. The format is OBS bucket name:Image file name.

    NOTE:

    The storage class of the OBS bucket must be Standard.

    min_disk

    Yes

    Integer

    Specifies the minimum size of the system disk in the unit of GB.

    This parameter is mandatory if an external image file in the OBS bucket is used to create an image. The value ranges from 1 to 1024.

    tags

    No

    Array of strings

    Lists the image tags. This parameter is left blank by default.

    Set either tags or image_tags.

    image_tags

    No

    Array of objects

    Lists the image tags. This parameter is left blank by default.

    Set either tags or image_tags.

    type

    Yes

    String

    Specifies the image type. The parameter value is DataImage for data disk images.

    enterprise_project_id

    No

    String

    Specifies the enterprise project that the image belongs to.

    • If the value is 0 or left blank, the image belongs to the default enterprise project.
    • If the value is a UUID, the image belongs to the enterprise project corresponding to the UUID.

      For more information about enterprise projects and how to obtain enterprise project IDs, see Enterprise Management User Guide.

Example Request

  • Creating a system disk image with parameter tags using a file in an OBS bucket (file address in the bucket: ims-image:centos70.zvhd2)
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    POST https://{Endpoint}/v2/cloudimages/quickimport/action
    {  
        "name": "ims_test_file",  
       "description": "Create an image using a file in the OBS bucket.", 
        "image_url": "ims-image:centos70.zvhd2",  
        "os_version": "CentOS 7.0 64bit",  
        "min_disk": 40,  
        "type": "ECS", 
        "tags":
            [
                "aaa.111",    
                "bbb.333",    
                "ccc.444"    
            ]
    }
    
  • Creating a system disk image with parameter image_tags using a file in an OBS bucket (file address in the bucket: ims-image:centos70.zvhd2)
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    POST https://{Endpoint}/v2/cloudimages/quickimport/action
    {  
        "name": "ims_test_file",  
       "description": "Create an image using a file in the OBS bucket.", 
        "image_url": "ims-image:centos70.zvhd2",  
        "os_version": "CentOS 7.0 64bit",  
        "min_disk": 40,  
        "type": "ECS", 
        "image_tags": [{"key":"key2","value":"value2"},{"key":"key1","value":"value1"}]  
    }
    
  • Creating a data disk image with parameter tags using a file in an OBS bucket (file address in the bucket: ims-image:centos70.zvhd2)
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    POST https://{Endpoint}/v2/cloudimages/quickimport/action
    {  
        "name": "ims_test_file",  
       "description": "Create an image using a file in the OBS bucket.", 
        "image_url": "ims-image:centos70.zvhd2",  
        "os_type": "Linux",  
        "min_disk": 40,  
        "type": "DataImage",  
        "tags": [    
            "aaa.111",    
            "bbb.333",    
            "ccc.444"    
        ]
    }
    
  • Creating a data disk image with parameter image_tags using a file in an OBS bucket (file address in the bucket: ims-image:centos70.zvhd2)
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    POST https://{Endpoint}/v2/cloudimages/quickimport/action
    {  
        "name": "ims_test_file",  
       "description": "Create an image using a file in the OBS bucket.", 
        "image_url": "ims-image:centos70.zvhd2",  
        "os_type": "Linux",  
        "min_disk": 40,  
        "type": "DataImage",
        "image_tags": [{"key":"key2","value":"value2"},{"key":"key1","value":"value1"}]
    }
    

Response

  • Response parameters

    Parameter

    Type

    Description

    job_id

    String

    Specifies the asynchronous job ID.

    For details, see Querying the Status of an Asynchronous Job.

  • Example response
    STATUS CODE 200
    1
    2
    3
    {
         "job_id": "8a12fc664fb4daa3014fb4e581380005"
    }
    

Returned Values

  • Normal

    200

  • Abnormal

    Return Value

    Description

    400 Bad Request

    Request error. For details about the returned error code, see Error Codes.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    You do not have the rights to perform the operation.

    404 Not Found

    The requested resource was not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    The service is unavailable.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback