mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-12 09:00:57 +00:00
Support VM usage for qemu
Ref https://github.com/GNS3/gns3-gui/issues/829
This commit is contained in:
parent
e626c0b55c
commit
42a4df5079
@ -48,6 +48,7 @@ class BaseVM:
|
|||||||
def __init__(self, name, vm_id, project, manager, console=None, console_type="telnet"):
|
def __init__(self, name, vm_id, project, manager, console=None, console_type="telnet"):
|
||||||
|
|
||||||
self._name = name
|
self._name = name
|
||||||
|
self._usage = ""
|
||||||
self._id = vm_id
|
self._id = vm_id
|
||||||
self._project = project
|
self._project = project
|
||||||
self._manager = manager
|
self._manager = manager
|
||||||
@ -124,6 +125,26 @@ class BaseVM:
|
|||||||
new_name=new_name))
|
new_name=new_name))
|
||||||
self._name = new_name
|
self._name = new_name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def usage(self):
|
||||||
|
"""
|
||||||
|
Returns the usage for this VM.
|
||||||
|
|
||||||
|
:returns: usage
|
||||||
|
"""
|
||||||
|
|
||||||
|
return self._usage
|
||||||
|
|
||||||
|
@usage.setter
|
||||||
|
def usage(self, new_usage):
|
||||||
|
"""
|
||||||
|
Sets the usage of this VM.
|
||||||
|
|
||||||
|
:param new_usage: usage
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._usage = new_usage
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
"""
|
"""
|
||||||
|
@ -38,6 +38,10 @@ QEMU_CREATE_SCHEMA = {
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
},
|
},
|
||||||
|
"usage": {
|
||||||
|
"description": "How to use the qemu VM",
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
"linked_clone": {
|
"linked_clone": {
|
||||||
"description": "either the VM is a linked clone or not",
|
"description": "either the VM is a linked clone or not",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
@ -211,6 +215,10 @@ QEMU_UPDATE_SCHEMA = {
|
|||||||
"type": ["string", "null"],
|
"type": ["string", "null"],
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
},
|
},
|
||||||
|
"usage": {
|
||||||
|
"description": "How to use the qemu VM",
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
"qemu_path": {
|
"qemu_path": {
|
||||||
"description": "Path to QEMU",
|
"description": "Path to QEMU",
|
||||||
"type": ["string", "null"],
|
"type": ["string", "null"],
|
||||||
@ -389,6 +397,10 @@ QEMU_OBJECT_SCHEMA = {
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
},
|
},
|
||||||
|
"usage": {
|
||||||
|
"description": "How to use the qemu VM",
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
"qemu_path": {
|
"qemu_path": {
|
||||||
"description": "path to QEMU",
|
"description": "path to QEMU",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -548,12 +560,45 @@ QEMU_OBJECT_SCHEMA = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
"additionalProperties": False,
|
"additionalProperties": False,
|
||||||
"required": ["vm_id", "project_id", "name", "qemu_path", "platform", "console_type", "hda_disk_image", "hdb_disk_image",
|
"required": ["vm_id",
|
||||||
"hdc_disk_image", "hdd_disk_image", "hda_disk_image_md5sum", "hdb_disk_image_md5sum",
|
"project_id",
|
||||||
"hdc_disk_image_md5sum", "hdd_disk_image_md5sum", "hda_disk_interface", "hdb_disk_interface", "hdc_disk_interface",
|
"name",
|
||||||
"hdd_disk_interface", "cdrom_image", "cdrom_image_md5sum", "boot_priority", "ram", "cpus", "adapters", "adapter_type",
|
"usage",
|
||||||
"mac_address", "console", "initrd", "kernel_image", "initrd_md5sum", "kernel_image_md5sum", "kernel_command_line",
|
"qemu_path",
|
||||||
"legacy_networking", "acpi_shutdown", "cpu_throttling", "process_priority", "options", "vm_directory"]
|
"platform",
|
||||||
|
"console_type",
|
||||||
|
"hda_disk_image",
|
||||||
|
"hdb_disk_image",
|
||||||
|
"hdc_disk_image",
|
||||||
|
"hdd_disk_image",
|
||||||
|
"hda_disk_image_md5sum",
|
||||||
|
"hdb_disk_image_md5sum",
|
||||||
|
"hdc_disk_image_md5sum",
|
||||||
|
"hdd_disk_image_md5sum",
|
||||||
|
"hda_disk_interface",
|
||||||
|
"hdb_disk_interface",
|
||||||
|
"hdc_disk_interface",
|
||||||
|
"hdd_disk_interface",
|
||||||
|
"cdrom_image",
|
||||||
|
"cdrom_image_md5sum",
|
||||||
|
"boot_priority",
|
||||||
|
"ram",
|
||||||
|
"cpus",
|
||||||
|
"adapters",
|
||||||
|
"adapter_type",
|
||||||
|
"mac_address",
|
||||||
|
"console",
|
||||||
|
"initrd",
|
||||||
|
"kernel_image",
|
||||||
|
"initrd_md5sum",
|
||||||
|
"kernel_image_md5sum",
|
||||||
|
"kernel_command_line",
|
||||||
|
"legacy_networking",
|
||||||
|
"acpi_shutdown",
|
||||||
|
"cpu_throttling",
|
||||||
|
"process_priority",
|
||||||
|
"options",
|
||||||
|
"vm_directory"]
|
||||||
}
|
}
|
||||||
|
|
||||||
QEMU_BINARY_LIST_SCHEMA = {
|
QEMU_BINARY_LIST_SCHEMA = {
|
||||||
|
Loading…
Reference in New Issue
Block a user