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 indicate 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.2.0
hostUuid (optional)Stringbody (included in the detachScsiLunFromHost structure)Host UUID 4.2.0
systemTags (optional)ListbodySystem Tags 4.2.0
userTags (optional)ListbodyUser Tags 4.2.0

API Response

Response Example

{
  "inventory": {
    "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.0,
    "scsiLunHostRefs": [],
    "scsiLunVmInstanceRefs": [],
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error4.2.0
inventoriesListFor details, see inventory4.2.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.10014.2.0
descriptionStringBrief description of the error4.2.0
detailsStringDetailed error information4.2.0
elaborationStringReserved field, defaults to null4.2.0
opaqueLinkedHashMapReserved field, defaults to null4.2.0
causeErrorCodeRoot cause: the error that triggered the current error. If there is no original error, this field is null4.2.0

inventory

NameTypeDescriptionStarting Version
nameStringResource Name4.2.0
uuidStringResource UUID, uniquely identifies the resource4.2.0
wwidStringDisk Globally Unique Identifier4.2.0
vendorStringDisk Vendor4.2.0
modelStringDisk Model4.2.0
wwnStringDisk WWN4.2.0
serialStringDisk Serial Number4.2.0
typeStringDisk Type4.2.0
pathStringDisk Path4.2.0
stateStringDisk Enabled State4.2.0
sizeLongDisk Size4.2.0
createDateTimestampCreation Time4.2.0
lastOpDateTimestampLast Modification Time4.2.0
scsiLunHostRefsListFor details, see scsiLunHostRefs4.2.0
scsiLunVmInstanceRefsListFor details, see scsiLunVmInstanceRefs4.2.0

scsiLunHostRefs

NameTypeDescriptionStarting Version
scsiLunUuidStringSCSI Lun UUID4.2.0
hostUuidStringHost UUID4.2.0
createDateTimestampCreation Time4.2.0
lastOpDateTimestampLast Modification Time4.2.0

scsiLunVmInstanceRefs

NameTypeDescriptionStarting Version
scsiLunUuidStringSCSI Lun UUID4.2.0
vmInstanceUuidStringVirtual Machine UUID4.2.0
createDateTimestampCreation Time4.2.0
lastOpDateTimestampLast Modification Time4.2.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()