/v1/projects/{project_id}/qemu/vms

POST /v1/projects/{project_id}/qemu/vms

Create a new Qemu.instance

Parameters

  • project_id: UUID for the project

Response status codes

  • 400: Invalid request
  • 201: Instance created
  • 409: Conflict

Input

Name Mandatory Type Description
adapter_type ['string', 'null'] QEMU adapter type
adapters ['integer', 'null'] number of adapters
console ['integer', 'null'] console TCP port
cpu_throttling ['integer', 'null'] Percentage of CPU allowed for QEMU
hda_disk_image ['string', 'null'] QEMU hda disk image path
hdb_disk_image ['string', 'null'] QEMU hdb disk image path
hdc_disk_image ['string', 'null'] QEMU hdc disk image path
hdd_disk_image ['string', 'null'] QEMU hdd disk image path
initrd ['string', 'null'] QEMU initrd path
kernel_command_line ['string', 'null'] QEMU kernel command line
kernel_image ['string', 'null'] QEMU kernel image path
legacy_networking ['boolean', 'null'] Use QEMU legagy networking commands (-net syntax)
name string QEMU VM instance name
options ['string', 'null'] Additional QEMU options
process_priority enum Possible values: realtime, very high, high, normal, low, very low, null
qemu_path string Path to QEMU
ram ['integer', 'null'] amount of RAM in MB
vm_id QEMU VM identifier

Output

Name Mandatory Type Description
adapter_type string QEMU adapter type
adapters integer number of adapters
console integer console TCP port
cpu_throttling integer Percentage of CPU allowed for QEMU
hda_disk_image string QEMU hda disk image path
hdb_disk_image string QEMU hdb disk image path
hdc_disk_image string QEMU hdc disk image path
hdd_disk_image string QEMU hdd disk image path
initrd string QEMU initrd path
kernel_command_line string QEMU kernel command line
kernel_image string QEMU kernel image path
legacy_networking boolean Use QEMU legagy networking commands (-net syntax)
name string QEMU VM instance name
options string Additional QEMU options
process_priority enum Possible values: realtime, very high, high, normal, low, very low
project_id string Project uuid
qemu_path string path to QEMU
ram integer amount of RAM in MB
vm_id string QEMU VM uuid

Sample session

curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms' -d '{"hda_disk_image": "/tmp/hda", "name": "PC TEST 1", "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpyasp9636/qemu_x42", "ram": 1024}'

POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms HTTP/1.1
{
    "hda_disk_image": "/tmp/hda",
    "name": "PC TEST 1",
    "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpyasp9636/qemu_x42",
    "ram": 1024
}


HTTP/1.1 201
CONNECTION: keep-alive
CONTENT-LENGTH: 606
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.1.rc2
X-ROUTE: /v1/projects/{project_id}/qemu/vms

{
    "adapter_type": "e1000",
    "adapters": 1,
    "console": 2000,
    "cpu_throttling": 0,
    "hda_disk_image": "/tmp/hda",
    "hdb_disk_image": "",
    "hdc_disk_image": "",
    "hdd_disk_image": "",
    "initrd": "",
    "kernel_command_line": "",
    "kernel_image": "",
    "legacy_networking": false,
    "name": "PC TEST 1",
    "options": "",
    "process_priority": "low",
    "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
    "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpyasp9636/qemu_x42",
    "ram": 1024,
    "vm_id": "8c325041-39a8-4c31-b921-b66dadadc353"
}