#Create storage unit in ASA r2 using REST API

1 messages · Page 1 of 1 (latest)

full yew
#

Hello folks,
I need help to specify parameters to create storage-unit (iSCSI LUNs) in ASA r2 using REST API. I tried with below JSON POST request body-

{
    "os_type": "vmware",
    "space": {
        "guarantee": {
            "requested": false
        },
        "scsi_thin_provisioning_support_enabled": true,
        "size": 1073741824
    },
    "name": "Tenant1-SU1",
    "svm": {
        "name": "Tenant1-SVM"
    }
} ```
#

But getting Error: Bad Request with below response message-

{
  "error": {
    "message": "\"Tenant1-SU1\" is an invalid name because it does not match the format <name>[@<snapshot-name>]. The name must begin with a letter or \"_\" and contain only \"_\" and alphanumeric characters. The optional snapshot-name must not begin or end with whitespace.",
    "code": "5376461",
    "target": "name"
  }
}```
#

Can somebody please provide correct set of parameters here?

#

okay, I got it, looks like hyphen is not supported with lun names here, removed it and now the execution went fine

full yew
#

When I am trying to create the same LUN using curl command as below,-

curl -X POST "https://172.22.71.100/api/storage/luns?return_timeout=0&return_records=false" -H  "accept: application/json" -H  "authorization: Basic YWRtaW46TmV0QXBwITIz" -H  "Content-Type: application/json" -d "{"os_type": "vmware",    "space": {        "guarantee": {            "requested": false        },        "scsi_thin_provisioning_support_enabled": true,        "size": 1073741824    },    "name": "Tenant1_SU1","svm": {        "name": "Tenant1-SVM"    }}" 
#

I am getting error message invalid JSON input-

{
  "error": {
    "message": "Invalid JSON input. Unexpected character in stream: o around 0:1.",
    "code": "262199"
  }
}
#

Can someone please help me debug the issue in JSON request params?

wheat ibex
#

you need to escape those " characters in your string

#

either use -d "{\"os_type\":...}" or use -d '{"os_type":...}'

full yew
#

yes, using single quotes after -d worked