username:password
Authorization: Basic *****************
{
"nodeid": 1,
"hostname": "cloud-test01",
"sockets": 1,
"cores": 2,
"threads": 2,
"nested": false,
"modelGroup": 2,
"cpu": "host",
"arch": "x86_64",
"memory": 512,
"storage": "auto",
"systemDiskSize": 40,
"os": "CentOS-8-Stream-x64.qcow2",
"osType": "linux",
"bandwidth": 100,
"ipConfig": {
"1": ""
},
"dataDisk": {
"1": 40
},
"onBoot": 1,
"username": "root",
"password": "123456",
"ifnat": 1,
"natnum": 10
}
curl --location --request POST '/api/v1/pve/cerateVM' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
"nodeid": 1,
"hostname": "cloud-test01",
"sockets": 1,
"cores": 2,
"threads": 2,
"nested": false,
"modelGroup": 2,
"cpu": "host",
"arch": "x86_64",
"memory": 512,
"storage": "auto",
"systemDiskSize": 40,
"os": "CentOS-8-Stream-x64.qcow2",
"osType": "linux",
"bandwidth": 100,
"ipConfig": {
"1": ""
},
"dataDisk": {
"1": 40
},
"onBoot": 1,
"username": "root",
"password": "123456",
"ifnat": 1,
"natnum": 10
}'
{
"code": 20000,
"message": "请求成功",
"data": {
"nodeid": 1,
"hostid": 34,
"vmid": 102,
"hostname": "cloud-test01",
"configureTemplateId": null,
"sockets": 1,
"cores": 2,
"threads": 2,
"nested": false,
"devirtualization": false,
"kvm": true,
"cpuModel": null,
"modelGroup": 2,
"cpu": "host",
"cpuUnits": 1024,
"args": null,
"arch": "x86_64",
"acpi": 1,
"memory": 512,
"swap": null,
"storage": "local-lvm",
"systemDiskSize": 40,
"dataDisk": {
"1": 40
},
"bridge": "vmbr0",
"ipConfig": {
"1": "ip=192.168.36.1/24,gw=192.168.36.2"
},
"dns1": "114.114.114.114",
"os": "CentOS-8-Stream-x64.qcow2",
"osType": "linux",
"iso": null,
"template": null,
"onBoot": 1,
"bandwidth": 100,
"username": "root",
"password": "123456",
"task": null,
"status": null,
"expirationTime": null
}
}