Document navigation

Operations

CreateBonding

Creates a bond. For example,
CreateBonding hostUuids=89f5104f987d45fcacbdc72563be604c bondingName=test slaveUuids=a9034f876d2d445d93085fd599d9e4c9 type=LinuxBonding mode=802.3ad

Parameters

Name Description Optional Valid Value Starting Version
hostUuids The host UUID. 4.7.0
bondingName The bond name. 4.7.0
slaveUuids The slave interface UUIDs. 4.7.0
type The bond type.
  • LinuxBonding
  • OvsBonding
4.7.0
mode The bond mode.
  • 802.3ad
  • active-backup
4.7.0
xmitHashPolicy The hash policy. Yes
  • layer2
  • layer2+3
  • layer3+4
4.7.0
description The resource description. Yes 4.7.0
resourceUuid The resource UUID. Yes 4.7.0
tagUuids The tag UUID list. Yes 4.7.0
systemTags The system tags. For more information, see CreateSystemTag. Yes 4.7.0
userTags The user tags. For more information, see CreateUserTag. Yes 4.7.0

DeleteBonding

Deletes a bond. For example,
DeleteBonding uuid=1f85d0d55c7041e7b13111081af7f475

Parameters

Name Description 可选的 Valid Value Starting Version
uuid The resource UUID. 4.7.0
deleteMode The deleting mode (Permissive/Enforcing, Permissive). Yes 4.7.0
systemTags The system tags. For more information, see CreateSystemTag. Yes 4.7.0
userTags The user tags. For more information, see CreateUserTag. Yes 4.7.0

QueryHost

Queries a host. For example,
QueryHost managementIp=192.168.0.100
QueryHost vmInstance.vmNics.ip=10.21.100.2

Primitive Fields of Query

See Host Inventory.

Nested and Expanded Fields of Query

Field Inventory Description Starting Version
zone Zone Inventory The zone. 0.6
cluster Cluster Inventory The parent cluster. 0.6
vmInstance VM Instance Inventory The VM instances that run on the host. 0.6

UpdateHost

Updates a host, such as changing the host name, description, and tags. For example,
UpdateHost  name=test uuid=5e0f90f7e44e471c96cf878f30301b42

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 0.6
name The resource name. For more information, see Resource Property. Yes 0.6
description The resource description. For more information, see Resource Property. Yes 0.6
managementIp Yes 0.6
userTags The user tags. For more information, see CreateUserTag. The resource type is HostVO. Yes 0.6
systemTags The system tags. For more information, see CreateSystemTag. The resource type is HostVO. Yes 0.6
timeout Yes

ChangeHostState

Changes the state of a host. For example,
ChangeHostState stateEvent=maintain uuid=2893ce85c43d4a3a8d78f414da39966e

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 0.6
stateEvent The state event. For more information, see State.
  • enable
  • disable
  • maintain
0.6
userTags The user tags. For more information, see CreateUserTag. The resource type is HostVO. Yes 0.6
systemTags The system tags. For more information, see CreateSystemTag. The resource type is HostVO. Yes 0.6
timeout Yes

ReconnectHost

Re-establishes the command channel between a ZStack Cloud management node and a host. For example,
ReconnectHost uuid=2893ce85c43d4a3a8d78f414da39966e

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 0.6
userTags The user tags. For more information, see CreateUserTag. The resource type is HostVO. Yes 0.6
systemTags The system tags. For more information, see CreateSystemTag. The resource type is HostVO. Yes 0.6
timeout Yes

DeleteHost

Deletes a host. For example,
DeleteHost uuid=2893ce85c43d4a3a8d78f414da39966e

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 0.6
deleteMode The delete mode. For more information, see DeleteResources. Yes
  • Permissive
  • Enforcing
0.6
userTags The user tags. For more information, see CreateUserTag. The resource type is HostVO. Yes 0.6
systemTags The system tags. For more information, see CreateSystemTag. The resource type is HostVO. Yes 0.6
timeout Yes

GetHostAllocatorStrategies

Obtains the host allocator strategy. Sample response:
{
    "hostAllocatorStrategies": [
        "DefaultHostAllocatorStrategy",
        "LeastVmPreferredHostAllocatorStrategy"
    ]
}

Parameters

Name Description Optional Valid Value Starting Version
userTags The user tags. For more information, see CreateUserTag. The resource type is HostVO. Yes 0.6
systemTags The system tags. For more information, see CreateSystemTag. The resource type is HostVO. Yes 0.6
timeout Yes

GetHypervisorTypes

Obtains the hypervisor type of a VM instance. Sample response:
{
    "hypervisorTypes": [
        "KVM",
        "ESX"
    ]
}

