Images can be created from the root block storage of an instance. In t2, m2, c2, r2, and x1 type instances except for u2 type instances, images can be created even when the instance is running, but data consistency is not guaranteed. In u2 type instances, images can be created only when the instance is stopped.
To create an image of a Linux instance, it is recommended to avoid duplication by initializing the machine-id. For more details on initialization of machine-id, see Guide for Initialization of Linux machine-id.
To create an image of a Windows instance, it is recommended to prepare for creating an image by using Sysprep and then stop the instance. For more details on how to use Sysprep, see Guide for Windows Sysprep.
When creating an image from a running Windows instance, prerequisites are required for correct operation if the Windows instance has been made from an image before the distribution version 2019.05.28. You can check the Windows version of the image from which an instance has been created in Image Name of Instance Details. For more details, see Guide to Creating Images from Running Windows Instances.
[Caution] The created image size may be larger than the actual usage of the root block storage.
On the Compute > Image page, select an image, and then click Modify Image to modify the image. You can modify the image for the items below.
[Caution] Modifying image information may affect related services and features, and you are responsible for the consequences.
[Note] To use NKS(GPU), you must also select NKS(CPU) for the target service.
On the Compute > Image page, click the deletion protection icon for an image to enable, or select the image and click Change Deletion Protection Settings > Use Deletion Protection > Confirm.
On the Compute > Image page, click the deletion protection icon for the desired image to disable the feature, or select the image and click Change Deletion Protection Settings > Disable Deletion Protection > Confirm
Select the region you want to copy the image to, enter a name and description for the new image, and copy the image.
On the Compute > Image page, select an image and click Copy to Another Region to duplicate the image.
Select a project to share the image with, and share the image.
On the Compute > Image page, select an image, and then click Share to Other Projects to share the image to a different project.
[Note] For API usage for this feature, see the Share Image topic in the User Guide > Compute > Image > API Guide.
When creating a Linux user image to create an instance from the image, unexpected issues may occur due to duplicate machine-ids. You can avoid duplication by initializing the machine-id before creating a user image.
$ sudo sh -c "echo -n > /etc/machine-id"
$ sudo rm /var/lib/dbus/machine-id
$ sudo ln -s /etc/machine-id /var/lib/dbus/machine-id
To create a Windows image, you must reset the image by removing hardware-dependent and user-dependent information so that it can be used for instance creation. Image reset can be run from Sysprep, a system preparation utility provided by Microsoft for deploying Windows OS.
Connect to the Windows instance and run Powershell as administrator.
When the Powershell window appears, run the following command:
ToastSysprep
[Note] ToastSysprep is a command that makes it easy to use Sysprep provided by NHN Cloud.
Press Y to run a task.
Once Sysprep is run, the Windows instance is automatically stopped. Confirm that the Windows instance is stopped in the NHN Cloud console, and create a custom Windows image with the Create Image feature.
Once the Windows instance is reset by using Sysprep, the password is changed to blank, so you cannot log in. When using the image creation feature, it is recommended to select the Reset Windows Password Created by Image option and automatically reset the password of Windows instance. You can check the reset password from instance access information.
First, connect to the Windows instance. In Apps, right-click Command Prompt and click Run as administrator.
When the Command Prompt window appears, run the following commands:
sc config cloudbase-init start= demand
cd C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf
C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdown /unattend:Unattend.xml
Once Sysprep is run, the Windows instance is automatically stopped. Confirm that the Windows instance is stopped in the NHN Cloud console, and create a custom Windows image with the Create Image feature.
Once the Windows instance is reset by using Sysprep, the password is changed to blank, so you cannot log in. When using the image creation feature, it is recommended to select the Reset Windows Password Created by Image option and automatically reset the password of Windows instance. You can check the reset password from instance access information.
\generalize
Remove unique system information registered in Windows. This step resets the Security ID (SID), clears all system restore points, and deletes the event log. After going through these steps, reboot and the ‘Windows Configuration Step’ will appear.
[Note] This step deletes SID, user information, and unique information, so the operation of existing programs may be affected.
\oobe
Reboot Windows to enter startup mode and apply the pre-defined settings, such as regional settings, network location, language settings, and time zone.
\shutdown
Shut down Windows.
\unattend
Reinstall Windows, and then restore the user settings recorded in the previous steps. This step registers Windows user information, updates drivers and products, and installs additional software. In addition to the default settings, the user can specify the desired settings in the response files.
[Note] Response files for Windows images provided by NHN Cloud are located in C:\Program Files\Cloud Solutions\Cloudbase-Init\conf\Unattend.xml. All required settings are prepared, so there is no need to modify them except for special purposes.
When creating an image with a running Windows instance, the prerequisites below are required if the image version of the original instance is earlier than 2019.05.28. If the image is a Windows image of 2019.05.28 distribution version or later, the process below is unnecessary.
Connect to the Windows instance and run Task Scheduler from the Apps.
Click Create Task from the Actions tab on the right of Task Scheduler.
In the General tab of the Create Task window, enter a name in Name. Select Run with highest privileges in Security options and then click Change User or Group.
In the input box below Enter the object name to select, enter SYSTEM and click OK.
In the Triggers tab of the Create Task window, click New to create a new trigger.
Select the trigger for Begin the task as At startup and click the OK button to complete the trigger creation.
In the Actions tab of the Create Task window, click the New button to create a new action.
In the New Action window, enter the values as follows.
Program/script: C:\Windows\System32\ipconfig.exe
Add arguments (optional): /renew