GET/zstack/v1/pci-device/candidate-pci-devices-for-new-create-vm Get loadable PCI devices for a newly created Virtual Machine.
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/pci-device/candidate-pci-devices-for-new-create-vm?hostUuid=3376aee6af913e278a1a6aafc28c2e94
Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|
| hostUuid (Optional) | String | query | Host UUID | | 2.4 |
| clusterUuids (Optional) | List | query | | | 2.4 |
| types (Optional) | List | query | | | 2.4 |
| systemTags (Optional) | List | query | | | 2.4 |
| userTags (Optional) | List | query | | | 2.4 |
Response Example
{
"inventories": [
{
"uuid": "1d2d54391e4d303cbf12543508b208ba",
"hostUuid": "d98a93185af134fda630723444fd49d4",
"type": "GPU_Video_Controller",
"status": "Attached",
"vendorId": "10de",
"deviceId": "0e0f",
"subvendorId": "10de",
"subdeviceId": "118b",
"pciDeviceAddress": "0000:06:00.1"
}
]
}
| Name | Type | Description | Starting Version |
|---|
| success | boolean | | 0.6 |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. See error | 0.6 |
| inventories | List | See inventories | 0.6 |
| Name | Type | Description | Starting Version |
|---|
| code | String | Error code, a globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause, the source error that caused the current error, null if no original error | 0.6 |
| Name | Type | Description | Starting Version |
|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 2.1 |
| name | String | Resource name | 3.5.0 |
| description | String | Resource description | 2.1 |
| hostUuid | String | Host UUID | 2.1 |
| parentUuid | String | Physical PCI device UUID | 3.5.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 2.1 |
| pciSpecUuid | String | PCI device offering UUID | 3.5.0 |
| vendorId | String | Vendor ID | 2.1 |
| deviceId | String | Device ID | 2.1 |
| subvendorId | String | Sub-vendor ID | 2.1 |
| subdeviceId | String | Sub-device ID | 2.1 |
| pciDeviceAddress | String | PCI device address | 2.1 |
| createDate | Timestamp | Create date | 2.1 |
| lastOpDate | Timestamp | Last update date | 2.1 |
| type | PciDeviceType | See type | 2.1 |
| state | PciDeviceState | See state | 2.1 |
| status | PciDeviceStatus | See status | 2.1 |
| virtStatus | PciDeviceVirtStatus | See virtStatus | 3.5.0 |
| chooser | PciDeviceChooser | See chooser | 4.1.0 |
| metaData | PciDeviceMetaData | See metaData | 2.1 |
| matchedPciDeviceOfferingRef | List | See matchedPciDeviceOfferingRef | 2.1 |
| mdevSpecRefs | List | See mdevSpecRefs | 3.5.0 |
| Name | Type | Description | Starting Version |
|---|
| GPU_Video_Controller | PciDeviceType | GPU video controller | 2.1 |
| GPU_Audio_Controller | PciDeviceType | GPU audio controller | 2.1 |
| GPU_3D_Controller | PciDeviceType | GPU 3D controller | 2.1 |
| Moxa_Device | PciDeviceType | MOXA card | 2.1 |
| Generic | PciDeviceType | Generic device | 2.1 |
| Name | Type | Description | Starting Version |
|---|
| Enabled | PciDeviceState | Enabled | 2.1 |
| Disabled | PciDeviceState | Disabled | 2.1 |
| Name | Type | Description | Starting Version |
|---|
| Active | PciDeviceStatus | Ready | 2.1 |
| Attached | PciDeviceStatus | Attached | 2.1 |
| System | PciDeviceStatus | System | 2.1 |
| Name | Type | Description | Starting Version |
|---|
| UNVIRTUALIZABLE | PciDeviceVirtStatus | Unvirtualizable | 3.5.0 |
| SRIOV_VIRTUALIZABLE | PciDeviceVirtStatus | SRIOV virtualizable | 3.5.0 |
| VFIO_MDEV_VIRTUALIZABLE | PciDeviceVirtStatus | VFIO_MDEV virtualizable | 3.5.0 |
| SRIOV_VIRTUALIZED | PciDeviceVirtStatus | SRIOV virtualized | 3.5.0 |
| VFIO_MDEV_VIRTUALIZED | PciDeviceVirtStatus | VFIO_MDEV virtualized | 3.5.0 |
| SRIOV_VIRTUAL | PciDeviceVirtStatus | SRIOV virtual device | 3.5.0 |
| UNKNOWN | PciDeviceVirtStatus | Unknown | 3.5.0 |
| Name | Type | Description | Starting Version |
|---|
| None | PciDeviceChooser | | 4.8.0 |
| Device | PciDeviceChooser | | 4.8.0 |
| Spec | PciDeviceChooser | | 4.8.0 |
| Name | Type | Description | Starting Version |
|---|
| metaData | String | | 2.1 |
| metaDataEntries | List | See metaDataEntries | 2.1 |
| Name | Type | Description | Starting Version |
|---|
| key | String | Key | 2.1 |
| value | String | Value | 2.1 |
| op | PciDeviceMetaDataOperator | See op | 2.1 |
| Name | Type | Description | Starting Version |
|---|
| Equal | PciDeviceMetaDataOperator | Equal | 2.1 |
| Unequal | PciDeviceMetaDataOperator | Unequal | 2.1 |
| Name | Type | Description | Starting Version |
|---|
| pciDeviceUuid | String | | 2.1 |
| pciDeviceOfferingUuid | String | | 2.1 |
| Name | Type | Description | Starting Version |
|---|
| pciDeviceUuid | String | PCI device UUID | 3.5.0 |
| mdevSpecUuid | String | MDEV device offering UUID | 3.5.0 |
| effective | Boolean | Whether the current MDEV specification is used to partition this PCI device | 3.5.0 |
| createDate | Timestamp | Create date | 3.5.0 |
| lastOpDate | Timestamp | Last update date | 3.5.0 |
Java SDK
GetPciDeviceCandidatesForNewCreateVmAction action = new GetPciDeviceCandidatesForNewCreateVmAction();
action.hostUuid = "3376aee6af913e278a1a6aafc28c2e94";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetPciDeviceCandidatesForNewCreateVmAction.Result res = action.call();
Python SDK
GetPciDeviceCandidatesForNewCreateVmAction action = GetPciDeviceCandidatesForNewCreateVmAction()
action.hostUuid = "3376aee6af913e278a1a6aafc28c2e94"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetPciDeviceCandidatesForNewCreateVmAction.Result res = action.call()