• SAP HANA

saphana
  1. Help Center
  2. SAP HANA
  3. User Guide (API)
  4. Creating a HANA ECS
  5. Creating a HANA ECS
  6. Creating an ECS Based on API Calling

Creating an ECS Based on API Calling

For detailed API information, see Native OpenStack API Reference.

API Format

Method

URI

Description

POST

/v2/{tenant_id}/servers

Creates ECSs.

NOTE:

Alias of the interface for creating servers: /v2/{tenant_id}/os-volumes_boot. This calling mode can only be used in OpenStack Client.

Restrictions

  • Among the three network parameters, portUUID, and fixed_ipport has the highest priority. When specifying the fixed_ip, you must specify the network.
  • Failure to inject a file will lead to failure in creating an ECS.
  • The following restrictions apply when you create ECSs using an image:
    • ECSs cannot be created on a specified host.
    • If a tenant backs up a disk in an ECS, the disk can be deleted after the tenant deletes all the snapshots of the disk.
    • ECSs cannot be created in batches.
    • Specifications of the flavors with different resource types cannot be adjusted if you adjust the specifications of an ECS created using an image.
  • In the public cloud system, creating an ECS using an image means creating an ECS by converting the image to the system disk. The ECS created using this method and the ECS created using the original OpenStack image differ in the following aspects:
    • You can query the image used for creating an ECS using the original OpenStack image, but you cannot query the image used for creating an ECS in the public cloud system.
    • You cannot query the disk attached to an ECS created using the original OpenStack image, but you can query the disk attached to an ECS created using an image in the public cloud system.
    • The ECS created using the original OpenStack image does not occupy disk quota, but the ECS created using an image in the public cloud system does.
  • In public cloud scenarios, an ECS at the backend of a disk must be created in the same cascaded OpenStack system where the disk is located.
  • An ECS can only be configured with one NIC when you set the networks parameter for creating an ECS.
  • The agency name is agency_name. When ECSs access the public cloud platform, they obtain a temporary access credential from the agency. Before using the agency, log in to the public cloud management console as the tenant administrator and create the DataproviderAccess agency.
NOTE:

The process is as follows: Log in to the public cloud management console and choose Mgmt & Deployment > Identity and Access Management. On the left side of the page, choose Agency. Then, click Create Agency on the right side of the page.

The parameters are as follows:

AgencyTypeCloud service

Validity Period: Retain the default setting.

Rights: Select the region in which the target ECS locates and configure the Tenant Guest permission for the ECS.

Expansion

None

Request Parameters

Parameter

Type

Mandatory or Not

Description

server

Dict

Yes

Indicates the ECS information.

os:scheduler_hints

List (Dict)

No

Indicates the ECS scheduling information.

[1] server parameters

Parameter

Type

Mandatory or Not

Description

imageRef

String

No

ECSs are started using disks. Therefore, this field is left blank.

flavorRef

String

Yes

Specifies an ECS flavor ID. For details, see section 2.2.

name

String

Yes

Specifies the ECS name with a length greater than 0 bytes and less than 255 bytes.

metadata

Dict

No

Specifies the ECS metadata. Set this parameter as required. Set agency_name(String) to agency_name: DataProviderAccess.

personality

List (Dict)

No

Specifies information about the file to be injected.

adminPass

String

No

This parameter is not supported by the public cloud.

block_device_mapping_v2

List (Dict)

No

Specifies the V2 interface for the ECS storage devices. This is an extended attribute. This interface is the storage resource interface of the new version. In the scenarios with specified disks, ECSs cannot be created in batches.

security_groups

List (Dict)

No

Specifies the security group to which an ECS belongs. This is an extended attribute. The default parameter value is default. This parameter is valid when you create an ECS on a specified network.

networks

List (Dict)

No

An ECS can only be configured with one NIC when you create an ECS on the public cloud.

key_name

String

No

Specifies the name of the key pair. This is an extended attribute.

user_data

String

No

Specifies a string encoded in Base64 with a length less than 32 KB after encrypted. This is an extended attribute.

availability_zone

String

No

Specifies the availability zone (AZ) and host to which an ECS belongs. This is an extended attribute. This parameter is required when you create an ECS on the public cloud.

When you create a HANA ECS, the values of the following parameters encoded in Base64 are required for user_data.

#cloud-config
disable_root: false
runcmd:
    - sed -i 's/^PermitRootLogin.*$/PermitRootLogin without-password/' /etc/ssh/sshd_config
    - sed -i '/^KexAlgorithms.*$/d' /etc/ssh/sshd_config
    - service sshd restart 

[2] personality parameters

Parameter

Type

Mandatory or Not

Description

contents

String

Yes

Specifies the content of the file to be injected. The file is encrypted using Base64.

path

String

Yes

Specifies the directory containing the file to be injected.

[3] block_device_mapping_v2 parameters

Parameter

Type

Mandatory or Not

Description

source_type

String

Yes

Specifies the source type of the disk. The value can only be volume or image. In the current scenario, an ECS is created using volume.

destination_type

String

Yes

Specifies the current type of the disk device. The value can only be volume.

