Create a Guest

Format

MethodPOST
URL

/tasks/create

Request contentGuestCreate Object
Successful answerTaskResult Object
Unexpected errorHTTP 500

GuestCreate Object

Schema

repeatStringReserved
retriesStringNumber of times this task will be retried, in case of an error
typeStringTask type identifier. In this case, "guest_create"
guest_idStringUnique identifier of the Guest
descriptionStringDescription of the Guest
socketsStringNumber of virtual CPU sockets
coresStringNumber of CPU cores per socket
vramStringRAM in GB.
audio_drvStringAudio driver name. One of "rtl8139" or "ich6".
rtc_typeStringRTC clock reference. One of "local", "UTC", or empty
keyboard_drvStringKeyboard driver name. One of "ps2", "usb" or empty
cpu_emulStringCPU emulation type. One of "kvm", "amd" or empty
pool_idStringUnique identifier of the Pool that will contain the new Guest
preferred_hostStringPreferred host for this Guest
disk_listArray of DiskInfoArray of associated Images
direct_disk_listArray of DirectDiskInfoArray of directly attached disks
iso_listArray of ISOInfoArray of associated ISO images
net_listArray of NetworkInfoArray 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

devnumStringDevice bus number
busStringBus name. One of "virtio" or "ide"
image_storage_idStringUnique identifier of the ImageStorage that contains Volume volume_id
volume_idStringUnique identifier of the Volume that contains Image image_id
image_idStringUnique 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

devnumStringDevice bus number
busStringBus name
direct_storage_idStringUnique identifier of the DirectStorage that contains the PhysicalDisk physical_disk_id
physical_disk_idStringUnique identifier of this PhysicalDisk

JSON example

{
    "devnum": "1",
    "bus": "virtio",
    "direct_storage_id": "dstorage01",
    "physical_disk_id": "4021V3WF"
}

 

ISOInfo Object

Schema

devnumStringDevice bus number
busStringBus name
media_storage_idStringUnique identifier of the MediaStorage that contains ISO image filename. The special value ms-empty means an empty optical drive.
filenameStringName 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

deviceStringDevice name, for ordering. In the form "ethN", where N is the ordinal of this device
hwaddrStringMAC address of the interface
bridgeStringHost virtual bridge where the interface is attached
driverStringNetwork device driver name. One of "virtio", "rtl8139" or "e1000"
vlan_modeStringVLAN mode. One of "none", "access" or "trunk"
vlan_listArray of StringFor 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": ""
}