Hitachi Content Platform​

 View Only

 Field length with VSP Model

  • Flash Storage
  • Hitachi Virtual Storage Platform VSP
  • Object Storage
  • Hitachi Content Platform HCP
Michael Taormina's profile image
Michael Taormina posted 01-30-2018 14:44

I'm working on some custom python scripting against the REST API and I've noticed that when getting information from GET base-URL/v1/objects/storages/storage-device-ID/ldevs a field is being limited to 16 characters. Specifically, when using query parameter ?ldevOption=luMapped the value is truncated for host group names longer than 16 characters. This is a VSP model that I'm working with. I don't see any notes in the documentation about this limitation, is this expected behavior?


#HitachiContentPlatformHCP
#HitachiVirtualStoragePlatformVSP
Craig Chan's profile image
Craig Chan

It's supposed to be 64 characters.  Can you post a request for adding a host group and the response from getting the host group name from the LDEV query?

Michael Taormina's profile image
Michael Taormina

Create a host group with a name longer than 16 characters:

>>> body = '{"portId": "CL1-A", "hostGroupName": "a_long_host_group_name"}'

>>> url = vsp.baseUrl + vsp.objectUrl + '/host-groups'

>>>

>>> r = vsp.apiSession.post(url=url, data=body, verify=vsp.certPath, headers=vsp.headers)

>>> r.content

b'{\n  "jobId" : 2,\n  "self" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/jobs/2",\n  "userId" : "maintenance",\n  "status" : "Initializing",\n  "state" : "Queued",\n  "createdTime" : "2018-02-01T13:45:42Z",\n  "updatedTime" : "2018-02-01T13:45:42Z",\n  "request" : {\n    "requestUrl" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/host-groups",\n    "requestMethod" : "POST",\n    "requestBody" : "{\\"portId\\": \\"CL1-A\\", \\"hostGroupName\\": \\"a_long_host_group_name\\"}"\n  }\n}'

>>>

>>> url = vsp.baseUrl + vsp.objectUrl + '/jobs/2'

>>>

>>> r = vsp.apiSession.get(url=url, verify=vsp.certPath, headers=vsp.headers)

>>> r.content

b'{\n  "jobId" : 2,\n  "self" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/jobs/2",\n  "userId" : "maintenance",\n  "status" : "Completed",\n  "state" : "Succeeded",\n  "createdTime" : "2018-02-01T13:45:42Z",\n  "updatedTime" : "2018-02-01T13:45:43Z",\n  "completedTime" : "2018-02-01T13:45:43Z",\n  "request" : {\n    "requestUrl" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/host-groups",\n    "requestMethod" : "POST",\n    "requestBody" : "{\\"portId\\": \\"CL1-A\\", \\"hostGroupName\\": \\"a_long_host_group_name\\"}"\n  },\n  "affectedResources" : [ "/ConfigurationManager/v1/objects/storages/7000000XXXXX/host-groups/CL1-A,2" ]\n}'

 

Querying by host group shows the full name:

>>>

>>> url = vsp.baseUrl + vsp.objectUrl + '/host-groups/CL1-A,2'

>>>

>>> r = vsp.apiSession.get(url=url, verify=vsp.certPath, headers=vsp.headers)

>>> r.content

b'{\n  "hostGroupId" : "CL1-A,2",\n  "portId" : "CL1-A",\n  "hostGroupNumber" : 2,\n  "hostGroupName" : "a_long_host_group_name",\n  "hostMode" : "LINUX/IRIX"\n}'

 

Create and provision a volume to the host group:

>>>

>>> url = vsp.baseUrl + vsp.objectUrl + '/ldevs'

>>> body = '{"ldevId": 53248, "poolId": 0, "byteFormatCapacity": "3G"}'

>>>

>>> r = vsp.apiSession.post(url=url, data=body, verify=vsp.certPath, headers=vsp.headers)

>>> r.content

b'{\n  "jobId" : 3,\n  "self" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/jobs/3",\n  "userId" : "maintenance",\n  "status" : "Initializing",\n  "state" : "Queued",\n  "createdTime" : "2018-02-01T13:54:52Z",\n  "updatedTime" : "2018-02-01T13:54:52Z",\n  "request" : {\n    "requestUrl" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/ldevs",\n    "requestMethod" : "POST",\n    "requestBody" : "{\\"ldevId\\": 53248, \\"poolId\\": 0, \\"byteFormatCapacity\\": \\"3G\\"}"\n  }\n}'

>>>

>>> url = vsp.baseUrl + vsp.objectUrl + '/jobs/3'

>>>

>>> r = vsp.apiSession.get(url=url, verify=vsp.certPath, headers=vsp.headers)

>>> r.content

b'{\n  "jobId" : 3,\n  "self" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/jobs/3",\n  "userId" : "maintenance",\n  "status" : "Completed",\n  "state" : "Succeeded",\n  "createdTime" : "2018-02-01T13:54:52Z",\n  "updatedTime" : "2018-02-01T13:55:04Z",\n  "completedTime" : "2018-02-01T13:55:04Z",\n  "request" : {\n    "requestUrl" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/ldevs",\n    "requestMethod" : "POST",\n    "requestBody" : "{\\"ldevId\\": 53248, \\"poolId\\": 0, \\"byteFormatCapacity\\": \\"3G\\"}"\n  },\n  "affectedResources" : [ "/ConfigurationManager/v1/objects/storages/7000000XXXXX/ldevs/53248" ]\n}'

