-1

In a setup of a multiple iscsi disks attached to a Linux host (LVM pools setup), I want to be able to take a snapshot of a specific disk, using Softlayer API. How can I know the id or the LUN name of the iscsi device from the Linux device name.

For example - get "SLXXXXXXXXX-XX" from "/dev/mapper/YYYYYYYYYYYYYYp1".

I tried resolving the Iscsi target Ip, but it's possible that different disks have same target ip, so I have to figure out a different solution

mcruz
  • 1,534
  • 2
  • 11
  • 14
csny
  • 164
  • 1
  • 2
  • 14

1 Answers1

1

Using these REST requests you can retrieve the ISCSI id, and LUN id of the device and its parent for those BMS and Virtual Guests that have any.

https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests.json?objectMask=mask[allowedNetworkStorage[lunId,parentVolume[lunId]]]&objectFilter={"virtualGuests":{"allowedNetworkStorage":{"nasType":{"operation":"ISCSI"}}}}

Method: GET

https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Account/getHardware.json?objectMask=mask[allowedNetworkStorage[lunId,parentVolume[lunId]]]&objectFilter={"hardware":{"allowedNetworkStorage":{"nasType":{"operation":"ISCSI"}}}}

Method: GET

This link might help you for further implementation: http://sldn.softlayer.com/reference/datatypes/SoftLayer_Network_Storage_Iscsi http://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage_Iscsi

  • The "lunId" info solves my problem as it is a unique identifier for a scsi volume, that is visible by the OS. Thanks! – csny Sep 21 '16 at 08:59