Register image

URL

/v1/imageimport

Method

POST

Request header

Refer to "Request headers" for details on the request headers of this API.

Table 1. Request headers
Request header Value Description
X-Auth-Token String Tokens that were retrieved using the Identity service.

Request body

Refer to "Request parameters" for details on the request parameters of this API. Each parameter is specified in JSON format in the request body.

Table 2. Request parameters
Parameter Value Description
name String Specifies the image name. (*1)
location String Part of the URL of object storage where VM image files from the transfer source are deployed. Specify using the following format:

"/v1/AUTH_tenantId/containerName/objectName"

The format of object names needs to include the image file extension (.vmdk).

An error occurs if the format is incorrect (in a format other than the above, or an object name does not end with .vmdk) or a non-existent object is specified.

checksum (optional) String Specifies the SHA1 checksum value of the VM image file from the transfer source.

By specifying this parameter, it is possible to use the SHA1 checksum value to verify that the VM image file that has been uploaded to object storage has not been corrupted.

id (optional) String When this parameter is omitted the image ID will be automatically assigned by the IaaS service platform.

To use an image ID uniquely obtained by the user, it is possible to specify uuid for this parameter.

It is necessary to use "uuidgen" or another command to create the uuid to specify for the image ID.

min_ram (optional) int Specifies the minimum RAM (MB) required for using images. If omitted, 0 will be used. (*1)
min_disk (optional) int Specifies the minimum disk size (GB) required for using images. If omitted, 0 will be used. (*1)
os_type String OS type in VM image at transfer source. Specify one of the following.
keyword
Description
win2008R2SE:
Windows Server 2008 R2 SE
win2008R2EE:
Windows Server 2008 R2 EE
win2012SE:
Windows Server 2012 SE
win2012R2SE:
Windows Server 2012 R2 SE
win2016SE_ja:
Windows Server 2016 SE (Japanese version)
win2016SE_en:
Windows Server 2016 SE (English version)
rhel6:
Red Hat Enterprise Linux 6
rhel7:
Red Hat Enterprise Linux 7
centos:
CentOS
ubuntu:
Ubuntu
Note: Ensure that the OS type that is specified for import is the actual OS type that will be imported. If it is not the actual OS type, the following problems may occur:
  • Virtual servers may not start normally.
  • You may not be able to receive correct support for IaaS or the OS.
  • The charged OS support fees may be incorrect.
kms (optional) hash Specifies to set the KMS license authentication. If omitted, the setting is not performed.

When an os_type other than Windows is specified, the value of kms is ignored.

When describing, conform to the format of "kms": "{"server_info": "FQDN: Port number", "activate": true}".

When specifying neither server_info nor activate, this item cannot be specified.

server_info (optional) String Specifies the FQDN of a KMS license server with a port number in the following format.

"FQDN: Port number"

If omitted, an FQDN of each region described in user manuals with the port number (1688) will be set.

activate boolean Specifies to activate the KMS license authentication. Specify "true".

(When specifying boolean data, do not enclose it with """.)

true: Enables activation.

*1: Parameter to be registered for services.

*2: Images in vmdk format are converted into a format that can be processed by IaaS (raw format).

Specification of conversion, user_name, password, domain_name are no longer necessary.

Response body

Refer to "List of response parameters when the state is normal" and "List of response parameters when the state is error" for details on the response parameters of this API. Each parameter is output in JSON format in the response body. Refer to "Detailed error information list" for details on error information returned when an error occurs.

Table 3. List of response parameters when the state is normal
Parameter Value Description
import_id String ID of the import process. Used when retrieving the conversion status.

Table 4. List of response parameters when the state is error
Parameter Value Description
error_code String Detailed error code.
message String Detailed error message.

Table 5. Detailed error information list
Status code Detailed error code Detailed error message Action
400 40001 Required parameter 'name' is not specified. Modify the request content.
400 40002 Required parameter 'location' is not specified. Modify the request content.
400 40005 Required parameter 'os_type' is not specified. Modify the request content.
400 40006 Parameter 'os_type' has invalid value. Modify the request content.
400 40011 Project_id does not exist. No project can be retrieved from the authentication token. Review the authentication token.
400 40014 Request body is not a json format. Modify the request content.
400 40025 Parameter 'location' has invalid value. Modify the request content.
400 40026 Parameter 'conversion' has invalid value. Modify the request content.
400 40027 Parameter 'id' has invalid value. Modify the request content.
400 40028 Parameter 'name' has invalid value. Modify the request content.
400 40031 Parameter 'checksum' has invalid value. Modify the request content.
400 40032 Parameter 'min_ram' has invalid value. Modify the request content.
400 40033 Parameter 'min_disk' has invalid value. Modify the request content.
400 40034 Parameter 'kms' has invalid value. Modify the request content.
400 40037 The size of the import image is too large. Create the import target image again in a smaller size.
403 40301 You cannot execute this API. Check with the Administrator about your account privileges.
500 50001 Internal server error. Contact support.
500 50002 Internal server error. Contact support.
500 50003 Internal server error. Contact support.
503 50301 Too many requests. Check the number of executions of import requests. When the count is 100 or less per contract, re-execute after completing other import requests. Otherwise, contact support.

Status code

Refer to "Status codes" for details on the status codes returned by this API.

Table 6. Status codes
Status code Description
201 Indicates that the virtual server import process started normally.
400 Indicates an invalid request.
401 Indicates an invalid token.
403 Indicates that the virtual server import execution privileges do not exist.
500 Indicates that the virtual server import process failed due to an error.
503 Indicates that the virtual server import process failed due to the upper limit for concurrent executions of requests being exceeded.

Example response body

An example response body is shown below.


{"import_id":"6bf65660-70ee-4a75-b61a-36ac040c289c"}