Parameters

Name Description Optional Valid Value Starting Version
userTags The user tags. For more information, see CreateUserTag. The resource type is HostVO. Yes 0.6
systemTags The system tags. For more information, see CreateSystemTag. The resource type is HostVO. Yes 0.6
timeout Yes

GetCandidateNetworkInterfaces

Obtains the information of the host network interfaces. For example,
GetCandidateNetworkInterfaces hostUuids=89f5104f987d45fcacbdc72563be604c

Parameters

Name Description Optional Valid Value Starting Version
hostUuids The host UUIDs. 4.7.0
limit Yes 4.7.0
start Yes 4.7.0
systemTags The system tags. For more information, see CreateSystemTag. Yes 4.7.0
userTags The user tags. For more information, see CreateUserTag. Yes 4.7.0
slaveOnly Whether to obtain the information of slave network interfaces only. Yes 4.7.11

GetCandidateInterfaceVlanIds

Obtains the vlan interface information of a network interface. For example,
GetCandidateInterfaceVlanIds interfaceUuids=d25e83af6ccf3d9ca8baa1702861a0c8

Parameters

Name Description Optional Valid Value Starting Version
interfaceUuids The network interface UUIDs. 4.7.11
limit Yes 4.7.11
start Yes 4.7.11
systemTags The system tags. For more information, see CreateSystemTag. Yes 4.7.11
userTags The user tags. For more information, see CreateUserTag. Yes 4.7.11

SetIpOnHostNetworkBonding

Sets the IP address of the bond NIC port on the host. For example,
SetIpOnHostNetworkBonding bondingUuid=1f85d0d55c7041e7b13111081af7f475

Parameters

Name Description Optional Valid Value Starting Version
bondingUuid The bond interface UUID. 4.7.0
ipAddress The IP address. Yes 4.7.0
netmask The netmask. Yes 4.7.0
isDefaultRoute Whether to set a default route. Yes 4.7.0
systemTags The system tags. For more information, see CreateSystemTag. Yes 4.7.0
userTags The user tags. For more information, see CreateUserTag. Yes 4.7.0

SetIpOnHostNetworkInterface

Sets the IP address of the physical NIC port on the host. For example,
SetIpOnHostNetworkInterface interfaceUuid=dc34c1afb2e54148ab33313751bf1e04

Parameters

Name Description Optional Valid Value Starting Version
interfaceUuid The physical NIC port UUID. 4.7.0
ipAddress The IP address. Yes 4.7.0
netmask The netmask. Yes 4.7.0
isDefaultRoute Whether to set a default route. Yes 4.7.0
systemTags The system tags. For more information, see CreateSystemTag. Yes 4.7.0
userTags The user tags. For more information, see CreateUserTag. Yes 4.7.0

UpdateBonding

Updates a bond. For example,
UpdateBonding uuid=1f85d0d55c7041e7b13111081af7f475

Parameters

Name Description Optional Valid Value Starting Version
uuid The resource UUID. 4.7.0
slaveUuids The slave interface UUIDs. Yes 4.7.0
type The bond type. Yes
  • LinuxBonding
  • OvsBonding
4.7.0
mode The bond mode. Yes
  • 802.3ad
  • active-backup
4.7.0
xmitHashPolicy The hash policy. Yes
  • layer2
  • layer2+3
  • layer3+4
4.7.0
description The resource description. Yes 4.7.0
systemTags The system tags. For more information, see CreateSystemTag. Yes 4.7.0
userTags The user tags. For more information, see CreateUserTag. Yes 4.7.0

UpdateHostNetworkInterface

Updates the physical NIC port of the host. For example,
UpdateHostNetworkInterface interfaceUuid=dc34c1afb2e54148ab33313751bf1e04 description=test

Parameters

Name Description Optional Valid Value Starting Version
interfaceUuid The physical NIC port UUID. 4.7.0
description The resource description. 4.7.0
systemTags The system tags. For more information, see CreateSystemTag. Yes 4.7.0
userTags The user tags. For more information, see CreateUserTag. Yes 4.7.0

UpdateKVMHost

Updates information about a KVM host. For example,
UpdateKVMHost name=test uuid=5e0f90f7e44e471c96cf878f30301b42

Parameters

Name Description Optional Valid Value Starting Version
username The username. Yes 0.6
password The password. Yes 0.6
sshPort The SSH port No. Yes 0.6
uuid The host UUID. 0.6
name The resource name. Yes 0.6
description The detailed description of the resource. Yes 0.6
managementIp The IP address of the management node. Yes 0.6
userTags The user tags. For more information, see CreateUserTag. The resource type is HostVO. Yes 0.6
systemTags The system tags. For more information, see CreateSystemTag. The resource type is HostVO. Yes 0.6
timeout Yes

