Document navigation

SR-IOV Operations

IsVfNicAvailableInL3Network

API Request

URLs

GET zstack/v1/l3-networks/{l3NetworkUuid}/hosts/{hostUuid}/vfnicavailable

Headers

Authorization: OAuth the-session-uuid

Curl Sample

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/vfnicavailable

Request Parameters

Name Type Location Description Optional Value Starting Version
l3NetworkUuid String url The L3 network UUID. 3.9.0
hostUuid String url The host UUID. 3.9.0
systemTags List query Optional. The system tags. 3.9.0
userTags List query Optional. The user tags. 3.9.0

API Response

Sample Response

{
  "vfNicAvailable": true
}
Name Type Description Starting Version
vfNicAvailable boolean Whether a virtual function (VF) NIC is available. 3.9.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.9.0

#error

Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.9.0
description String The brief description of the error. 3.9.0
details String The details about the error. 3.9.0
elaboration String The reserved field. Default value: null. 3.9.0
opaque LinkedHashMap The reserved field. Default value: null. 3.9.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.9.0

SDK Sample

Java SDK

IsVfNicAvailableInL3NetworkAction action = new IsVfNicAvailableInL3NetworkAction();
action.l3NetworkUuid = "443e156ec6883356974f97f803187310";
action.hostUuid = "037404d26b033e9d9fe0d3e7e4bbaa8b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
IsVfNicAvailableInL3NetworkAction.Result res = action.call();

Python SDK

action = IsVfNicAvailableInL3NetworkAction()
action.l3NetworkUuid = "443e156ec6883356974f97f803187310"
action.hostUuid = "037404d26b033e9d9fe0d3e7e4bbaa8b"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

ChangeVmNicType

API Request

URLs