device_name

String

No

Specifies the disk device name. It contains 1 to 254 characters. This parameter must comply with the regular expression /dev/x{0,1}[a-z]{0,1}d{0,1})([a-z]+)[0-9]*, such as /dev/vda.

delete_on_termination

Bool

No

Specifies whether disks are deleted when an ECS is deleted. The default value is false.

boot_index

String

Yes

Specifies whether disks are started. 0 specifies a boot disk, and -1 specifies a non-boot disk.

uuid

String

Yes

Specifies the UUID of the disk. This parameter will be the UUID of an image if the source_type is image.

volume_size

String

No

Specifies the disk size with an integer. This parameter is mandatory if the source is image and the dest is volume.

[4] security_groups parameter

Parameter

Type

Mandatory or Not

Description

name

String

Yes

Specifies the security group name or the UUID.

[5] networks parameter

Parameter

Type

Mandatory or Not

Description

port

UUID

No

Specifies the UUID of the network port. The value is the primary NIC port.

[6] os:scheduler_hints parameter

Parameter

Type

Mandatory or Not

Description

group

UUID

No

Specifies the anti-affinity group information.

Response Parameters

Parameter

Type

Mandatory or Not

Description

adminPass

String

Yes

Specifies the ECS password.

This parameter is not supported by the public cloud.

id

UUID

Yes

Specifies the UUID of an ECS.

links

List (Dict)

Yes

Provides URI description of an ECS.

security_groups

List (Dict)

Yes

Specifies the security group to which an ECS belongs.

OS-DCF:diskConfig

Bool

Yes

Specifies the disk configuration mode.

  • MANUAL: The image space cannot be expanded.
  • AUTO: The system disk image space automatically expands to the same size as that required by the specifications.

Request Example

POST /v2/9c53a566cb3443ab910cf0daebca90c4/servers
{
    "server": {
       "flavorRef": "e1.xlarge",
       "name": "hanaserver001",
       "block_device_mapping_v2": [{
          "source_type": "volume" ,
          "device_name": "/dev/sda",
          "destination_type": "volume",
            "uuid": "5655851c-c34e-4c40-bdcd-c399a9655a79",
            "delete_on_termination": "True", 
            "boot_index": "0"
     }],
"networks": [{
            "port": "e54a2a49-ba89-435f-8898-3f3cf6d131d5"
}],
        "key_name": "fankeypair01",
        "metadata":{"agency_name": "DataProviderAccess"}
        "user_data": "I2Nsb3VkLWNvbmZpZwpkaXNhYmxlX3Jvb3Q6IGZhbHNlCnJ1bmNtZDoKLSBzZWQgLWkgJ3MvXlBlcm1pdFJvb3RMb2dpbi4qJC9QZXJtaXRSb290TG9naW4gd2l0aG91dC1wYXNzd29yZC8nIC9ldGMvc3NoL3NzaGRfY29uZmlnCi0gc2VkIC1pICcvXktleEFsZ29yaXRobXMuKiQvZCcgL2V0Yy9zc2gvc3NoZF9jb25maWcKLSBzZXJ2aWNlIHNzaGQgcmVzdGFydA==",
      "availability_zone": "aaa"//aaa is used as an example of the AZ.
         }
"os:scheduler_hints":{
"group": "03ef85f1-b84e-4018-a3b5-f8a9257fa9b5"
}
}

Response Example

{
  "server": {
     "security_groups": [
       {
         "name": "name_xx5_sg"
       }
    ],
    "OS-DCF:diskConfig": " MANUAL",
    "id": "567c1557-0eca-422c-bfce-149d6b8f1bb8",
    "links": [
       {
         "href": "http://192.168.82.230:8774/v2/dc4059e8e7994f2498b514ca04cdaf44/servers/567c1557-0eca-422c-bfce-149d6b8f1bb8",
"rel": "self"
       },
       {
          "href": "http://192.168.82.230:8774/dc4059e8e7994f2498b514ca04cdaf44/servers/567c1557-0eca-422c-bfce-149d6b8f1bb8",
"rel": "bookmark"
       }
     ],
   }
}

Considerations:

You need to select corresponding flavor from e series used by the memory-optimized ECSs.

Category

vCPUs

Memory (RAM in GB)

Flavor

memory-optimized

4

128

e1.xlarge

8

256

e1.2xlarge

16

512

e1.4xlarge

32

1024

e1.8xlarge

memory-optimized

8

128

e2.2xlarge

12

256

e2.3xlarge

24

512

e2.6xlarge

48

1024

e2.12xlarge

Memory-optimized ECSs require memory-optimized EVS disks. If additional EVS disks are required, follow the procedures in Creating an EVS Disk as a Data Disk and Attaching Data Disks Including Shared Disks.

If multiple EVS disks are required, you must repeatedly call the API by following the content described in this section.

For details about how to attach shared disks as data disks, see Creating an EVS Disk as a Data Disk and Attaching Data Disks Including Shared Disks.

For details about how to deploy high-availability clusters (anti-affinity group), see section Creating an Anti-affinity ECS Group.