AddKVMHost

Adds a KVM host. For example,
AddKVMHost username=root clusterUuid=2379a0d00ae242df91189f6d7d9e23e3 name=test
managementIp=10.0.225.39 password=password sshPort=22

Parameters

Name Description Optional Valid Value Starting Version
username The SSH username. 0.6
password The SSH password. 0.6
sshPort The SSH port No. Yes 0.6
name The resource name. 0.6
description The detailed description of the resource. Yes 0.6
managementIp The IP address of the management node. 0.6
clusterUuid The cluster UUID. 0.6
resourceUuid The resource UUID. Yes 0.6
userTags The user tags. For more information, see CreateUserTag. The resource type is HostVO. Yes 0.6
systemTags The system tags. For more information, see CreateSystemTag. The resource type is HostVO. Yes 0.6
timeout Yes
Note:
  • When you create a KVM host in ZStack Cloud, you can disable EPT by adding the disable EPT option to SystemTags.
    • Format of the disable EPT option: pageTableExtensionDisabled
    • Example: pageTableExtensionDisabled

KvmRunShell

Runs a shell command on a KVM host. For example,
KvmRunShell hostUuids=5e0f90f7e44e471c96cf878f30301b42 script=ls

Parameters

Name Description Optional Valid Value Starting Version
hostUuids The UUID of the target host. 0.6
script The script. 0.6
userTags The user tags. For more information, see CreateUserTag. The resource type is HostVO. Yes 0.6
systemTags The system tags. For more information, see CreateSystemTag. The resource type is HostVO. Yes 0.6
timeout Yes

AddKVMHostFromConfigFile

Adds a host by importing files. For example,
AddKVMHostFromConfigFile hostInfo=5ZCN56ewKihuYW1lKSznroDku4soZGVzY3JpcHRpb24pLOmbhue+pCooY2x1c3RlclV1aWQpLOeJqeeQhuacuklQKihtYW5hZ2VtZW50SXBzKSzmiavmj4/niannkIbmnLpJT01NVeiuvue9rihJT01NVSksU1NI56uv5Y+jKihzc2hQb3J0KSznlKjmiLflkI0qKHVzZXJuYW1lKSzlr4bnoIEqKHBhc3N3b3JkKQosLGFiZDIwMmJmYmM2MTQ1NDNhMjNiNDM3NGYzNGJlYzM1LDE3Mi4yMC4xOTguMjMyLCwscm9vdCxwYXNzd29yZAosLDkyN2NkNmRmZmZiYTQzMTI4Yzk1MDY0MTFhZjAyMmQzLDE3Mi4yMC4xOTcuMjQ3LCwscm9vdCxwYXNzd29yZAo=

Parameters

Name Description Optional Valid Value Starting Version
hostInfo The host information encoded in Base64 format. 3.1.0
resourceUuid Yes 3.1.0
userTags The user tags. For more information, see CreateUserTag. Yes 3.1.0
systemTags The system tags. For more information, see CreateSystemTag. Yes 3.1.0
timeout Yes 3.1.0

CheckKVMHostConfigFile

Checks the configuration file syntax of a host. For example,
CheckKVMHostConfigFile hostInfo=5ZCN56ewKihuYW1lKSznroDku4soZGVzY3JpcHRpb24pLOmbhue+pCooY2x1c3RlclV1aWQpLOeJqeeQhuacuklQKihtYW5hZ2VtZW50SXBzKSzmiavmj4/niannkIbmnLpJT01NVeiuvue9rihJT01NVSksU1NI56uv5Y+jKihzc2hQb3J0KSznlKjmiLflkI0qKHVzZXJuYW1lKSzlr4bnoIEqKHBhc3N3b3JkKQosLGFiZDIwMmJmYmM2MTQ1NDNhMjNiNDM3NGYzNGJlYzM1LDE3Mi4yMC4xOTguMjMyLCwscm9vdCxwYXNzd29yZAosLDkyN2NkNmRmZmZiYTQzMTI4Yzk1MDY0MTFhZjAyMmQzLDE3Mi4yMC4xOTcuMjQ3LCwscm9vdCxwYXNzd29yZAo=

Parameters

Name Description Optional Valid Value Starting Version
hostInfo The host information encoded in Base64 format. 3.1.0
userTags The user tags. For more information, see CreateUserTag. Yes
systemTags The system tags. For more information, see CreateSystemTag. Yes
timeout Yes

SetServiceTypeOnHostNetworkInterface

