Software Development Kit (SDK) and API Discussions

Page 83 SCSI ID - API

nkarthik
8,715 Views

Hi,

 

I would like to know the API, which will collect the “Page 83 scsi unique ID for a LUN” from storage controller.

 

The API should return the value at any condition like Lun is mapped/unmapped to the server, LUN unprovisioned to server.

 

Your suggestion and recommendations are most welcome.

 

Thanks & Regards,

Karthikeyan.N

11 REPLIES 11

kvishal
8,681 Views

did you have a look at lun-list-info ?

Does this structure returned by the API have the info you require ?

Element definition: lun-info [top]

<!----------   -- Type Summary   ---------->

Information of a LUN.
NameRangeTypeDescription
backing-snapshot
string
optional
Path to the backing snapshot file  for a LUN, if there is one.  Only returned if it has one. Note: This  element is not returned for LUNs which are in snapshots.
block-size0..2^31-1integer
Disk block size of the LUN in  bytes.
clone-backing-snapshot
string
optional

device-id0..2^31-1integer
optional
SCSI Device Identifier for the  LUN.
is-space-reservation-enabled
boolean
Whether or not the LUN has space  reservation enabled.
mapped
boolean
Whether or not the LUN is mapped  to any initiators. "true" if mapped, "false" otherwise.
multiprotocol-type
string
Multiprotocol type of the LUN  Possible values: aix, image, hpux, linux, netware, solaris, windows,  vld, vmware, windows_gpt, windows_2008, openvms, xen, hyper_v,  solaris_EFI.
online
boolean
State of the LUN, ("online" or  "offline"). "true" if online, "false" otherwise.
path
string
Path of the LUN.
read-only
boolean
"true" if the LUN is read only,  "false" if read/write.
serial-number
string
Serial number of the LUN. The  serial number is a 12-character string formed of upper and lower-case  letters, numbers, and slash (/) and hyphen (-) characters.
share-state
string
Share state of the LUN, ("all",  "none", read", or "write"). In the very rare case that the share state  can not be determined, "unknown" is returned.
size0..2^64-1integer
Size of this LUN in bytes in the  active FS.
size-used0..2^64-1integer
Number of bytes used by this LUN.
staging
boolean
"true" if the LUN is a temporary  staging LUN, "false" otherwise.
uuid
string
Universal unique identifier (UUID)  for the LUN.


rle
NetApp Alumni
8,680 Views

I looked up what page 83 contains.  If you are looking for a SCSI unique ID, I don’t know what that maps to with regards to API IDs.  The API lun-list-info returns serial-number and uuid.  Could one of these elements be what you’re looking for?  Since it sounds like you’re want disk information, I would look at disk-list-info.  There is disk-uuid.

Is there a way to obtain this information via the ONTAP CLI?  If so, what is the CLI command?  Usually if the ONTAP CLI command is known, you can find he appropriate API.

Regards,

   - Rick -

nkarthik
8,680 Views

I don't know the CLI command to check the page 83 id of the LUN. is there any other way to find the page 83 ID. either through API or some other algorithem

karthik

rle
NetApp Alumni
8,681 Views

Karthik -

What are you looking for on page 83?

   - Rick -

nkarthik
8,681 Views

Actually we are working with other vendor, the vendor wants to collect the page 83 ID of the LUNs provided by the NetApp storage in python list.

Is there a way to find the page 83 ID from the LUN.

rgds

karthik

malcolmpenn
8,681 Views

Use the nSANity tool - this collects the pg80 sn & pg83 sn per LUN

rle
NetApp Alumni
8,680 Views

Try the scsi advanced command:

scsi modeselect -p page { -o offset -v value }... device_name


The scsi modeselect command sets the mode select pages of a device to new values. Mode select pages define the configurations of a device, and some of these values may be changed. For example, setting the compression values on a tape drive requires setting the 0x0f mode page. Setting new sector sizes before a drive is reformated requires setting another mode page.

The -p option sets the mode page to retrieve.

The -o option determines the byte offset in the mode parameters to change.

The -v option indicates the new value for a given byte offset denoted by the -o option.

Several -o and -v values can be set and changed at the same time. For example, to change byte number 0x08 and byte number 0x1f in mode page 0xe on device SWITCH:8.3 to 0xff and 0x38 respectively, the command line would be `scsi modeselect -p 0xe -o 0x08 -v 0xff -o 0x1f -v 0x38 SWITCH:8.3'.

The device_name field is the target device name and is specified using the electrial name format. Examples include `8.3' and `SWITCH:4.3'.

MURUGES_MU
8,680 Views

Rick,

The equivalent ONTAP CLI command is 'lun serial -x <lun_path>'. please let me know the equivalent API for this command.

Thanks,

Muruges

sunday
8,680 Views

Take the serial number from lun-list-info (7-mode) or lun-get-iter (Cluster-Mode) and base-16 encode the result.

rle
NetApp Alumni
6,243 Views

MURUGES_MU
6,243 Views

Thanks. it helps.

Public