Create Block Device

Create Block Device

Following disk custom properties can be passed while creating a block device:

1. dataStore: Defines name of the datastore in which the disk has to be provisioned. 

2. storagePolicy: Defines name of the storage policy in which the disk has to be provisioned. If name of the datastore is specified in the custom properties then, datastore takes precedence.

3. provisioningType: Defines the type of provisioning. For eg. thick/thin. 
Request
URI
POST
https://{api_host}/iaas/api/block-devices
COPY
Query Parameters
string
apiVersion
Optional

The version of the API in yyyy-MM-dd format (UTC). For versioning information please refer to /iaas/api/about


Request Body

Disk Specification instance

BlockDeviceSpecification of type(s) application/json
Required
{
    "name": "string",
    "projectId": "e058",
    "description": "string",
    "capacityInGB": 78,
    "encrypted": true,
    "sourceReference": "ami-0d4cfd66",
    "diskContentBase64": "dGVzdA",
    "constraints": [
        {
            "mandatory": false,
            "expression": "ha:strong"
        }
    ],
    "tags": [
        {
            "key": "string",
            "value": "string"
        }
    ]
}
string
name
Required

A human-friendly name used as an identifier in APIs that support this option.

string
projectId
Required

The id of the project the current user belongs to.

string
description
Optional

A human-friendly description.

integer As int32 As int32
capacityInGB
Required

Capacity of the block device in GB.

boolean
encrypted
Optional

Indicates whether the block device should be encrypted or not.

string
sourceReference
Optional

Reference to URI using which the block device has to be created.

string
diskContentBase64
Optional

Content of a disk, base64 encoded.

object
customProperties
Optional

Additional custom properties that may be used toextend the block device.

array of Constraint
constraints
Optional

Constraints that are used to drive placement policies for the block device that is produced from this specification. Constraint expressions are matched against tags on existing placement targets.

array of Tag
tags
Optional

A set of tag keys and optional values that should be set on any resource that is produced from this specification.

Responses
202

successful operation

Returns RequestTracker of type(s) application/json
{
    "progress": 90,
    "message": "In Progress",
    "status": "FINISHED",
    "resources": [
        "string"
    ],
    "name": "Power-off",
    "id": "we655aew4e8e",
    "selfLink": "/.../request-tracker/we655aew4e8e"
}
integer As int32 As int32
progress
Required

Progress of the request as percentage.

string
message
Optional

Status message of the request.

string
status
Required

Status of the request.

Possible values are : FINISHED, INPROGRESS, FAILED,
array of string
resources
Optional

Collection of resources.

string
name
Optional

Name of the operation.

string
id
Required

ID of this request.

string
selfLink
Required

Self link of this request.


400

Invalid Request - bad data

Operation doesn't return any data structure

403

Forbidden

Operation doesn't return any data structure