Set the network type of a physical NIC port (non-bond-port). For example,
SetServiceTypeOnHostNetworkInterface interfaceUuids=2894f52c7d84366c85dd115b3bc193ca

Parameters

Name Description Optional Valid Value Starting Version
interfaceUuids The physical network interface UUID list. 4.7.11
vlanIds The VLAN interface ID list. Yes 4.7.11
serviceTypes The network type Yes
  • ManagementNetwork
  • TenantNetwork
  • StorageNetwork
  • BackupNetwork
  • MigrationNetwork
4.7.11
systemTags The system tags. Yes 4.7.11
userTags The user tags. Yes 4.7.11

SetServiceTypeOnHostNetworkBonding

Set the network type of a bond. For example,
SetServiceTypeOnHostNetworkBonding interfaceUuids=e96881d20cde3a9ab337cdf0ab4e8b08

Parameters

Name Description Optional Valid Value Starting Version
bondingUuids The bond network interface UUID list. 4.7.11
vlanIds The VLAN interface ID list. Yes 4.7.11
serviceTypes The network service type Yes
  • ManagementNetwork
  • TenantNetwork
  • StorageNetwork
  • BackupNetwork
  • MigrationNetwork
4.7.11
systemTags Optional. The system tags. Yes 4.7.11
userTags Optional. The user tags. Yes 4.7.11

GetInterfaceServiceTypeStatistic

Obtains the network type information of a NIC port (bond or non-bond) . For example,
GetInterfaceServiceTypeStatistic interfaceUuids=d8797841479d3951bcb698164b56bd9e

Parameters

Name Description Optional Valid Value Starting Version
interfaceUuid The NIC port UUID. Yes 4.7.11
vlanId The VLAN interface ID. Yes 4.7.11
interfaceType The NIC port type. Yes
  • All
  • Interface
  • Bonding
4.7.11
serviceType The network service type. Yes
  • All
  • ManagementNetwork
  • TenantNetwork
  • StorageNetwork
  • MigrationNetwork
  • BackupNetwork
4.7.11
zoneUuid The zone UUID. Yes 4.7.11
clusterUuid The cluster UUID. Yes 4.7.11
hostUuid The host UUID. Yes 4.7.11
sortBy The sort method. Yes
  • InterfaceName
  • VlanId
  • HostIp
  • HostName
  • ClusterName
  • CreateDate
4.7.11
sortDirection The sort direction. Yes
  • asc
  • desc
4.7.11
start The location where the statistics starts. Yes 4.7.11
limit The count of the statistics. Yes 4.7.11
replyWithCount Whether to return both the statistics result and count. Yes 4.7.11
systemTags The system tags. Yes 4.7.11
userTags The user tags. Yes 4.7.11

GetHostNetworkFacts

Obtains the network information about a host. For example,
GetHostNetworkFacts hostUuid=e336fa8ef9283fe4a4d746957284379a

Parameters

Name Description Optional Valid Value Starting Version
hostUuid The host UUID. 3.5.0
userTags The user tags. For more information, see CreateUserTag. Yes 3.5.0
systemTags The system tags. For more information, see CreateSystemTag. Yes 3.5.0
timeout Yes

QueryHostNetworkBonding

Queries the network bonding information about a host. For example,
QueryHostNetworkBonding hostUuid=b86c9016b4f24953a9edefb53ca0678c

Primitive Fields of Query

See Host Network Bonding Inventory.

Nested and Expanded Fields of Query

Field Inventory Description Starting Version
slaves slaves Inventory The slaves information about the host. 3.9.0

QueryHostNetworkInterface

Queries the interface information about a host. For example,
QueryHostNetworkInterface hostUuid=b86c9016b4f24953a9edefb53ca0678c

Primitive Fields of Query

See Host Network Interface Inventory.

Nested and Expanded Fields of Query

Field Inventory Description Starting Version
bonding bonding Inventory The bond information about the host interface. 3.9.0

GetHostNUMATopology

Obtains the pNUMA topology of a host. For example,
GetHostNUMATopology uuid=a761ac08ca483af4a81d9ed3d9930ef4

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 4.3.12
userTags The user tags. For more information, seeCreateUserTag. Yes 4.3.12
systemTags The system tags. For more information, seeCreateSystemTag. Yes 4.3.12
timeout Yes 4.3.12

QueryHostOsCategory

Queries the host OS type. For example,
QueryHostOsCategory uuid=306b48c6439548eb977bb27e9eb22b2e

Primitive Fields of Query

See HostOsCategory Inventory.

QueryKvmHypervisorInfo

