SR-IOV Related Interfaces
IsVfNicAvailableInL3Network
API Request
URLs
GET zstack/v1/l3-networks/{l3NetworkUuid}/hosts/{hostUuid}/vfnicavailableHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l3-networks/443e156ec6883356974f97f803187310/hosts/037404d26b033e9d9fe0d3e7e4bbaa8b/vfnicavailableParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| l3NetworkUuid | String | url | Distributed Port Group UUID | 3.9.0 | |
| hostUuid | String | url | Host UUID | 3.9.0 | |
| systemTags (Optional) | List | query | System tags | 3.9.0 | |
| userTags (Optional) | List | query | User tags | 3.9.0 |
API Response
Response Example
{
"vfNicAvailable": true
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| vfNicAvailable | boolean | Whether an available VF NIC exists | 3.9.0 |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. See error | 3.9.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, a globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 3.9.0 |
| description | String | Brief description of the error | 3.9.0 |
| details | String | Detailed error information | 3.9.0 |
| elaboration | String | Reserved field, defaults to null | 3.9.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 3.9.0 |
| cause | ErrorCode | Root cause, the source error that caused the current error, null if no original error | 3.9.0 |
SDK Examples
Java
SDK
IsVfNicAvailableInL3NetworkAction action = new IsVfNicAvailableInL3NetworkAction();
action.l3NetworkUuid = "443e156ec6883356974f97f803187310";
action.hostUuid = "037404d26b033e9d9fe0d3e7e4bbaa8b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
IsVfNicAvailableInL3NetworkAction.Result res = action.call();Python
SDK
IsVfNicAvailableInL3NetworkAction action = IsVfNicAvailableInL3NetworkAction()
action.l3NetworkUuid = "443e156ec6883356974f97f803187310"
action.hostUuid = "037404d26b033e9d9fe0d3e7e4bbaa8b"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
IsVfNicAvailableInL3NetworkAction.Result res = action.call()ChangeVmNicType
API Request
URLs
PUT zstack/v1/vm-instances/nics/{vmNicUuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: The systemTags and userTags fields can be omitted in the above example. They are listed to indicate that the body can contain these two fields.
{
"changeVmNicType": {
"vmNicType": "VNIC"
},
"systemTags": [],
"userTags": []
}
Note: The systemTags and userTags fields can be omitted in the above example. 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 '{"changeVmNicType":{"vmNicType":"VNIC"}}' \
http://localhost:8080/zstack/v1/vm-instances/nics/ba83aa15bafd33e792267c428465b1e5/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| vmNicUuid | String | url | Virtual Machine NIC UUID | 3.9.0 | |
| vmNicType | String | body(contained in changeVmNicType structure) | Virtual Machine NIC type |
|
3.9.0 |
| systemTags (Optional) | List | body | System tags | 3.9.0 | |
| userTags (Optional) | List | body | User tags | 3.9.0 |
API Response
Response Example
{
"inventory": {
"uuid": "bd44ea50e2573d5d9249c938dba0dad6",
"vmInstanceUuid": "1311eba1f7e53c3aa816a140fd783068",
"usedIpUuid": "464575b453d53e60941c7eeee08f3149",
"l3NetworkUuid": "b62214c53fde3f6eb825bf2ce59e3d2e",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"hypervisorType": "KVM",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0.0,
"type": "VF"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 0.6 |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. See error | 3.9.0 |
| inventory | VmNicInventory | See inventory | 3.9.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, a globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 3.9.0 |
| description | String | Brief description of the error | 3.9.0 |
| details | String | Detailed error information | 3.9.0 |
| elaboration | String | Reserved field, defaults to null | 3.9.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 3.9.0 |
| cause | ErrorCode | Root cause, the source error that caused the current error, null if no original error | 3.9.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 3.9.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.9.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 3.9.0 |
| ip | String | IP address | 3.9.0 |
| mac | String | MAC address | 3.9.0 |
| hypervisorType | String | Hypervisor type | 3.9.0 |
| netmask | String | Netmask | 3.9.0 |
| gateway | String | Gateway | 3.9.0 |
| metaData | String | The metadata. | 3.9.0 |
| ipVersion | Integer | IP address version | 3.9.0 |
| driverType | String | The driver type. | 3.17.13 |
| internalName | String | The internal name. | 3.17.13 |
| deviceId | Integer | Device ID | 3.9.0 |
| type | String | NIC type | 3.9.0 |
| state | String | NIC state | 3.17.13 |
| createDate | Timestamp | Create date | 3.9.0 |
| lastOpDate | Timestamp | Last update date | 3.9.0 |
| usedIps | List | See usedIps | 3.9.0 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 3.9.0 |
| ipRangeUuid | String | IP Range UUID | 3.9.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 3.9.0 |
| ipVersion | Integer | IP protocol number | 3.9.0 |
| ip | String | IP address | 3.9.0 |
| netmask | String | Netmask | 3.9.0 |
| gateway | String | Gateway address | 3.9.0 |
| usedFor | String | The intended use. | 3.9.0 |
| ipInLong | long | The IP address represented as a long integer. | 3.9.0 |
| vmNicUuid | String | Virtual Machine NIC UUID | 3.9.0 |
| createDate | Timestamp | Create date | 3.9.0 |
| lastOpDate | Timestamp | Last update date | 3.9.0 |
SDK Examples
Java SDK
ChangeVmNicTypeAction action = new ChangeVmNicTypeAction();
action.vmNicUuid = "ba83aa15bafd33e792267c428465b1e5";
action.vmNicType = "VNIC";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeVmNicTypeAction.Result res = action.call();Python SDK
action = ChangeVmNicTypeAction()
action.vmNicUuid = "ba83aa15bafd33e792267c428465b1e5"
action.vmNicType = "VNIC"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()QueryEthernetVF
API Request
URLs
GET zstack/v1/pci-device/ethernet-vfs
GET zstack/v1/pci-device/ethernet-vfs/{uuid}Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/pci-device/ethernet-vfscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/pci-device/ethernet-vfs/bd26758dc3713723bfcd652b8c714e1eQueryable Fields
Run the CLI command tool, enter QueryEthernetVF and press Tab to view all queryable fields and resource names that support cross-table queries.
API Response
Response Example
{
"inventories": [
{
"interfaceName": "eth0",
"vfStatus": "Available",
"hostUuid": "e21879b9f8c63800a211852d183d6650",
"parentUuid": "da87312aa5ab3ddbb05c61a3564bc5e4",
"type": "Ethernet_Controller",
"vendorId": "10de",
"deviceId": "0e0f",
"subvendorId": "10de",
"subdeviceId": "118b",
"pciDeviceAddress": "0000:06:00.1"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 4.2.0 |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. See error | 4.2.0 |
| inventories | List | See inventories | 4.2.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, a globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 4.2.0 |
| description | String | Brief description of the error | 4.2.0 |
| details | String | Detailed error information | 4.2.0 |
| elaboration | String | Reserved field, defaults to null | 4.2.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 4.2.0 |
| cause | ErrorCode | Root cause, the source error that caused the current error, null if no original error | 4.2.0 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| hostDevUuid | String | Host UUID | 4.2.0 |
| interfaceName | String | Physical NIC name | 4.2.0 |
| vmUuid | String | Virtual Machine UUID | 4.2.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 4.2.0 |
| uuid | String | UUID of the resource, uniquely identifies the resource | 4.2.0 |
| name | String | Resource name | 4.2.0 |
| description | String | Resource description | 4.2.0 |
| hostUuid | String | Host UUID | 4.2.0 |
| parentUuid | String | The parent UUID. | 4.2.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 4.2.0 |
| pciSpecUuid | String | The PCI spec UUID. | 4.2.0 |
| vendorId | String | The vendor ID. | 4.2.0 |
| deviceId | String | The device ID. | 4.2.0 |
| subvendorId | String | The subvendor ID. | 4.2.0 |
| subdeviceId | String | The subdevice ID. | 4.2.0 |
| pciDeviceAddress | String | The PCI device address. | 4.2.0 |
| iommuGroup | String | The iommu group. | 4.2.0 |
| createDate | Timestamp | Create date | 4.2.0 |
| lastOpDate | Timestamp | Last update date | 4.2.0 |
| vfStatus | EthernetVfStatus | See vfStatus | 4.2.0 |
| type | PciDeviceType | See type | 4.2.0 |
| state | PciDeviceState | See state | 4.2.0 |
| status | PciDeviceStatus | See status | 4.2.0 |
| virtStatus | PciDeviceVirtStatus | See virtStatus | 4.2.0 |
| chooser | PciDeviceChooser | See chooser | 4.2.0 |
| metaData | PciDeviceMetaData | See metaData | 4.2.0 |
| matchedPciDeviceOfferingRef | List | See matchedPciDeviceOfferingRef | 4.2.0 |
| mdevSpecRefs | List | See mdevSpecRefs | 4.2.0 |
#vfStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Available | EthernetVfStatus | Available | 4.2.0 |
| Reserved | EthernetVfStatus | Reserved | 4.2.0 |
| Attached | EthernetVfStatus | In use | 4.2.0 |
| Releasing | EthernetVfStatus | Releasing | 4.2.0 |
#type
| 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 |
#state
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Enabled | PciDeviceState | Enabled | 2.1 |
| Disabled | PciDeviceState | Disabled | 2.1 |
#status
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Active | PciDeviceStatus | Ready | 2.1 |
| Attached | PciDeviceStatus | Attached | 2.1 |
| System | PciDeviceStatus | System | 2.1 |
#virtStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| UNVIRTUALIZABLE | PciDeviceVirtStatus | Not virtualizable | 3.5.0 |
| SRIOV_VIRTUALIZABLE | PciDeviceVirtStatus | SR-IOV virtualizable | 3.5.0 |
| VFIO_MDEV_VIRTUALIZABLE | PciDeviceVirtStatus | VFIO_MDEV virtualizable | 3.5.0 |
| SRIOV_VIRTUALIZED | PciDeviceVirtStatus | SR-IOV virtualized | 3.5.0 |
| VFIO_MDEV_VIRTUALIZED | PciDeviceVirtStatus | VFIO_MDEV virtualized | 3.5.0 |
| SRIOV_VIRTUAL | PciDeviceVirtStatus | SR-IOV virtual device | 3.5.0 |
| UNKNOWN | PciDeviceVirtStatus | Unknown | 3.5.0 |
#chooser
| Name | Type | Description | Starting Version |
|---|---|---|---|
| None | PciDeviceChooser | The None value. | 4.8.0 |
| Device | PciDeviceChooser | The Device value. | 4.8.0 |
| Spec | PciDeviceChooser | The Spec value. | 4.8.0 |
#metaData
| Name | Type | Description | Starting Version |
|---|---|---|---|
| metaData | String | The metadata. | 2.1 |
| metaDataEntries | List | See metaDataEntries | 2.1 |
#metaDataEntries
| Name | Type | Description | Starting Version |
|---|---|---|---|
| key | String | Key | 2.1 |
| value | String | Value | 2.1 |
| op | PciDeviceMetaDataOperator | See op | 2.1 |
#op
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Equal | PciDeviceMetaDataOperator | Equal | 2.1 |
| Unequal | PciDeviceMetaDataOperator | Not equal | 2.1 |
#matchedPciDeviceOfferingRef
| Name | Type | Description | Starting Version |
|---|---|---|---|
| pciDeviceUuid | String | The PCI device UUID. | 2.1 |
| pciDeviceOfferingUuid | String | The PCI device offering UUID. | 2.1 |
#mdevSpecRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| pciDeviceUuid | String | PCI device UUID | 3.5.0 |
| mdevSpecUuid | String | MDEV device spec UUID | 3.5.0 |
| effective | Boolean | Whether the current MDEV spec is used to split this PCI device | 3.5.0 |
| createDate | Timestamp | Create date | 3.5.0 |
| lastOpDate | Timestamp | Last update date | 3.5.0 |
SDK Examples
Java
SDK
QueryEthernetVFAction action = new QueryEthernetVFAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryEthernetVFAction.Result res = action.call();Python
SDK
QueryEthernetVFAction action = QueryEthernetVFAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryEthernetVFAction.Result res = action.call()ChangeVfNicHaState
API Request
URLs
PUT zstack/v1/vm-instances/nics/{vfNicUuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: The
{
"changeVfNicHaState": {
"haState": "Enabled"
},
"systemTags": [],
"userTags": []
}
Note: The systemTags and userTags fields can be omitted in the above example. 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 '{"changeVfNicHaState":{"haState":"Enabled"}}' \
http://localhost:8080/zstack/v1/vm-instances/nics/8536b111015d3fd289907c5f53c80153/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| vfNicUuid | String | url | VF NIC UUID | 4.10.0 | |
| haState | String | body(contained in changeVfNicHaState structure) |
HA state |
|
4.10.0 |
| systemTags (Optional) | List | body | System tags | 4.10.0 | |
| userTags (Optional) | List | body | User tags | 4.10.0 |
API Response
Response Example
{
"inventory": {
"pciDeviceUuid": "4935759d5e543ff7bb9901262d67e805",
"haState": "Enabled",
"uuid": "5a39466d15e9303d8cd091be8f8b98a0",
"vmInstanceUuid": "0c9912e742793004bd585150a4e243d0",
"usedIpUuid": "6c1404d271ce3da4a5a845563b65ab55",
"l3NetworkUuid": "0d42b1c567da3721b04d1bc316b2e0cb",
"ip": "192.168.1.2",
"mac": "00:0c:29:bd:99:fc",
"hypervisorType": "KVM",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0,
"type": "VF",
"state": "enable"
}
}#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| pciDeviceUuid | String | NIC PCI address | 4.10.0 |
| haState | String | HA state | 4.10.0 |
| uuid | String | UUID of the resource, uniquely identifies the resource | 4.10.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 4.10.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 4.10.0 |
| ip | String | The IP address. | 4.10.0 |
| mac | String | The MAC address. | 4.10.0 |
| hypervisorType | String | The hypervisor type. | 4.10.0 |
| netmask | String | The netmask. | 4.10.0 |
| gateway | String | The gateway IP address. | 4.10.0 |
| metaData | String | The metadata. | 4.10.0 |
| ipVersion | Integer | The IP version. | 4.10.0 |
| driverType | String | The driver type. | 4.10.0 |
| internalName | String | The internal name. | 4.10.0 |
| deviceId | Integer | The device ID. | 4.10.0 |
| type | String | The resource type. | 4.10.0 |
| state | String | The resource state. | 4.10.0 |
| createDate | Timestamp | Create date | 4.10.0 |
| lastOpDate | Timestamp | Last update date | 4.10.0 |
| usedIps | List | See usedIps | 4.10.0 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 4.10.0 |
| ipRangeUuid | String | IP Range UUID | 4.10.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 4.10.0 |
| ipVersion | Integer | The IP version. | 4.10.0 |
| ip | String | The IP address. | 4.10.0 |
| netmask | String | The netmask. | 4.10.0 |
| gateway | String | The gateway IP address. | 4.10.0 |
| usedFor | String | The intended use. | 4.10.0 |
| ipInLong | long | The IP address represented as a long integer. | 4.10.0 |
| vmNicUuid | String | Virtual Machine NIC UUID | 4.10.0 |
| createDate | Timestamp | Create date | 4.10.0 |
| lastOpDate | Timestamp | Last update date | 4.10.0 |
#error
| 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 |
SDK Examples
Java SDK
ChangeVfNicHaStateAction action = new ChangeVfNicHaStateAction();
action.vfNicUuid = "8536b111015d3fd289907c5f53c80153";
action.haState = "Enabled";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeVfNicHaStateAction.Result res = action.call();Python SDK
action = ChangeVfNicHaStateAction()
action.vfNicUuid = "8536b111015d3fd289907c5f53c80153"
action.haState = "Enabled"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()