>>>

>>> body = '{"portId": "CL1-A", "hostGroupNumber": 2, "ldevId": 53248}'

>>> url = vsp.baseUrl + vsp.objectUrl + '/luns'

>>>

>>> r = vsp.apiSession.post(url=url, data=body, verify=vsp.certPath, headers=vsp.headers)

>>> r.content

b'{\n  "jobId" : 4,\n  "self" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/jobs/4",\n  "userId" : "maintenance",\n  "status" : "Initializing",\n  "state" : "Queued",\n  "createdTime" : "2018-02-01T13:58:14Z",\n  "updatedTime" : "2018-02-01T13:58:14Z",\n  "request" : {\n    "requestUrl" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/luns",\n    "requestMethod" : "POST",\n    "requestBody" : "{\\"portId\\": \\"CL1-A\\", \\"hostGroupNumber\\": 2, \\"ldevId\\": 53248}"\n  }\n}'

>>>

>>> url = vsp.baseUrl + vsp.objectUrl + '/jobs/4'

>>> r = vsp.apiSession.get(url=url, verify=vsp.certPath, headers=vsp.headers)

>>> r.content

b'{\n  "jobId" : 4,\n  "self" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/jobs/4",\n  "userId" : "maintenance",\n  "status" : "Completed",\n  "state" : "Succeeded",\n  "createdTime" : "2018-02-01T13:58:14Z",\n  "updatedTime" : "2018-02-01T13:58:15Z",\n  "completedTime" : "2018-02-01T13:58:15Z",\n  "request" : {\n    "requestUrl" : "/ConfigurationManager/v1/objects/storages/7000000XXXXX/luns",\n    "requestMethod" : "POST",\n    "requestBody" : "{\\"portId\\": \\"CL1-A\\", \\"hostGroupNumber\\": 2, \\"ldevId\\": 53248}"\n  },\n  "affectedResources" : [ "/ConfigurationManager/v1/objects/storages/7000000XXXXX/luns/CL1-A,2,0" ]\n}'

 

 

Get mapping details of the volume, showing the host group name truncated:

>>>

>>> url = vsp.baseUrl + vsp.objectUrl + '/ldevs/53248'

>>> r = vsp.apiSession.get(url=url, verify=vsp.certPath, headers=vsp.headers)

>>> r.content

b'{\n  "ldevId" : 53248,\n  "clprId" : 0,\n  "emulationType" : "OPEN-V-CVS",\n  "byteFormatCapacity" : "3.00 G",\n  "blockCapacity" : 6291456,\n  "numOfPorts" : 1,\n  "ports" : [ {\n    "portId" : "CL1-A",\n    "hostGroupNumber" : 2,\n    "hostGroupName" : "a_long_host_grou",\n    "lun" : 0\n  } ],\n  "attributes" : [ "CVS", "HDT" ],\n  "status" : "NML",\n  "mpBladeId" : 1,\n  "ssid" : "00D4",\n  "poolId" : 0,\n  "numOfUsedBlock" : 0,\n  "isRelocationEnabled" : true,\n  "tierLevel" : "all",\n  "usedCapacityPerTierLevel1" : 0,\n  "usedCapacityPerTierLevel2" : 0,\n  "tierLevelForNewPageAllocation" : "H",\n  "resourceGroupId" : 0,\n  "dataReductionStatus" : "DISABLED",\n  "dataReductionMode" : "disabled",\n  "isAluaEnabled" : false\n}'

Craig Chan's profile image
Craig Chan

Thanks Michael,

I was having a discussion with our Engineering team about this one because it's tricky and I want to get it right.

The Host Group name is stored in the CM REST API DB with the full 64 characters.  The API call you are making has to truncate the Host Group name because retrieving the full name can take longer than expected and we didn't want customers thinking the API call got lost.  Since the DB still contains the full Host Group name, you can still retrieve the full Host Group name by querying the DB.  Use this command:

GET base-URL/v1/views/lun-paths

To get list of defined ldev for specific storage system, add the following query for the above request line.

?$query=ldev.isDefined eq true and ldev.storageDeviceId eq '7000000XXXXX'

Replace base-URL with your <ip-address>:<port>/ConfigurationManager and 7000000XXXXX with your storage device ID.  That should give you all the LDEV details as well as the full Host Group name.

Michael Taormina's profile image
Michael Taormina

OK. It seems unfortunate that engineering would rather increase performance than provide accurate information. However, I'm willing to work with the other URL if I can figure it out.

I seem to be able to get the data from lun-paths.

I've attempted to combine query conditions, but cannot get that to work (error 400):

GET base-URL/v1/views/lun-paths?$query=ldev.storageDeviceId eq '7000000XXXXX'&$query=hostGroup.hostGroupName eq 'name_of_host'

Ultimately, what I'm trying to do here is get a sum of the mapped volume capacity on each port/host group. If there is a better way to do this than to get lun paths for every device, please let me know.

Any help you can provide would be great.

Craig Chan's profile image
Craig Chan

We've checked the query and it looks correct.  The only issue may be escaping your query.  Some OS's automatically escape the "$" since it's a reserved string.  Also, some OS's require you to escape spaces ("%20").  If escaping these characters doesn't solve your problem, please PM me and we can work out a way to collect logs from you to see what the trouble is.