Queries the resource hypervisor information. For example,
QueryKvmHypervisorInfo uuid=306b48c6439548eb977bb27e9eb22b2e

Primitive Fields of Query

See KvmHypervisorInfo Inventory.

Nested And Expanded Fields of Query

Field Inventory Description Starting Version
resource 4.6.21

AllocateHostResource

Allocates resources of a host. For example:
AllocateHostResource uuid=5d4ab16fd5b24e879eddd7e8c582b182 strategy=continuous scene=normal vcpu=2

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 4.7.11
strategy The resource allocation policy. continuous 4.7.11
scene The scene type.
  • normal
  • performance
4.7.11
vcpu The number of vCPUs that need to be allocated to a VM instance. 4.7.11
memSize The memory size of the vNUMA node. Yes 4.7.11
userTags The user tags. For more information, see CreateUserTag. Yes 4.7.11
systemTags The system tags. For more information, see CreateSystemTag. Yes 4.7.11

GetHostResourceAllocation

Obtains the vNUMA topologies of VM instance on a host. For example,
GetHostResourceAllocation uuid=a761ac08ca483af4a81d9ed3d9930ef4 strategy=continuous scene=normal vcpu=4

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 4.3.12
strategy The resource allocation policy. 4.3.12
scene The scene type. 4.3.12
vcpu The number of vCPUs that need to be allocated to a VM instance. 4.3.12
userTags The user tags. For more information, seeCreateUserTag. Yes 4.3.12
systemTags The system tags. For more information, seeCreateSystemTag. Yes 4.3.12
timeout Yes 4.3.12

GetHostPowerStatus

Obtains the latest power status of a host. For example,
GetHostPowerStatus uuid=a761ac08ca483af4a81d9ed3d9930ef4

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 4.7.0
method The method to get the host power status. Yes
  • AUTO
  • AGENT
  • IPMI
4.7.0
userTags The user tags. For more information, seeCreateUserTag. Yes 4.7.0
systemTags The system tags. For more information, seeCreateSystemTag. Yes 4.7.0
timeout Yes 4.7.0

GetHostWebSshUrl

Obtains the SSH URL of a host. For example,
GetHostWebSshUrl uuid=a761ac08ca483af4a81d9ed3d9930ef4

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 4.7.0
userTags The user tags. For more information, seeCreateUserTag. Yes 4.7.0
systemTags The system tags. For more information, seeCreateSystemTag. Yes 4.7.0
https Yes 4.7.11

PowerOnHost

Powers a host on. For example,
PowerOnHost uuid=a761ac08ca483af4a81d9ed3d9930ef4

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 4.7.0
returnEarly Whether to make the result returned early. Yes 4.7.0
userTags The user tags. For more information, seeCreateUserTag. Yes 4.7.0
systemTags The system tags. For more information, seeCreateSystemTag. Yes 4.7.0
timeout Yes 4.7.0

PowerResetHost

Reboots a host. For example,
PowerResetHost uuid=a761ac08ca483af4a81d9ed3d9930ef4

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 4.7.0
method The method to reboot the host. Yes 4.7.0
userTags The user tags. For more information, seeCreateUserTag. Yes 4.7.0
systemTags The system tags. For more information, seeCreateSystemTag. Yes 4.7.0
timeout Yes 4.7.0

ShutdownHost

Powers a host off. For example,
ShutdownHost uuid=a761ac08ca483af4a81d9ed3d9930ef4

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 4.7.0
returnEarly Whether to make the result returned earlier. Yes 4.7.0
force Whether to power off the host forcefully. Yes 4.7.0
method The method to power off the host. Yes
  • AUTO
  • AGENT
  • IPMI
4.7.0
userTags The user tags. For more information, seeCreateUserTag. Yes 4.7.0
systemTags The system tags. For more information, seeCreateSystemTag. Yes 4.7.0
timeout Yes 4.7.0

UpdateHostIpmi

Updates the IPMI info of a host. For example,
UpdateHostIpmi uuid=a761ac08ca483af4a81d9ed3d9930ef4

Parameters

Name Description Optional Valid Value Starting Version
uuid The host UUID. 4.7.0
ipmiAddress The IPMI address. Yes 4.7.0
ipmiUsername The IPMI user name. Yes 4.7.0
ipmiPassword The IPMI password. Yes 4.7.0
ipmiPort The IPMI port. Yes 4.7.0
userTags The user tags. For more information, seeCreateUserTag. Yes 4.7.0
systemTags The system tags. For more information, seeCreateSystemTag. Yes 4.7.0
timeout Yes 4.7.0
CLI Command Manual | 4.8.38 | ZStack Cloud · ZCF | ZStack Resource Center