Detach LUN Device from Host

PUT/zstack/v1/storage-devices/scsi-lun/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "detachScsiLunFromHost": {
    "hostUuid": "dce542427a3a3d1fa13324c9f67352cb"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. They are listed to show that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"detachScsiLunFromHost":{"hostUuid":"dce542427a3a3d1fa13324c9f67352cb"}}' \
http://localhost:8080/zstack/v1/storage-devices/scsi-lun/fb5d3f596f683bd7a3b1bf1c396d5f4d/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlSCSI LUN UUID 4.1.6
hostUuid (Optional)Stringbody (contained in the detachScsiLunFromHost structure)Host UUID 4.1.6
systemTags (Optional)ListbodySystem Tags 4.1.6
userTags (Optional)ListbodyUser Tags 4.1.6

API Response

Response Example

{
  "inventory": {
    "scsiLunHostRefs": [],
    "scsiLunVmInstanceRefs": [],
    "name": "test-scsi-lun",
    "uuid": "e09fbca6d27332a1946326f3ae114fc3",
    "wwid": "36b083fe000daf018000022905ba35d8f",
    "vendor": "DELL",
    "model": "MD32xx",
    "wwn": "0x6f01faf000d5c3e7",
    "serial": "6b083fe000daf018000015505abbe00a",
    "type": "mpath",
    "path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
    "size": 5497558138880,
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See error for details4.1.6
inventoryScsiLunInventorySee inventory for details4.1.6

error

NameTypeDescriptionStarting Version
codeStringError code number. Globally unique identifier of the error, for example SYS.1000, HOST.1001.0.6
descriptionStringBrief error description0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause error. The error that caused the current error. If there is no original error, this field is null.0.6

inventory

NameTypeDescriptionStarting Version
nameStringResource name3.1.0
uuidStringUUID of the resource. Uniquely identifies the resource.3.1.0
wwidStringDisk globally unique identifier3.1.0
vendorStringDisk vendor3.1.0
modelStringDisk model3.1.0
wwnStringDisk WWN3.1.0
serialStringDisk serial number3.1.0
typeStringDisk type3.1.0
pathStringDisk path3.1.0
stateStringDisk status3.1.0
sizeLongDisk size3.1.0
createDateTimestampCreate time3.1.0
lastOpDateTimestampLast update time3.1.0
scsiLunHostRefsListSee scsiLunHostRefs for details3.1.0
scsiLunVmInstanceRefsListSee scsiLunVmInstanceRefs for details3.1.0

scsiLunHostRefs

NameTypeDescriptionStarting Version
scsiLunUuidStringSCSI Lun UUID3.1.0
hostUuidStringHost UUID3.1.0
createDateTimestampCreate time3.1.0
lastOpDateTimestampLast update time3.1.0

scsiLunVmInstanceRefs

NameTypeDescriptionStarting Version
scsiLunUuidStringSCSI Lun UUID3.1.0
vmInstanceUuidStringVirtual Machine UUID3.1.0
createDateTimestampCreate time3.1.0
lastOpDateTimestampLast update time3.1.0

SDK Examples

Java SDK

DetachScsiLunFromHostAction action = new DetachScsiLunFromHostAction();
action.uuid = "fb5d3f596f683bd7a3b1bf1c396d5f4d";
action.hostUuid = "dce542427a3a3d1fa13324c9f67352cb";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachScsiLunFromHostAction.Result res = action.call();

Python SDK

DetachScsiLunFromHostAction action = DetachScsiLunFromHostAction()
action.uuid = "fb5d3f596f683bd7a3b1bf1c396d5f4d"
action.hostUuid = "dce542427a3a3d1fa13324c9f67352cb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachScsiLunFromHostAction.Result res = action.call()