Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of creating an ECS instance or replacing an instance system disk using a custom image created

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the method of using the created custom image to create an ECS instance or replace the instance system disk, which can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

CreateImage

Description

When calling this interface, you need to be aware of:

You need to wait for the mirror state to become available (Available) before using the mirror resource.

The OperationLocks of a security-controlled ECS instance cannot be marked "LockReason": "security".

Creation method

Three ways to create a custom image through this interface are described below.

Method one. If you need to create a custom image of an instance's system disk, you only need to specify a historical snapshot ID (SnapshotId) of the instance's system disk. Where the specified snapshot cannot be a snapshot created before July 15, 2013 (inclusive).

Method two. If you need to use an instance as a template, just specify the instance ID (InstanceId). The status of the instance must be running (Running) or stopped (Stopped). After the API is called successfully, a snapshot will be added to each disk of the instance.

Method three. If you need to combine multiple snapshots into a single mirror template, you only need to establish a few disk data associations (DiskDeviceMapping). When creating a custom image in this way, you need to be aware of:

Only one snapshot of the system disk can be specified, and the device name of the system disk must be / dev/xvda.

Multiple data disk snapshots can be specified. Data disk device names are assigned sequentially by the system by default, sorted from / dev/xvdb to / dev/xvdz, and cannot be repeated.

You can not specify SnapshotId, when not specified, an empty data disk of the specified size without any data will be created.

The specified snapshot cannot be a snapshot created before July 15, 2013 (inclusive).

Request parameter

Return parameters

Example

Request example

Https://ecs.aliyuncs.com/?Action=CreateImage&RegionId=cn-hangzhou&SnapshotId=s-snapshot1&ImageName=demo_image&

Return the example

XML format

C8B26B44-0189-443E-9816-D951F59623A9 m-63DFD5FB2

JSON format

{"RequestId": "C8B26B44-0189-443E-9816-D951F59623A9", "ImageId": "m-63DFD5FB2"}

Error code

The following are the error codes specific to this API. For more error codes, please visit the API error Center.

Thank you for reading this article carefully. I hope the editor can share the method of using the custom image created to create ECS instance or replace the instance system disk to help everyone. At the same time, I also hope you can support it, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report