Skip to main content

Create volume using iSCSI

Contributors netapp-ranuk

You can use this workflow to create a volume accessed through the iSCSI protocol.

There are two workflows available depending on whether a new or existing iGroup is used. You need to select the correct workflow:

Create volume using iSCSI with a new iGroup

Note If the properties aggregateName and maxNumOfDisksApprovedToAdd are not provided on the REST API call, the response will fail with a suggested name for the aggregate and the number of disks needed to fulfill the request.

Step 1. Select the working environment

Perform the workflow Get working environments and choose the publicId value for the workingEnvironmentId parameter and the svmName value for the svmName parameter.

Step 2. Select the aggregate

Perform the workflow Get aggregates and choose the name for the aggregateName value.

Step 3. Choose the size for the disk

Choose the size value for the size:size parameter. The size:unit must be one of the following: TB, GB, MB, KB, or Byte.

Step 4. Choose the iscsiInfo parameters

You must choose the following values for the REST API call:

  • A unique iGroup name for igroupCreationRequestigroupName parameter

  • The required IQN's to igroupCreationRequestinitiators parameter.

  • The required operating system for the osName parameter from one of the following:

    • windows

    • linux

    • vmware

    • windows_2008

    • windows_gpt

Step 5. Create the volume

You can issue a REST API call to create a volume.

HTTP method and endpoint

This REST API call uses the following method and endpoint.

HTTP method Path

POST

/occm/api/onprem/volumes

Curl example
curl --request POST \
--location  "https://cloudmanager.cloud.netapp.com/occm/api/onprem/volumes" \
--header "Content-Type: application/json" \
--header "x-agent-id: <AGENT_ID>" \
--header "Authorization: Bearer <ACCESS_TOKEN>" \
--d @JSONinput
Additional input parameters

The JSON input example includes the minimum list of parameters.

Parameter Type Required Description

<SVM_NAME> (svmName)

Query

Yes

Identifies the SVM name

workingEnvironmentId <WORKING_ENV_ID>

Query

Yes

Identifies the working environment ID

<AGGR_NAME> (aggregateName)

Query

Yes

Identifies the aggregate

If aggregate name does not exist, you can set the createAggregateIfNotFound query parameter to true which allows the aggregate not-found condition.

JSON input example
{
    "workingEnvironmentId": "OnPremWorkingEnvironment-xxxx",
    "aggregateName": "aggr2",
    "name": "vol3",
    "size": {
        "size": "100",
        "unit": "GB"
    },
    "snapshotPolicyName": "default",
    "svmName": "svm_onpremwe",
    "enableCompression": true,
    "enableDeduplication": true,
    "enableThinProvisioning": true,
    "verifyNameUniqueness": true,
    "volumeTags": [],
    "iscsiInfo": {
    "igroupCreationRequest": {
        "igroupName": "onpremGroup",
        "initiators": [
            "iqn.1994-05.com.redhat:96dexxxx216",
            "iqn.1994-05.com.redhat:96dexxxxx6"
              ]
      },
     "osName": "linux"
    }
}
Output

None

Create volume using iSCSI with an existing iGroup

Note If the properties aggregateName and maxNumOfDisksApprovedToAdd are not provided on the REST API call, the response will fail with a suggested name for the aggregate and the number of disks needed to fulfill the request.

Step 1. Select the working environment

Perform the workflow Get working environments and choose the publicId value for the workingEnvironmentId parameter and the svmName value for the svmName parameter.

Step 2. Select the aggregate

Perform the workflow Get aggregates and choose the name for the aggregateName parameter.

Step 3. Choose the size for the disk

Choose the size value for the size:size parameter. The size:unit must be one of the following: TB, GB, MB, KB, or Byte.

Step 4. Create the volume

You can issue a REST API call to create a volume.

HTTP method and endpoint

This REST API call uses the following method and endpoint.

HTTP method Path

POST

/occm/api/onprem/volumes

Curl example
curl --request POST \
--location "https://cloudmanager.cloud.netapp.com//occm/api/onprem/volumes" \
--header "Content-Type: application/json" \
--header "x-agent-id: <AGENT_ID>" \
--header "Authorization: Bearer <ACCESS_TOKEN>" \
--d @JSONinput
Additional input parameters

The JSON input example includes the minimum list of parameters.

Parameter Type Required Description

<SVM_NAME> (svmName)

Query

Yes

Identifies the SVM name

workingEnvironmentId <WORKING_ENV_ID>

Query

Yes

Identifies the working environment ID

<AGGR_NAME> (aggregateName)

Query

Yes

Identifies the aggregate

If an aggregate name does not exist, you can set the createAggregateIfNotFound query parameter to true which allows the aggregate not-found condition.

JSON input example
{
  "workingEnvironmentId": "VsaWorkingEnvironment-xxxxx",
  "svmName": "svm_zivaws01we01",
  "aggregateName": "aggr1",
  "name": "zivawxxxxxx05Iscsi",
  "size": {
    "size": 100,
    "unit": "GB"
  },
  "iscsiInfo": {
    "igroups": ["zivIgroup1"],
    "osName": "linux"
  },
  "snapshotPolicyName": "default",
  "enableThinProvisioning": true,
  "enableCompression": true,
  "enableDeduplication": true,
  "maxNumOfDisksApprovedToAdd": 0
}
Output

None