-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
描述
创建云主机(CreateVmInstance)
用户可以用CreateVmInstance来创建一台云主机
API
org.zstack.header.vm.APICreateVmInstanceMsg
举例(Example)
管理员可以使用CreateVmInstance来创建一个云主机. 例如:
CreateVmInstance name=testvm imageUuid=c56c58d5a5954bcf89d574b29deac3be instanceOfferingUuid=fc676d3efa624afe9c0ba0e100ec7bb2 l3NetworkUuids=7c58161234074fe99d2094952fe63b6e
参数(Parameters)
| 名字 | 描述 | 可选的参数 | 起始支持版本 |
|---|---|---|---|
| name | 云主机名称 | 否 | 0.6 |
| imageUuid | �创建云主机所用镜像uuid | 否 | 0.6 |
| instanceOfferingUuid | 创建云主机所用规格uuid | 否 | 0.6 |
| l3NetworkUuids | 创建云主机所用3层网络uuid列表 | 否 | 0.6 |
| clusterUuid | 集群uuid,如果非null,云主机将在所指定的集群上创建;hostUuid优先于本参数设置 | 是 | 0.6 |
| dataDiskOfferingUuids | 数据盘规格uuid | 是 | 0.6 |
| rootDiskOfferingUuid | 数据盘规格uuid | 是 | 0.6 |
| description | 资源的描述 | 是 | 0.6 |
| hostUuid | 如果非null,云主机将在所指定的物理机上创建 | 是 | 0.6 |
| defaultL3NetworkUuid | 如果l3NetworkUuids包含了多余一个的L3网络的UUID,这个参数指定哪个L3网络是默认的 | 是 | 0.6 |
| resourceUuid | 指定资源的uuid | 是 | 0.6 |
| strategy | InstantStart or JustCreate | 是 | 0.x |
| systemTags | 0.x | ||
| type | 保留的域,默认为UserVm | 是 | 0.6 |
| userTags | |||
| zoneUuid | 如果非null, 云主机将在所指定的区域上创建; clusterUuid和hostUuid优先于这个参数的设置 | 是 | 0.6 |
| primaryStorageUuidForRootVolume | 创建云主机时可设置根云盘所使用的主存储 | 是 | 1.8 |
备注
-
rootDiskOfferingUuid
如果云主机是从ISO镜像创建的, 用户必须指定一个rootDiskOfferingUuid,这样ZStack才能知道根云盘的磁盘大小; 如果云主机是从RootVolumeTemplate镜像创建的, 可以忽略这个域. -
dataDiskOfferingUuids
通过在dataDiskOfferingUuids指定云盘规格的UUID列表, 用户可以创建一个挂载了多个数据云盘的云主机. 如果某个数据云盘创建失败了,整个云主机的创建也会失败.