PUT zstack/v1/vm-instances/nics/{vmNicUuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeVmNicType": {
    "vmNicType": "VNIC"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.

Curl Sample

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/actions

Request Parameters

Name Type Location Description Optional Value Starting Version
vmNicUuid String url The VM NIC UUID. 3.9.0
vmNicType String body (contained in the changeVmNicType structure) The VM NIC type.
  • VNIC
3.9.0
systemTags List body Optional. The system tags. 3.9.0
userTags List body Optional. The user tags. 3.9.0

API Response

Sample Response

{
  "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
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.9.0
inventory VmNicInventory See inventory. 3.9.0

#error

Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.9.0
description String The brief description of the error. 3.9.0
details String The details about the error. 3.9.0
elaboration String The reserved field. Default value: null. 3.9.0
opaque LinkedHashMap The reserved field. Default value: null. 3.9.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.9.0

#inventory

Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
vmInstanceUuid String The VM instance UUID. 3.9.0
l3NetworkUuid String The L3 network UUID. 3.9.0
ip String The IP address. 3.9.0
mac String The MAC address. 3.9.0
hypervisorType String The hypervisor type. 3.9.0
netmask String The netmask. 3.9.0
gateway String The gateway. 3.9.0
metaData String The metadata. 3.9.0
ipVersion Integer The IP version. 3.9.0
deviceId Integer The device ID. 3.9.0
type String The NIC type. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
usedIps List See usedIps. 3.9.0

#usedIps

Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
ipRangeUuid String The IP range UUID. 3.9.0
l3NetworkUuid String The L3 network UUID. 3.9.0
ipVersion Integer The IP version. 3.9.0
ip String The IP address. 3.9.0
netmask String The netmask. 3.9.0
gateway String The gateway. 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 The VM NIC UUID. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0

SDK Sample

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()

ChangeVfNicHaState

API Request

URLs

PUT zstack/v1/vm-instances/nics/{vfNicUuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeVfNicHaState": {
    "haState": "Enabled"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.

Curl Sample

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/actions

Request Parameters

Name Type Location Description Optional Value Starting Version
vfNicUuid String url VfNic UUID 5.1.0
haState String body (contained in the changeVfNicHaState structure) Ha state. 5.1.0
systemTags List body Optional. The system tags. 5.1.0
userTags List body Optional. The user tags. 5.1.0

API Response

Sample Response

{
  "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"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 5.1.0
inventory VmVfNicInventory See inventory 5.1.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error 5.1.0

#inventory

Name Type Description Starting Version
pciDeviceUuid String The pci device UUID. 5.1.0
haState String The hastate. 5.1.0
uuid String The resource UUID. 5.1.0
vmInstanceUuid String The VM instance UUID. 5.1.0
l3NetworkUuid String The L3 network UUID. 5.1.0
ip String The IP address. 5.1.0
mac String The MAC address. 5.1.0
hypervisorType String The hypervisor type. 5.1.0
netmask String The netmask. 5.1.0
gateway String The gateway IP address. 5.1.0
metaData String The metadata. 5.1.0
ipVersion Integer The IP version. 5.1.0
driverType String The driver type. 5.1.0
internalName String The internal name. 5.1.0
deviceId Integer The device ID. 5.1.0
type String The resource type. 5.1.0
state String The resource state. 5.1.0
createDate Timestamp The creation date. 5.1.0
lastOpDate Timestamp The last operation date. 5.1.0
usedIps List See usedIps 5.1.0

#usedIps

Name Type Description Starting Version
uuid String The resource UUID. 5.1.0
ipRangeUuid String The ip range UUID. 5.1.0
l3NetworkUuid String The L3 network UUID. 5.1.0
ipVersion Integer The IP version. 5.1.0
ip String The IP address. 5.1.0
netmask String The netmask. 5.1.0
gateway String The gateway IP address. 5.1.0
usedFor String The intended use. 5.1.0
ipInLong long The IP address represented as a long integer. 5.1.0
vmNicUuid String The VM Nic UUID. 5.1.0
createDate Timestamp The creation date. 5.1.0
lastOpDate Timestamp The last operation date. 5.1.0

#error

Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.1.0
description String The brief description of the error. 5.1.0
details String The details about the error. 5.1.0
elaboration String The reserved field. Default value: null. 5.1.0
opaque LinkedHashMap The reserved field. Default value: null. 5.1.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.1.0

SDK Sample

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()

GetVfPciDeviceAvailableInL2Network

API Request

URLs

GET zstack/v1/l2-networks/vf-pci-devices-available

Headers

Authorization: OAuth the-session-uuid

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l2-networks/vf-pci-devices-available?l2NetworkUuids=7615ff44c9f03400b32b9138e1d332fc

Request Parameters

Name Type Location Description Optional Value StartingVersion
l2NetworkUuids List query The L2 network UUID. 5.3.20
systemTags List query Optional. The system tags. 5.3.20
userTags List query Optional. The user tags. 5.3.20

API Response

Sample Response

{
  "l2VfAvailableClusters": {
    "76a2d0892dbb3047adc9f27227a47a24": [
      {
        "clusterHostAvailableVfs": {
          "cc8a747f6148357182ccbc922baf3611": {
            "ef8963015cb337e6b6e9ded639e74985": 10
          }
        }
      }
    ]
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 5.3.20
l2VfAvailableClusters Map The L2 vf available clusters. 5.3.20
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 5.3.20

#error

Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.3.20
description String The brief description of the error. 5.3.20
details String The details about the error. 5.3.20
elaboration String The reserved field. Default value: null. 5.3.20
opaque LinkedHashMap The reserved field. Default value: null. 5.3.20
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.3.20

SDK Sample

Java SDK

GetVfPciDeviceAvailableInL2NetworkAction action = new GetVfPciDeviceAvailableInL2NetworkAction();
action.l2NetworkUuids = asList("7615ff44c9f03400b32b9138e1d332fc");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVfPciDeviceAvailableInL2NetworkAction.Result res = action.call();

Python SDK

action = GetVfPciDeviceAvailableInL2NetworkAction()
action.l2NetworkUuids = [7615ff44c9f03400b32b9138e1d332fc]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()