Create a Guest
Format
Method | POST |
---|---|
URL | /tasks/create |
Request content | GuestCreate Object |
Successful answer | TaskResult Object |
Unexpected error | HTTP 500 |
GuestCreate Object
Schema
repeat | String | Reserved |
---|---|---|
retries | String | Number of times this task will be retried, in case of an error |
type | String | Task type identifier. In this case, "guest_create" |
guest_id | String | Unique identifier of the Guest |
description | String | Description of the Guest |
sockets | String | Number of virtual CPU sockets |
cores | String | Number of CPU cores per socket |
vram | String | RAM in GB. |
audio_drv | String | Audio driver name. One of "rtl8139" or "ich6". |
rtc_type | String | RTC clock reference. One of "local", "UTC", or empty |
keyboard_drv | String | Keyboard driver name. One of "ps2", "usb" or empty |
cpu_emul | String | CPU emulation type. One of "kvm", "amd" or empty |
pool_id | String | Unique identifier of the Pool that will contain the new Guest |
preferred_host | String | Preferred host for this Guest |
disk_list | Array of DiskInfo | Array of associated Images |
direct_disk_list | Array of DirectDiskInfo | Array of directly attached disks |
iso_list | Array of ISOInfo | Array of associated ISO images |
net_list | Array of NetworkInfo | Array of network interfaces of the new Guest |
JSON example
{ "repeat": "0", "retries": "0", "type": "guest_create", "rtc_type": "", "vram": "2", "audio_drv": "ich6", "sockets": "1", "description": "", "cores": "2", "preferred_host": "", "direct_disk_list": [], "guest_id": "corus", "disk_list": [{ "devnum": "0", "bus": "virtio", "volume_id": "home_flexvdi", "image_id": "corus", "image_storage_id": "internal" }], "iso_list": [{ "media_storage_id": "ms-empty", "filename": "ms-empty", "devnum": "0", "bus": "ide" }], "net_list": [{ "vlan_list": "", "vlan_mode": "none", "bridge": "virbr0", "driver": "virtio", "hwaddr": "02:f1:00:14:00:05", "device": "eth0" }], "pool_id": "templates" } |
DiskInfo Object
Schema
devnum | String | Device bus number |
---|---|---|
bus | String | Bus name. One of "virtio" or "ide" |
image_storage_id | String | Unique identifier of the ImageStorage that contains Volume volume_id |
volume_id | String | Unique identifier of the Volume that contains Image image_id |
image_id | String | Unique identifier of this disk Image |
JSON example
{ "devnum": "0", "bus": "virtio", "volume_id": "home_flexvdi", "image_id": "corus", "image_storage_id": "internal" } |
DirectDiskInfo Object
Schema
devnum | String | Device bus number |
---|---|---|
bus | String | Bus name |
direct_storage_id | String | Unique identifier of the DirectStorage that contains the PhysicalDisk physical_disk_id |
physical_disk_id | String | Unique identifier of this PhysicalDisk |
JSON example
{ "devnum": "1", "bus": "virtio", "direct_storage_id": "dstorage01", "physical_disk_id": "4021V3WF" } |
ISOInfo Object
Schema
devnum | String | Device bus number |
---|---|---|
bus | String | Bus name |
media_storage_id | String | Unique identifier of the MediaStorage that contains ISO image filename. The special value ms-empty means an empty optical drive. |
filename | String | Name of the ISO image. The special value ms-empty means an empty optical drive. |
JSON example
{ "media_storage_id": "ms-empty", "filename": "ms-empty", "devnum": "0", "bus": "ide" } |
NetworkInfo Object
Schema
device | String | Device name, for ordering. In the form "ethN", where N is the ordinal of this device |
---|---|---|
hwaddr | String | MAC address of the interface |
bridge | String | Host virtual bridge where the interface is attached |
driver | String | Network device driver name. One of "virtio", "rtl8139" or "e1000" |
vlan_mode | String | VLAN mode. One of "none", "access" or "trunk" |
vlan_list | Array of String | For VLAN modes "access" and "trunk", the list of allowed VLANs |
JSON example
{ "device": "eth0", "hwaddr": "02:f1:00:14:00:05", "bridge": "virbr0", "driver": "virtio", "vlan_mode": "none", "vlan_list": "" } |