Change the system disk (custom image)

Last Updated: Sep 07, 2017

By changing the system disk, you can change the operating system to your custom image, which may be:

When changing a system disk, if you want to keep the operating system, environment configurations, and/or data, you can use the instance or a system disk to create a custom image, and then use the image to change the system disk. This document uses this scenario to describe how to change the image on a system disk to a custom image.

For instructions about how to change the OS to a public image, see Change the system disk (public image).

Changing the system disk will not change your instance IP address.

Note: Regions that are not in mainland China do not support replacement between Linux and Windows. A Linux or Windows can be only replaced by a different version of the same operating system type.

Warning:

  • Stopping an instance may disrupt traffic.
  • Redeploying the runtime environment on the new system disk is required once it is stopped and this may disrupt traffic.
  • Automatic snapshots and data from your original system disk will be lost once the system disk is replaced. Ensure that all necessary data has been backed up in advance. If you want to retain auto snapshots, see disable releasing auto snapshots with disk.
  • Manually created snapshots from the original system disk are retained but cannot be used to roll back the new system disk because the disk ID is changed. You can use the retained snapshots to create custom images.
  • The original system disk will be deleted once the system disk is replaced.
  • Ensure that the system disk has at least 1 GB of free space. Otherwise, the instance may fail to start after you change the system disk.

Procedure of changing the system disk

A complete procedure of changing the system disk includes the following steps:

  • Step 1. Back up the current system disk by creating a snapshot.
  • Step 2. Create an image from the snapshot.
  • Step 3. Change the system disk and selecting a new OS.
  • Step 4. Set auto snapshot policies for the new system disk.

To retain enough snapshot quota for the auto snapshot policy of the new disk, please delete unwanted snapshots before proceeding. If you wish to change the OS and do not need to retain the data from the current system disk, you can proceed directly to Step 3 of this section.

Step 1: Back up the current system disk by creating a snapshot

Note:

  • Skip this step if you do not want to retain the data in the system disk.
  • Do not create the snapshot during busy hours.
  • It takes about 40 minutes to create a snapshot of 40 GB. Ensure you reserve sufficient time for it.
  • Make sure the system disk has at least 1 GB free space. Otherwise, the instance may fail to start after you change the system disk.
  1. Log on to the ECS console.

  2. Click Instances in the left navigation bar.

  3. Select your desired region.

  4. Select the instance containing the system disk with the OS to be changed.

  5. Click Instance Disks on the left navigation bar.

  6. Select the system disk with the OS to be changed, and then click Create Snapshot.

  7. Enter a name for the snapshot.

  8. Click Instance Snapshots on the left navigation bar to check the progress and status of the snapshot.

Step 2: Create an image from the snapshot

Note:

  • Skip this step if you do not want to retain the data in the system disk.
  • If you do want to retain the data in the current system disk, you need to create an image to replicate the data in the system disk.
  • Make sure the system disk has at least 1 GB free space. Otherwise, the instance may fail to start after you change the system disk.
  1. Select the snapshot created in Step 1 and click Create Custom Image.

  2. Enter a name and description for the image.

  3. Return to the navigation bar, and then click Images.

  4. You can now check the process and status of the new image.

Step 3: Change the system disk

To change a system disk:

  1. Log on to the ECS console.

  2. Click Instances in the left navigation bar.

  3. Select your desired region.

  4. Stop the instance before changing the system disk. To do this, select the instance for which you wish to replace the system disk in the instance list and click Stop.

  5. Once the instance is stopped, click More > Change System Disk.

  6. Click Custom Image and select the image created in Step 2.

  7. Click Confirm Change. Any expenditure that may have occurred will need to be paid at this time.

Step 4: Set auto snapshot policies for the new system disk

After changing the system disk, any auto snapshot policies you have set will no longer work for the new system disk, because the disk ID has changed. In this scenario, you must configure auto snapshot policies for the new system disk. For more information, see Set auto snapshot policies for disks.

Step 5: Attach data disks (for Linux instances only)

For Linux instances, you must re-attach the data disks after changing the system disk, but you do not need to partition them. For more information, see Attach a data disk.

Thank you! We've received your feedback.