The Latest Gartner® Magic Quadrant™Hyperconverged Infrastructure Software
Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)
The Starwind presents its devices to iSCSI clients by this Id.Boris (staff) wrote:What's your use case that might require this information?
It look like what I seek, thanks.Boris (staff) wrote:To the best of my knowledge, this is not available in StarWindX, but you can get a workaround for this. You can parse the swdsk file as XML and get the value from header.device.storages.storage.inquiry.serial_id
Let me know whether that fits your needs.
It's more comfortable to use target names of course but not in this case. All I see in ESXI for the moment of new datastore mount is Starwind Device Id.Boris (staff) wrote:While going with the serial ID the suggested way should be fine, I'd rather prefer working with the target names, for which StarWindX is able to output information. But this can be merely a matter of preference though.
Code: Select all
$DeviceToCreateFilePath="My Computer\C\StarWind"
$DeviceToCreateFileName="ImageFile01"
[XML]$ImageFileConfig = (Get-Content -Path "$(($DeviceToCreateFilePath.Substring(("My Computer\").Length)).insert(1,":"))\$($DeviceToCreateFileName).swdsk") -replace "`0",""
$DiskSerialNumber=$ImageFileConfig.header.device.storages.storage.inquiry.serial_id
Code: Select all
-replace "`0",""