执行“新建虚拟机”操作时,在浏览器控制台里看到是调用了"POST /cas/domain/add" 这个接口完成新增操作,但是在H3C_CAS-E0785版本API文档里,查询到的“新增虚拟机接口“是“POST /cas/casrs/vm/add”,两者的请求参数结构也不一致。
{
"isEncrypt": false,
"hostId": "1",
"title": "Linux_WEB02",
"description": "",
"autoMigrate": 0,
"system": 1,
"vmView": {},
"cpuSocket": 2,
"cpuCore": 1,
"memory": 1024,
"cpu": 2,
"memoryUnit": "GB",
"autoMem": 0,
"autoTools": false,
"isStart": 0,
"hugepage": false,
"rdt": null,
"networks": [
{
"vlan": null,
"hotPluggable": true,
"driverSwitch": true,
"queues": 1,
"queueSize": 1024,
"mtu": 1500,
"mtuMin": 1000,
"ipAddr": "",
"ipv6IpAddr": "",
"driver": "vhost",
"tcpCheckSum": true,
"deviceModel": "virtio",
"driverType": "",
"vlanTrunkName": "",
"vlanTrunkId": "",
"profileId": 1,
"profileName": "Default",
"name": "why_switch",
"vswitchId": 2,
"mode": "veb"
}
],
"osVersion": "CentOS 6/7(64-bit)",
"osBit": "x86_64",
"cpuMode": "custom",
"secretLevel": 1,
"cpuMinRate": 10,
"cpuMaxRate": 3800,
"vmPriority": 1,
"blkiotune": "300",
"maxMemory": 7.5,
"minMemory": 0,
"limitMin": 1,
"diskList": [
{
"targetBus": "virtio",
"type": "file",
"capacity": 10240,
"diskUnit": "GB",
"diskDevice": "disk",
"driveType": "qcow2",
"cache": "none",
"realCapacity": 80,
"selectDiskType": 0,
"mode": 2,
"clustersize": "262144",
"diskMode": "subordinate",
"diskIOMode": "native",
"hotPluggable": true,
"priority": 3,
"diskFile": 0,
"capacifyChange": false,
"choosedImageEncrypted": false,
"rbdExisted": false
}
],
"gpuList": [],
"usbList": [],
"netusbList": [],
"pciList": [],
"pciIndex": 0,
"usbIndex": 0,
"netusbIndex": 0,
"cpuShares": "512",
"cpuGurantee": 0,
"enableIncreaseCPU": true,
"cpuQuotaUnit": "MHz",
"domainCpuGlobalQuota": false,
"memoryLocked": 0,
"memoryPriority": "0",
"isClusterInSafeArea": false,
"hostPoolId": 1,
"clusterId": null,
"maxCpuSocket": 4,
"memoryInit": 1,
"drive": "cirrus",
"viewType": "vnc",
"storages": [
{
"targetBus": "virtio",
"type": "file",
"capacity": 10240,
"diskUnit": "GB",
"diskDevice": "disk",
"driveType": "qcow2",
"cache": "none",
"realCapacity": 80,
"selectDiskType": 0,
"mode": 2,
"clustersize": "262144",
"diskMode": "subordinate",
"diskIOMode": "native",
"hotPluggable": true,
"priority": 3,
"diskFile": 0,
"capacifyChange": false,
"choosedImageEncrypted": false,
"rbdExisted": false
},
{
"diskDevice": "floppy",
"driveType": "autoVirtio"
},
{
"diskDevice": "cdrom",
"driveType": "imgFileName",
"storeFile": ""
}
],
"devList": [],
"watchdogAction": null,
"vtpmVersion": null,
"cpuModel": null
}
{
"name": "vmTest",
"title": "虚机显示名称",
"description": "这是一台测试虚拟机",
"autoLoadVirtio": true,
"hostId": 1,
"clusterId": 1,
"osBit": "x86_64",
"enableHA": 1,
"cpuFeature": false,
"bootFirmware": 0,
"hostPoolId": 1,
"priority": 0,
"autoMigrate": 0,
"memory": 4096,
"memoryInit": 4,
"memoryUnit": "GB",
"memoryBacking": 0,
"memoryLimit": 1024,
"memoryLimitUnit": "MB",
"memoryPriority": 0,
"autoMem": 0,
"hugepage": false,
"cpu": 1,
"cpuSockets": 1,
"cpuCores": 1,
"cpuMax": 1,
"formatEnable": 1,
"maxCpuSocket": 2,
"cpuMode": "custom",
"cpuShares": 512,
"blkiotune": 300,
"imgFileName": "string",
"imgFileType": "string",
"system": 0,
"osVersion": "Microsoft Windows Server 2019(64-bit)",
"vmType": 1,
"viewType": "vnc",
"auto": 0,
"bootingDevice": 1,
"autoBooting": 0,
"autoTools": 0,
"cpuQuota": 1600,
"cpuQuotaUnit": "MHz",
"cpuGurantee": 0,
"enableReduceCPU": false,
"domainCpuGlobalQuota": false,
"videoType": "Qxl",
"vram": 64,
"vgamem": 11,
"gpuDev": {
"resPoolId": 0,
"resPool": "string",
"businessTemId": 0,
"deviceDriver": "vfio",
"businessTem": "string",
"count": 0,
"shared": 0,
"bus": "string",
"producers": "string",
"type": "string",
"name": "string",
"maxInstance": 0,
"framebuffer": "string",
"maxResolution": "string",
"uuid": "string",
"heads": 0
},
"bindcpuList": [
{
"vcpu": 1,
"pcpu": [
1
]
}
],
"network": [
{
"vsId": 1,
"vsName": "vswitch0",
"mtu": 1500,
"profileId": 1,
"mac": "0c:da:41:1d:19:d0",
"ipAddr": "10.125.34.62",
"deviceModel": "virtio",
"isKernelAccelerated": 0,
"queues": 1,
"vsiMngId": "string",
"vsiTypeId": "string",
"vsiTypeVer": "string",
"vsiIdFormat": "string",
"address": "0000:07:09.0",
"driverType": "VIFO",
"ethName": "eth3",
"vlan": 1,
"securityGroupId": 1,
"tcpCheckSum": "false"
}
],
"storage": [
{
"device": "disk",
"storeFile": "/vms/images/test",
"capacity": 1,
"cacheType": "directsync",
"targetBus": "virtio",
"type": "file",
"driveType": "qcow2",
"mode": 2,
"assignType": 1,
"priority": 0,
"poolName": "defaultpool",
"clusterSize": 262144,
"diskMode": "subordinate",
"writeBytesSec": 0,
"readBytesSec": 0,
"writeIopsSec": 0,
"readIopsSec": 0,
"imgFileName": "string"
}
],
"usb": [
{
"controller": 2,
"bus": 3,
"device": 1,
"devName": "usb_usb3",
"vendorId": "0x1d6b",
"vendor": "Linux 3.13.6 uhci_hcd",
"productId": "0x0001",
"product": "UHCI Host Controller"
}
],
"pci": [
{
"driver": "VFIO",
"bus": 3,
"slot": 0,
"function": 2,
"ethName": "eth2",
"devName": "pci_0000_03_00_2",
"vendorId": "0x14e4",
"vendor": "Broadcom Corporation",
"productId": "0x1657",
"product": "NetXtreme BCM5719 Gigabit Ethernet PCIe"
}
]
}
暂无评论