Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

69144

March 13th, 2014 11:00

Match lun serial on ESX with the serial seen on Compellent UI

Hi,

I have a compellent array and I carved out a volume (lun) from it and exposed it to ESXi host.

On the ESXi host, the lun serial that I am seeing is:

6000d310005267000000000000000017

however,

on the compellent UI itself the lun serial is shown as '00005267-00000017'.

As I am writing some powershell scripts which work only with the lun serial seen on the UI, I am trying to figure out how to convert the longer serial into the shorter on.

Any help would be greatly appreciated !

118 Posts

April 9th, 2014 20:00

Response from the developer

---

OK, you're getting the hex serial on the ESXi side, you just need to match up to DeviceID rather than serial on the Compellent side.

$a = '6000d310005267000000000000000017'

# Connect to array

$SCConnect = Get-SCConnection -Hostname $array -user $user -pass $pw

# Get the lun

$vol = get-scvolume | Where {$_.DeviceID -eq $a}

That way you won't have to go through all the transformations and hassle; it should be clean.

---

118 Posts

April 3rd, 2014 08:00

I believe that the ESX host is presenting you the WWN of the LUN as seen through the MPIO driver. Have you tried installing the vCenter plugin for Compellent and see if that shows you the information you need?

What are you trying to do with the script, just find a certain volume index in the compellent as a volume mapped to the ESX server ?

5 Posts

April 3rd, 2014 14:00

I have a script to work with some powershell plugins for that are seeing the WWN on one end but need to use the shorter serial on the other end.

I was trying to figure out the function that maps a given WWN to shorter serial we see on the UI.

Is there any know formula to do it ?

5 Posts

April 4th, 2014 12:00

Thanks Micheal for your help so far.

So i have the WWN from the ESXi.

To get SCVolume object, I am using the Get-SCVolume cmdlet, and it does not like the WWN that i have from ESXi.

So the problem is i am looking to convert WWN to volume id the GetSCVolume can understand, using a well known function (if there exists one).

118 Posts

April 4th, 2014 12:00

I cheated and asked one of our developers. This is what she said:

The reference you want to use to get from a volume on the Compellent (SCVolume object) to VMware is DeviceID on the Compellent. So, if you have an SCVolume object that is held in the variable $theVolume, you use $theReference = "naa." + $theVolume.DeviceID and you'll have what you need to translate between Compellent and VMware.

118 Posts

April 4th, 2014 15:00

More running back and forth between the developer :)

---

I suspect what he's getting is the ASCII version of the WWN; he would need to convert it to the Hex version. He can convert ASCII to HEX using:

[convert]::ToString(ASCII_WWN,16)

After that (and I have not tested this piece) he should be able to get the correct Compellent volume by running:

Get-SCVolume | Where {$_.DeviceID -eq [HEX_WWN]}

The WWN needs to be just alphanumeric, no : separators.

---

She recommends you post the code around how you are getting storing and using these values because its faster to correct.

5 Posts

April 4th, 2014 15:00

You are awesome !

The serial i see on ESXi for instance is:

a = '6000d310005267000000000000000017'

Converting it to hex:

'`\x00\xd3\x10\x00Rg\x00\x00\x00\x00\x00\x00\x00\x00\x17'

The actual id that I see on Compellent is:

00005267-00000017  

The code that I am using is:

# Connect to array

$SCConnect = Get-SCConnection -Hostname $array -user $user -pass $pw

# Get the lun

$vol = get-scvolume -serialnumber  00005267-00000017  -connection $SCConnect

# the WWN serial to the serial number I see on Compellent is transformed like this:

# This is my own formual, can you verify if this is correct ?

serial = '6000d310005267000000000000000017

remove prefix 6000d31    (now serial is 0005267000000000000000017)

Add extra 0 as prefix  (now serial is 00005267000000000000000017)

Select first eight and last eight ( 00005267  00000017)

Concatenate them with a '-' in between (00005267-00000017)

This is my transformation, I am not sure if it is correct...

5 Posts

April 14th, 2014 11:00

Thank you for answer ! Appreciate it!

No Events found!

Top