From 9d83ff67cc74dde386effcd18449705dd0c36fa6 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 21 Jun 2023 18:02:41 +0930 Subject: [PATCH 1/9] Add Qemu uefi option --- README.md | 1 + check.py | 2 +- schemas/appliance_v8.json | 518 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 520 insertions(+), 1 deletion(-) create mode 100644 schemas/appliance_v8.json diff --git a/README.md b/README.md index a0fc9f69..e9f8a292 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ GNS3 checks the schema version, if the schema of an appliance is not supported i | 5 | 2.1.0 | qemu/console_type: spice | | 6 | 2.2.0 | qemu/custom_adapters
qemu/console_type: spice+agent
all/console_type: none| | 7 | 2.2.36 | qemu/tpm | +| 8 | 3.0.0 | qemu/uefi | Adding a new symbol ------------------- diff --git a/check.py b/check.py index 4be2aa93..220fa075 100644 --- a/check.py +++ b/check.py @@ -25,7 +25,7 @@ from picture import get_size APPLIANCE_IDS = [] -SCHEMA_VERSIONS = [4, 5, 6, 7] +SCHEMA_VERSIONS = [4, 5, 6, 7, 8] warnings = 0 diff --git a/schemas/appliance_v8.json b/schemas/appliance_v8.json new file mode 100644 index 00000000..13ad7fcc --- /dev/null +++ b/schemas/appliance_v8.json @@ -0,0 +1,518 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "title": "JSON schema validating a GNS3 appliance", + + "definitions": { + "dynamips_slot": { + "enum": ["C2600-MB-2FE", "C2600-MB-1E", "PA-A1", "PA-8E", "C1700-MB-1FE", "PA-8T", "PA-2FE-TX", "PA-FE-TX", "PA-GE", "C2600-MB-2E", "C7200-IO-FE", "NM-4T", "C2600-MB-1FE", "C7200-IO-2FE", "PA-POS-OC3", "PA-4T+", "C1700-MB-WIC1", "NM-16ESW", "C7200-IO-GE-E", "NM-4E", "GT96100-FE", "NM-1FE-TX", "Leopard-2FE", "NM-1E", "PA-4E", ""] + }, + + "dynamips_wic": { + "enum": ["WIC-1ENET", "WIC-1T", "WIC-2T", ""] + } + }, + + "properties": { + "appliance_id": { + "title": "Appliance ID", + "type": "string", + "minLength": 36, + "maxLength": 36, + "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + }, + "name": { + "type": "string", + "title": "Appliance name" + }, + "category": { + "enum": [ + "router", + "multilayer_switch", + "firewall", + "guest" + ], + "title": "Category of the appliance" + }, + "description": { + "type": "string", + "title": "Description of the appliance. Could be a marketing description" + }, + "vendor_name": { + "type": "string", + "title": "Name of the vendor" + }, + "vendor_url": { + "type": "string", + "format": "uri", + "title": "Website of the vendor" + }, + "documentation_url": { + "type": "string", + "format": "uri", + "title": "An optional documentation for using the appliance on vendor website" + }, + "product_name": { + "type": "string", + "title": "Product name" + }, + "product_url": { + "type": "string", + "format": "uri", + "title": "An optional product url on vendor website" + }, + "registry_version": { + "enum": [1, 2, 3, 4, 5, 6], + "title": "Version of the registry compatible with this appliance" + }, + "status": { + "enum": ["stable", "experimental", "broken"], + "title": "Document if the appliance is working or not" + }, + "availability": { + "enum": ["free", "with-registration", "free-to-try", "service-contract"], + "title": "About image availability: can be downloaded directly; download requires a free registration; paid but a trial version (time or feature limited) is available; not available publicly" + }, + "maintainer": { + "type": "string", + "title": "Maintainer name" + }, + "maintainer_email": { + "type": "string", + "format": "email", + "title": "Maintainer email" + }, + "usage": { + "type": "string", + "title": "How to use the appliance" + }, + "symbol": { + "type": "string", + "title": "An optional symbol for the appliance" + }, + "first_port_name": { + "type": "string", + "title": "Optional name of the first networking port example: eth0" + }, + "port_name_format": { + "type": "string", + "title": "Optional formating of the networking port example: eth{0}" + }, + "port_segment_size": { + "type": "integer", + "title": "Optional port segment size. A port segment is a block of port. For example Ethernet0/0 Ethernet0/1 is the module 0 with a port segment size of 2" + }, + "linked_clone": { + "type": "boolean", + "title": "False if you don't want to use a single image for all nodes" + }, + + "docker": { + "type": "object", + "title": "Docker specific options", + "properties": { + "adapters": { + "type": "integer", + "title": "Number of ethernet adapters" + }, + "image": { + "type": "string", + "title": "Docker image in the Docker Hub" + }, + "start_command": { + "type": "string", + "title": "Command executed when the container start. Empty will use the default" + }, + "environment": { + "type": "string", + "title": "One KEY=VAR environment by line" + }, + "console_type": { + "enum": ["telnet", "vnc", "http", "https"], + "title": "Type of console connection for the administration of the appliance" + }, + "console_http_port": { + "description": "Internal port in the container of the HTTP server", + "type": "integer" + }, + "console_http_path": { + "description": "Path of the web interface", + "type": "string" + } + }, + "required": [ + "adapters", + "image" + ] + }, + "iou": { + "type": "object", + "title": "IOU specific options", + "properties": { + "ethernet_adapters": { + "type": "integer", + "title": "Number of ethernet adapters" + }, + "serial_adapters": { + "type": "integer", + "title": "Number of serial adapters" + }, + "nvram": { + "type": "integer", + "title": "Host NVRAM" + }, + "ram": { + "type": "integer", + "title": "Host RAM" + }, + "startup_config": { + "type": "string", + "title": "Config loaded at startup" + } + }, + "required": [ + "ethernet_adapters", + "serial_adapters", + "nvram", + "ram", + "startup_config" + ] + }, + "dynamips": { + "type": "object", + "title": "Dynamips specific options", + "properties": { + "chassis": { + "title": "Chassis type", + "enum": ["1720", "1721", "1750", "1751", "1760", "2610", "2620", "2610XM", "2620XM", "2650XM", "2621", "2611XM", "2621XM", "2651XM", "3620", "3640", "3660", ""] + }, + "platform": { + "title": "Platform type", + "enum": ["c1700", "c2600", "c2691", "c3725", "c3745", "c3600", "c7200"] + }, + "ram": { + "title": "Amount of ram", + "type": "integer", + "minimum": 1 + }, + "nvram": { + "title": "Amount of nvram", + "type": "integer", + "minimum": 1 + }, + "startup_config": { + "type": "string", + "title": "Config loaded at startup" + }, + "wic0": { "$ref": "#/definitions/dynamips_wic" }, + "wic1": { "$ref": "#/definitions/dynamips_wic" }, + "wic2": { "$ref": "#/definitions/dynamips_wic" }, + "slot0": { "$ref": "#/definitions/dynamips_slot" }, + "slot1": { "$ref": "#/definitions/dynamips_slot" }, + "slot2": { "$ref": "#/definitions/dynamips_slot" }, + "slot3": { "$ref": "#/definitions/dynamips_slot" }, + "slot4": { "$ref": "#/definitions/dynamips_slot" }, + "slot5": { "$ref": "#/definitions/dynamips_slot" }, + "slot6": { "$ref": "#/definitions/dynamips_slot" }, + "midplane": { "enum": ["std", "vxr"] }, + "npe": { "enum": ["npe-100", "npe-150", "npe-175", "npe-200", "npe-225", "npe-300", "npe-400", "npe-g2"] } + }, + "required": [ + "platform", + "ram", + "nvram" + ] + }, + + "qemu": { + "type": "object", + "title": "Qemu specific options", + "properties": { + "adapter_type": { + "enum": [ + "e1000", + "i82550", + "i82551", + "i82557a", + "i82557b", + "i82557c", + "i82558a", + "i82558b", + "i82559a", + "i82559b", + "i82559c", + "i82559er", + "i82562", + "i82801", + "ne2k_pci", + "pcnet", + "rtl8139", + "virtio", + "virtio-net-pci", + "vmxnet3" + ], + "title": "Type of network adapter" + }, + "adapters": { + "type": "integer", + "title": "Number of adapters" + }, + "custom_adapters": { + "type": "array", + "title": "Custom adapters", + "items": { + "type": "object", + "properties": { + "adapter_number": { + "title": "Adapter number", + "type": "integer" + }, + "port_name": { + "title": "Custom port name", + "type": "string", + "minimum": 1 + }, + "adapter_type": { + "title": "Custom adapter type", + "type": "string", + "enum": [ + "e1000", + "i82550", + "i82551", + "i82557a", + "i82557b", + "i82557c", + "i82558a", + "i82558b", + "i82559a", + "i82559b", + "i82559c", + "i82559er", + "i82562", + "i82801", + "ne2k_pci", + "pcnet", + "rtl8139", + "virtio", + "virtio-net-pci", + "vmxnet3" + ] + }, + "mac_address": { + "title": "Custom MAC address", + "type": "string", + "minimum": 1, + "pattern": "^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$" + } + }, + "required": ["adapter_number"] + } + }, + "ram": { + "type": "integer", + "title": "Ram allocated to the appliance (MB)" + }, + "cpus": { + "type": "integer", + "title": "Number of Virtual CPU" + }, + "hda_disk_interface": { + "enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"], + "title": "Disk interface for the installed hda_disk_image" + }, + "hdb_disk_interface": { + "enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"], + "title": "Disk interface for the installed hdb_disk_image" + }, + "hdc_disk_interface": { + "enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"], + "title": "Disk interface for the installed hdc_disk_image" + }, + "hdd_disk_interface": { + "enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"], + "title": "Disk interface for the installed hdd_disk_image" + }, + "arch": { + "enum": ["aarch64", "alpha", "arm", "cris", "i386", "lm32", "m68k", "microblaze", "microblazeel", "mips", "mips64", "mips64el", "mipsel", "moxie", "or32", "ppc", "ppc64", "ppcemb", "s390x", "sh4", "sh4eb", "sparc", "sparc64", "tricore", "unicore32", "x86_64", "xtensa", "xtensaeb"], + "title": "Architecture emulated" + }, + "console_type": { + "enum": ["telnet", "vnc", "spice"], + "title": "Type of console connection for the administration of the appliance" + }, + "boot_priority": { + "enum": ["d", "c", "dc", "cd", "n", "nc", "nd", "cn", "dn"], + "title": "Optional define the disk boot priory. Refer to -boot option in qemu manual for more details." + }, + "kernel_command_line": { + "type": "string", + "title": "Command line parameters send to the kernel" + }, + "kvm": { + "title": "KVM requirements", + "enum": ["require", "allow", "disable"] + }, + "options": { + "type": "string", + "title": "Optional additional qemu command line options" + }, + "cpu_throttling": { + "type": "number", + "minimum": 0, + "maximum": 100, + "title": "Throttle the CPU" + }, + "tpm": { + "type": "boolean", + "title": "Enable the Trusted Platform Module (TPM)" + }, + "uefi": { + "type": "boolean", + "title": "Enable the UEFI boot mode" + }, + "on_close": { + "title": "Action to execute on the VM is closed", + "enum": ["power_off", "shutdown_signal", "save_vm_state"] + }, + "process_priority": { + "title": "Process priority for QEMU", + "enum": ["realtime", + "very high", + "high", + "normal", + "low", + "very low", + "null"] + } + }, + "required": [ + "adapter_type", + "adapters", + "ram", + "arch", + "console_type", + "kvm" + ] + }, + "images": { + "type": "array", + "title": "Images for this appliance", + "items": { + "type": "object", + "title": "An image file", + "properties": { + "filename": { + "type": "string", + "title": "Filename" + }, + "version": { + "type": "string", + "title": "Version of the file" + }, + "md5sum": { + "type": "string", + "title": "md5sum of the file", + "pattern": "^[a-f0-9]{32}$" + }, + "filesize": { + "type": "integer", + "title": "File size in bytes" + }, + "download_url": { + "type": "string", + "format": "uri", + "title": "Download url where you can download the appliance from a browser" + }, + "direct_download_url": { + "type": "string", + "format": "uri", + "title": "Optional. Non authenticated url to the image file where you can download the image." + }, + "compression": { + "enum": ["bzip2", "gzip", "lzma", "xz", "rar", "zip", "7z"], + "title": "Optional, compression type of direct download url image." + } + }, + "required": [ + "filename", + "version", + "md5sum", + "filesize" + ] + } + }, + "versions": { + "type": "array", + "title": "Versions of the appliance", + "items": { + "type": "object", + "title": "A version of the appliance", + "properties": { + "name": { + "type": "string", + "title": "Name of the version" + }, + "idlepc": {"type": "string", "pattern": "^0x[0-9a-f]{8}"}, + "images": { + "type": "object", + "title": "Images used for this version", + "properties": { + "kernel_image": { + "type": "string", + "title": "Kernel image" + }, + "initrd": { + "type": "string", + "title": "Initrd disk image" + }, + "image": { + "type": "string", + "title": "OS image" + }, + "bios_image": { + "type": "string", + "title": "Bios image" + }, + "hda_disk_image": { + "type": "string", + "title": "Hda disk image" + }, + "hdb_disk_image": { + "type": "string", + "title": "Hdc disk image" + }, + "hdc_disk_image": { + "type": "string", + "title": "Hdd disk image" + }, + "hdd_disk_image": { + "type": "string", + "title": "Hdd diskimage" + }, + "cdrom_image": { + "type": "string", + "title": "cdrom image" + } + } + } + }, + "required": [ + "name" + ] + } + } + }, + "required": [ + "appliance_id", + "name", + "category", + "description", + "vendor_name", + "vendor_url", + "product_name", + "registry_version", + "status", + "maintainer", + "maintainer_email" + ] +} From 9156faa340fa0a918c78a19a07f3090bbe8864dd Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 22 Jun 2023 11:54:37 +0930 Subject: [PATCH 2/9] Add missing registry version compatibility --- schemas/appliance_v7.json | 2 +- schemas/appliance_v8.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/appliance_v7.json b/schemas/appliance_v7.json index d71655b7..ecbdc8e8 100644 --- a/schemas/appliance_v7.json +++ b/schemas/appliance_v7.json @@ -62,7 +62,7 @@ "title": "An optional product url on vendor website" }, "registry_version": { - "enum": [1, 2, 3, 4, 5, 6], + "enum": [1, 2, 3, 4, 5, 6, 7], "title": "Version of the registry compatible with this appliance" }, "status": { diff --git a/schemas/appliance_v8.json b/schemas/appliance_v8.json index 13ad7fcc..d4f4e81e 100644 --- a/schemas/appliance_v8.json +++ b/schemas/appliance_v8.json @@ -62,7 +62,7 @@ "title": "An optional product url on vendor website" }, "registry_version": { - "enum": [1, 2, 3, 4, 5, 6], + "enum": [1, 2, 3, 4, 5, 6, 7, 8], "title": "Version of the registry compatible with this appliance" }, "status": { From 544fca14cec0b2ad29e90508022e73a7db0079e9 Mon Sep 17 00:00:00 2001 From: grossmj Date: Fri, 23 Jun 2023 11:21:12 +0930 Subject: [PATCH 3/9] Appliance format v8 support will be added in v2.2.41 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9f8a292..118b1eac 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ GNS3 checks the schema version, if the schema of an appliance is not supported i | 5 | 2.1.0 | qemu/console_type: spice | | 6 | 2.2.0 | qemu/custom_adapters
qemu/console_type: spice+agent
all/console_type: none| | 7 | 2.2.36 | qemu/tpm | -| 8 | 3.0.0 | qemu/uefi | +| 8 | 2.2.41 | qemu/uefi | Adding a new symbol ------------------- From a3317eadd2a8d38da0dda9aaab3a86dfa94b27e8 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 24 Jun 2023 23:46:09 +0930 Subject: [PATCH 4/9] Add proposed changes to appliance_v8.json --- schemas/appliance_v8.json | 994 +++++++++++++++++++++++++------------- 1 file changed, 664 insertions(+), 330 deletions(-) diff --git a/schemas/appliance_v8.json b/schemas/appliance_v8.json index d4f4e81e..8edda1d4 100644 --- a/schemas/appliance_v8.json +++ b/schemas/appliance_v8.json @@ -2,17 +2,491 @@ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "title": "JSON schema validating a GNS3 appliance", - "definitions": { "dynamips_slot": { - "enum": ["C2600-MB-2FE", "C2600-MB-1E", "PA-A1", "PA-8E", "C1700-MB-1FE", "PA-8T", "PA-2FE-TX", "PA-FE-TX", "PA-GE", "C2600-MB-2E", "C7200-IO-FE", "NM-4T", "C2600-MB-1FE", "C7200-IO-2FE", "PA-POS-OC3", "PA-4T+", "C1700-MB-WIC1", "NM-16ESW", "C7200-IO-GE-E", "NM-4E", "GT96100-FE", "NM-1FE-TX", "Leopard-2FE", "NM-1E", "PA-4E", ""] + "enum": [ + "C2600-MB-2FE", + "C2600-MB-1E", + "PA-A1", + "PA-8E", + "C1700-MB-1FE", + "PA-8T", + "PA-2FE-TX", + "PA-FE-TX", + "PA-GE", + "C2600-MB-2E", + "C7200-IO-FE", + "NM-4T", + "C2600-MB-1FE", + "C7200-IO-2FE", + "PA-POS-OC3", + "PA-4T+", + "C1700-MB-WIC1", + "NM-16ESW", + "C7200-IO-GE-E", + "NM-4E", + "GT96100-FE", + "NM-1FE-TX", + "Leopard-2FE", + "NM-1E", + "PA-4E", + "" + ] }, - "dynamips_wic": { - "enum": ["WIC-1ENET", "WIC-1T", "WIC-2T", ""] + "enum": [ + "WIC-1ENET", + "WIC-1T", + "WIC-2T", + "" + ] + }, + "docker_properties": { + "type": "object", + "title": "Docker specific properties", + "properties": { + "adapters": { + "type": "integer", + "title": "Number of ethernet adapters" + }, + "image": { + "type": "string", + "title": "Docker image in the Docker Hub" + }, + "start_command": { + "type": "string", + "title": "Command executed when the container start. Empty will use the default" + }, + "environment": { + "type": "string", + "title": "One KEY=VAR environment by line" + }, + "console_type": { + "enum": [ + "telnet", + "vnc", + "http", + "https" + ], + "title": "Type of console connection for the administration of the appliance" + }, + "console_http_port": { + "description": "Internal port in the container of the HTTP server", + "type": "integer" + }, + "console_http_path": { + "description": "Path of the web interface", + "type": "string" + } + }, + "required": [ + "adapters", + "image" + ] + }, + "iou_properties": { + "type": "object", + "title": "IOU specific properties", + "properties": { + "ethernet_adapters": { + "type": "integer", + "title": "Number of ethernet adapters" + }, + "serial_adapters": { + "type": "integer", + "title": "Number of serial adapters" + }, + "nvram": { + "type": "integer", + "title": "Host NVRAM" + }, + "ram": { + "type": "integer", + "title": "Host RAM" + }, + "startup_config": { + "type": "string", + "title": "Config loaded at startup" + } + }, + "required": [ + "ethernet_adapters", + "serial_adapters", + "nvram", + "ram", + "startup_config" + ] + }, + "dynamips_properties": { + "type": "object", + "title": "Dynamips specific properties", + "properties": { + "chassis": { + "title": "Chassis type", + "enum": [ + "1720", + "1721", + "1750", + "1751", + "1760", + "2610", + "2620", + "2610XM", + "2620XM", + "2650XM", + "2621", + "2611XM", + "2621XM", + "2651XM", + "3620", + "3640", + "3660", + "" + ] + }, + "platform": { + "title": "Platform type", + "enum": [ + "c1700", + "c2600", + "c2691", + "c3725", + "c3745", + "c3600", + "c7200" + ] + }, + "ram": { + "title": "Amount of ram", + "type": "integer", + "minimum": 1 + }, + "nvram": { + "title": "Amount of nvram", + "type": "integer", + "minimum": 1 + }, + "startup_config": { + "type": "string", + "title": "Config loaded at startup" + }, + "wic0": { + "$ref": "#/definitions/dynamips_wic" + }, + "wic1": { + "$ref": "#/definitions/dynamips_wic" + }, + "wic2": { + "$ref": "#/definitions/dynamips_wic" + }, + "slot0": { + "$ref": "#/definitions/dynamips_slot" + }, + "slot1": { + "$ref": "#/definitions/dynamips_slot" + }, + "slot2": { + "$ref": "#/definitions/dynamips_slot" + }, + "slot3": { + "$ref": "#/definitions/dynamips_slot" + }, + "slot4": { + "$ref": "#/definitions/dynamips_slot" + }, + "slot5": { + "$ref": "#/definitions/dynamips_slot" + }, + "slot6": { + "$ref": "#/definitions/dynamips_slot" + }, + "midplane": { + "enum": [ + "std", + "vxr" + ] + }, + "npe": { + "enum": [ + "npe-100", + "npe-150", + "npe-175", + "npe-200", + "npe-225", + "npe-300", + "npe-400", + "npe-g2" + ] + } + }, + "required": [ + "platform", + "ram", + "nvram" + ] + }, + "qemu_properties": { + "type": "object", + "title": "Qemu specific properties", + "properties": { + "adapter_type": { + "enum": [ + "e1000", + "i82550", + "i82551", + "i82557a", + "i82557b", + "i82557c", + "i82558a", + "i82558b", + "i82559a", + "i82559b", + "i82559c", + "i82559er", + "i82562", + "i82801", + "ne2k_pci", + "pcnet", + "rtl8139", + "virtio", + "virtio-net-pci", + "vmxnet3" + ], + "title": "Type of network adapter" + }, + "adapters": { + "type": "integer", + "title": "Number of adapters" + }, + "custom_adapters": { + "type": "array", + "title": "Custom adapters", + "items": { + "type": "object", + "properties": { + "adapter_number": { + "title": "Adapter number", + "type": "integer" + }, + "port_name": { + "title": "Custom port name", + "type": "string", + "minimum": 1 + }, + "adapter_type": { + "title": "Custom adapter type", + "type": "string", + "enum": [ + "e1000", + "i82550", + "i82551", + "i82557a", + "i82557b", + "i82557c", + "i82558a", + "i82558b", + "i82559a", + "i82559b", + "i82559c", + "i82559er", + "i82562", + "i82801", + "ne2k_pci", + "pcnet", + "rtl8139", + "virtio", + "virtio-net-pci", + "vmxnet3" + ] + }, + "mac_address": { + "title": "Custom MAC address", + "type": "string", + "minimum": 1, + "pattern": "^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$" + } + }, + "required": [ + "adapter_number" + ] + } + }, + "ram": { + "type": "integer", + "title": "Ram allocated to the appliance (MB)" + }, + "cpus": { + "type": "integer", + "title": "Number of Virtual CPU" + }, + "hda_disk_interface": { + "enum": [ + "ide", + "scsi", + "sd", + "mtd", + "floppy", + "pflash", + "virtio", + "sata" + ], + "title": "Disk interface for the installed hda_disk_image" + }, + "hdb_disk_interface": { + "enum": [ + "ide", + "scsi", + "sd", + "mtd", + "floppy", + "pflash", + "virtio", + "sata" + ], + "title": "Disk interface for the installed hdb_disk_image" + }, + "hdc_disk_interface": { + "enum": [ + "ide", + "scsi", + "sd", + "mtd", + "floppy", + "pflash", + "virtio", + "sata" + ], + "title": "Disk interface for the installed hdc_disk_image" + }, + "hdd_disk_interface": { + "enum": [ + "ide", + "scsi", + "sd", + "mtd", + "floppy", + "pflash", + "virtio", + "sata" + ], + "title": "Disk interface for the installed hdd_disk_image" + }, + "arch": { + "enum": [ + "aarch64", + "alpha", + "arm", + "cris", + "i386", + "lm32", + "m68k", + "microblaze", + "microblazeel", + "mips", + "mips64", + "mips64el", + "mipsel", + "moxie", + "or32", + "ppc", + "ppc64", + "ppcemb", + "s390x", + "sh4", + "sh4eb", + "sparc", + "sparc64", + "tricore", + "unicore32", + "x86_64", + "xtensa", + "xtensaeb" + ], + "title": "Architecture emulated" + }, + "console_type": { + "enum": [ + "telnet", + "vnc", + "spice" + ], + "title": "Type of console connection for the administration of the appliance" + }, + "boot_priority": { + "enum": [ + "d", + "c", + "dc", + "cd", + "n", + "nc", + "nd", + "cn", + "dn" + ], + "title": "Optional define the disk boot priory. Refer to -boot option in qemu manual for more details." + }, + "kernel_command_line": { + "type": "string", + "title": "Command line parameters send to the kernel" + }, + "kvm": { + "title": "KVM requirements", + "enum": [ + "require", + "allow", + "disable" + ] + }, + "options": { + "type": "string", + "title": "Optional additional qemu command line options" + }, + "cpu_throttling": { + "type": "number", + "minimum": 0, + "maximum": 100, + "title": "Throttle the CPU" + }, + "tpm": { + "type": "boolean", + "title": "Enable the Trusted Platform Module (TPM)" + }, + "uefi": { + "type": "boolean", + "title": "Enable the UEFI boot mode" + }, + "on_close": { + "title": "Action to execute on the VM is closed", + "enum": [ + "power_off", + "shutdown_signal", + "save_vm_state" + ] + }, + "process_priority": { + "title": "Process priority for QEMU", + "enum": [ + "realtime", + "very high", + "high", + "normal", + "low", + "very low", + "null" + ] + } + }, + "required": [ + "adapter_type", + "adapters", + "ram", + "arch", + "console_type", + "kvm" + ] } }, - "properties": { "appliance_id": { "title": "Appliance ID", @@ -27,10 +501,10 @@ }, "category": { "enum": [ - "router", - "multilayer_switch", - "firewall", - "guest" + "router", + "multilayer_switch", + "firewall", + "guest" ], "title": "Category of the appliance" }, @@ -62,15 +536,33 @@ "title": "An optional product url on vendor website" }, "registry_version": { - "enum": [1, 2, 3, 4, 5, 6, 7, 8], + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], "title": "Version of the registry compatible with this appliance" }, "status": { - "enum": ["stable", "experimental", "broken"], + "enum": [ + "stable", + "experimental", + "broken" + ], "title": "Document if the appliance is working or not" }, "availability": { - "enum": ["free", "with-registration", "free-to-try", "service-contract"], + "enum": [ + "free", + "with-registration", + "free-to-try", + "service-contract" + ], "title": "About image availability: can be downloaded directly; download requires a free registration; paid but a trial version (time or feature limited) is available; not available publicly" }, "maintainer": { @@ -82,317 +574,99 @@ "format": "email", "title": "Maintainer email" }, + "installation_instructions": { + "type": "string", + "title": "Optional installation instructions" + }, "usage": { - "type": "string", - "title": "How to use the appliance" + "type": "string", + "title": "How to use the appliance" + }, + "default_username": { + "type": "string", + "title": "Default username for the appliance" + }, + "default_password": { + "type": "string", + "title": "Default password for the appliance" }, "symbol": { "type": "string", "title": "An optional symbol for the appliance" }, "first_port_name": { - "type": "string", - "title": "Optional name of the first networking port example: eth0" + "type": "string", + "title": "Optional name of the first networking port example: eth0" }, "port_name_format": { - "type": "string", - "title": "Optional formating of the networking port example: eth{0}" + "type": "string", + "title": "Optional formating of the networking port example: eth{0}" }, "port_segment_size": { - "type": "integer", - "title": "Optional port segment size. A port segment is a block of port. For example Ethernet0/0 Ethernet0/1 is the module 0 with a port segment size of 2" + "type": "integer", + "title": "Optional port segment size. A port segment is a block of port. For example Ethernet0/0 Ethernet0/1 is the module 0 with a port segment size of 2" }, "linked_clone": { - "type": "boolean", - "title": "False if you don't want to use a single image for all nodes" - }, - - "docker": { - "type": "object", - "title": "Docker specific options", - "properties": { - "adapters": { - "type": "integer", - "title": "Number of ethernet adapters" - }, - "image": { - "type": "string", - "title": "Docker image in the Docker Hub" - }, - "start_command": { - "type": "string", - "title": "Command executed when the container start. Empty will use the default" - }, - "environment": { - "type": "string", - "title": "One KEY=VAR environment by line" - }, - "console_type": { - "enum": ["telnet", "vnc", "http", "https"], - "title": "Type of console connection for the administration of the appliance" - }, - "console_http_port": { - "description": "Internal port in the container of the HTTP server", - "type": "integer" - }, - "console_http_path": { - "description": "Path of the web interface", - "type": "string" - } - }, - "required": [ - "adapters", - "image" - ] - }, - "iou": { - "type": "object", - "title": "IOU specific options", - "properties": { - "ethernet_adapters": { - "type": "integer", - "title": "Number of ethernet adapters" - }, - "serial_adapters": { - "type": "integer", - "title": "Number of serial adapters" - }, - "nvram": { - "type": "integer", - "title": "Host NVRAM" - }, - "ram": { - "type": "integer", - "title": "Host RAM" - }, - "startup_config": { - "type": "string", - "title": "Config loaded at startup" - } - }, - "required": [ - "ethernet_adapters", - "serial_adapters", - "nvram", - "ram", - "startup_config" - ] + "type": "boolean", + "title": "False if you don't want to use a single image for all nodes" }, - "dynamips": { + "settings": { + "type": "array", + "title": "Settings for running the appliance", + "items": { "type": "object", - "title": "Dynamips specific options", + "title": "Emulator settings", "properties": { - "chassis": { - "title": "Chassis type", - "enum": ["1720", "1721", "1750", "1751", "1760", "2610", "2620", "2610XM", "2620XM", "2650XM", "2621", "2611XM", "2621XM", "2651XM", "3620", "3640", "3660", ""] - }, - "platform": { - "title": "Platform type", - "enum": ["c1700", "c2600", "c2691", "c3725", "c3745", "c3600", "c7200"] - }, - "ram": { - "title": "Amount of ram", - "type": "integer", - "minimum": 1 - }, - "nvram": { - "title": "Amount of nvram", - "type": "integer", - "minimum": 1 - }, - "startup_config": { - "type": "string", - "title": "Config loaded at startup" - }, - "wic0": { "$ref": "#/definitions/dynamips_wic" }, - "wic1": { "$ref": "#/definitions/dynamips_wic" }, - "wic2": { "$ref": "#/definitions/dynamips_wic" }, - "slot0": { "$ref": "#/definitions/dynamips_slot" }, - "slot1": { "$ref": "#/definitions/dynamips_slot" }, - "slot2": { "$ref": "#/definitions/dynamips_slot" }, - "slot3": { "$ref": "#/definitions/dynamips_slot" }, - "slot4": { "$ref": "#/definitions/dynamips_slot" }, - "slot5": { "$ref": "#/definitions/dynamips_slot" }, - "slot6": { "$ref": "#/definitions/dynamips_slot" }, - "midplane": { "enum": ["std", "vxr"] }, - "npe": { "enum": ["npe-100", "npe-150", "npe-175", "npe-200", "npe-225", "npe-300", "npe-400", "npe-g2"] } - }, - "required": [ - "platform", - "ram", - "nvram" - ] - }, - - "qemu": { - "type": "object", - "title": "Qemu specific options", - "properties": { - "adapter_type": { - "enum": [ - "e1000", - "i82550", - "i82551", - "i82557a", - "i82557b", - "i82557c", - "i82558a", - "i82558b", - "i82559a", - "i82559b", - "i82559c", - "i82559er", - "i82562", - "i82801", - "ne2k_pci", - "pcnet", - "rtl8139", - "virtio", - "virtio-net-pci", - "vmxnet3" - ], - "title": "Type of network adapter" - }, - "adapters": { - "type": "integer", - "title": "Number of adapters" - }, - "custom_adapters": { + "name": { + "type": "string", + "title": "Name of the settings set" + }, + "default": { + "type": "boolean", + "title": "Whether these are the default settings" + }, + "emulator_type": { + "enum": [ + "docker", + "iou", + "dynamips", + "qemu" + ], + "title": "Type of emulator properties" + }, + "emulator_versions": { "type": "array", - "title": "Custom adapters", + "title": "Versions of the emulator", "items": { - "type": "object", - "properties": { - "adapter_number": { - "title": "Adapter number", - "type": "integer" - }, - "port_name": { - "title": "Custom port name", - "type": "string", - "minimum": 1 - }, - "adapter_type": { - "title": "Custom adapter type", - "type": "string", - "enum": [ - "e1000", - "i82550", - "i82551", - "i82557a", - "i82557b", - "i82557c", - "i82558a", - "i82558b", - "i82559a", - "i82559b", - "i82559c", - "i82559er", - "i82562", - "i82801", - "ne2k_pci", - "pcnet", - "rtl8139", - "virtio", - "virtio-net-pci", - "vmxnet3" - ] - }, - "mac_address": { - "title": "Custom MAC address", - "type": "string", - "minimum": 1, - "pattern": "^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$" - } + "type": "string", + "title": "Version of the emulator" + }, + "emulator_properties": { + "type": "object", + "title": "Properties for the emulator", + "oneOf": [ + { + "$ref": "#/definitions/qemu_properties" + }, + { + "$ref": "#/definitions/dynamips_properties" }, - "required": ["adapter_number"] + { + "$ref": "#/definitions/iou_properties" + }, + { + "$ref": "#/definitions/docker_properties" + } + ] } - }, - "ram": { - "type": "integer", - "title": "Ram allocated to the appliance (MB)" - }, - "cpus": { - "type": "integer", - "title": "Number of Virtual CPU" - }, - "hda_disk_interface": { - "enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"], - "title": "Disk interface for the installed hda_disk_image" - }, - "hdb_disk_interface": { - "enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"], - "title": "Disk interface for the installed hdb_disk_image" - }, - "hdc_disk_interface": { - "enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"], - "title": "Disk interface for the installed hdc_disk_image" - }, - "hdd_disk_interface": { - "enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"], - "title": "Disk interface for the installed hdd_disk_image" - }, - "arch": { - "enum": ["aarch64", "alpha", "arm", "cris", "i386", "lm32", "m68k", "microblaze", "microblazeel", "mips", "mips64", "mips64el", "mipsel", "moxie", "or32", "ppc", "ppc64", "ppcemb", "s390x", "sh4", "sh4eb", "sparc", "sparc64", "tricore", "unicore32", "x86_64", "xtensa", "xtensaeb"], - "title": "Architecture emulated" - }, - "console_type": { - "enum": ["telnet", "vnc", "spice"], - "title": "Type of console connection for the administration of the appliance" - }, - "boot_priority": { - "enum": ["d", "c", "dc", "cd", "n", "nc", "nd", "cn", "dn"], - "title": "Optional define the disk boot priory. Refer to -boot option in qemu manual for more details." - }, - "kernel_command_line": { - "type": "string", - "title": "Command line parameters send to the kernel" - }, - "kvm": { - "title": "KVM requirements", - "enum": ["require", "allow", "disable"] - }, - "options": { - "type": "string", - "title": "Optional additional qemu command line options" - }, - "cpu_throttling": { - "type": "number", - "minimum": 0, - "maximum": 100, - "title": "Throttle the CPU" - }, - "tpm": { - "type": "boolean", - "title": "Enable the Trusted Platform Module (TPM)" - }, - "uefi": { - "type": "boolean", - "title": "Enable the UEFI boot mode" - }, - "on_close": { - "title": "Action to execute on the VM is closed", - "enum": ["power_off", "shutdown_signal", "save_vm_state"] - }, - "process_priority": { - "title": "Process priority for QEMU", - "enum": ["realtime", - "very high", - "high", - "normal", - "low", - "very low", - "null"] + }, + "required": [ + "name", + "emulator_type", + "emulator_properties" + ] } - }, - "required": [ - "adapter_type", - "adapters", - "ram", - "arch", - "console_type", - "kvm" - ] + } }, "images": { "type": "array", @@ -409,14 +683,19 @@ "type": "string", "title": "Version of the file" }, - "md5sum": { + "checksum": { "type": "string", - "title": "md5sum of the file", - "pattern": "^[a-f0-9]{32}$" + "title": "checksum of the file" + }, + "checksum_type": { + "title": "checksum type", + "enum": [ + "md5" + ] }, "filesize": { - "type": "integer", - "title": "File size in bytes" + "type": "integer", + "title": "File size in bytes" }, "download_url": { "type": "string", @@ -429,15 +708,27 @@ "title": "Optional. Non authenticated url to the image file where you can download the image." }, "compression": { - "enum": ["bzip2", "gzip", "lzma", "xz", "rar", "zip", "7z"], + "enum": [ + "bzip2", + "gzip", + "lzma", + "xz", + "rar", + "zip", + "7z" + ], "title": "Optional, compression type of direct download url image." + }, + "compression_target": { + "type": "string", + "title": "Optional, file name of the image file inside the compressed file." } }, "required": [ - "filename", - "version", - "md5sum", - "filesize" + "filename", + "version", + "md5sum", + "filesize" ] } }, @@ -452,7 +743,50 @@ "type": "string", "title": "Name of the version" }, - "idlepc": {"type": "string", "pattern": "^0x[0-9a-f]{8}"}, + "settings": { + "type": "string", + "title": "Emulator settings to use to run the version" + }, + "installation_instructions": { + "type": "string", + "title": "Optional installation instructions for the version" + }, + "usage": { + "type": "string", + "title": "Optional instructions about using the version" + }, + "default_username": { + "type": "string", + "title": "Default username for the version" + }, + "default_password": { + "type": "string", + "title": "Default password for the version" + }, + "symbol": { + "type": "string", + "title": "An optional symbol for the version" + }, + "first_port_name": { + "type": "string", + "title": "Optional name of the first networking port example: eth0" + }, + "port_name_format": { + "type": "string", + "title": "Optional formating of the networking port example: eth{0}" + }, + "port_segment_size": { + "type": "integer", + "title": "Optional port segment size. A port segment is a block of port. For example Ethernet0/0 Ethernet0/1 is the module 0 with a port segment size of 2" + }, + "linked_clone": { + "type": "boolean", + "title": "False if you don't want to use a single image for all nodes" + }, + "idlepc": { + "type": "string", + "pattern": "^0x[0-9a-f]{8}" + }, "images": { "type": "object", "title": "Images used for this version", @@ -497,22 +831,22 @@ } }, "required": [ - "name" + "name" ] } - } - }, - "required": [ - "appliance_id", - "name", - "category", - "description", - "vendor_name", - "vendor_url", - "product_name", - "registry_version", - "status", - "maintainer", - "maintainer_email" - ] -} + }, + "required": [ + "appliance_id", + "name", + "category", + "description", + "vendor_name", + "vendor_url", + "product_name", + "registry_version", + "status", + "maintainer", + "maintainer_email" + ] + } +} \ No newline at end of file From 2ad309451148e3a290a24aa4050cf681a988cfae Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 25 Jun 2023 00:11:26 +0930 Subject: [PATCH 5/9] Change required md5sum field to checksum --- schemas/appliance_v8.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/appliance_v8.json b/schemas/appliance_v8.json index 8edda1d4..4849645b 100644 --- a/schemas/appliance_v8.json +++ b/schemas/appliance_v8.json @@ -727,7 +727,7 @@ "required": [ "filename", "version", - "md5sum", + "checksum", "filesize" ] } From d457a3534a531036729b8f39622ff1112b48ea40 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 9 Jul 2023 13:34:50 +1000 Subject: [PATCH 6/9] Update appliance schema version 8 --- schemas/appliance_v8.json | 729 +++++++++++++++++++++----------------- 1 file changed, 398 insertions(+), 331 deletions(-) diff --git a/schemas/appliance_v8.json b/schemas/appliance_v8.json index 4849645b..7598052b 100644 --- a/schemas/appliance_v8.json +++ b/schemas/appliance_v8.json @@ -3,55 +3,45 @@ "type": "object", "title": "JSON schema validating a GNS3 appliance", "definitions": { - "dynamips_slot": { - "enum": [ - "C2600-MB-2FE", - "C2600-MB-1E", - "PA-A1", - "PA-8E", - "C1700-MB-1FE", - "PA-8T", - "PA-2FE-TX", - "PA-FE-TX", - "PA-GE", - "C2600-MB-2E", - "C7200-IO-FE", - "NM-4T", - "C2600-MB-1FE", - "C7200-IO-2FE", - "PA-POS-OC3", - "PA-4T+", - "C1700-MB-WIC1", - "NM-16ESW", - "C7200-IO-GE-E", - "NM-4E", - "GT96100-FE", - "NM-1FE-TX", - "Leopard-2FE", - "NM-1E", - "PA-4E", - "" - ] - }, - "dynamips_wic": { + "categories": { "enum": [ - "WIC-1ENET", - "WIC-1T", - "WIC-2T", - "" + "router", + "multilayer_switch", + "firewall", + "guest" ] }, "docker_properties": { "type": "object", - "title": "Docker specific properties", + "title": "Docker template properties", "properties": { - "adapters": { - "type": "integer", - "title": "Number of ethernet adapters" + "name": { + "type": "string", + "title": "Name of the template" + }, + "category": { + "$ref": "#/definitions/categories", + "title": "Category of the template" + }, + "default_name_format": { + "type": "string", + "title": "Default name format" + }, + "usage": { + "type": "string", + "title": "How to use the template" + }, + "symbol": { + "type": "string", + "title": "Symbol of the template" }, "image": { "type": "string", - "title": "Docker image in the Docker Hub" + "title": "Docker image" + }, + "adapters": { + "type": "integer", + "title": "Number of ethernet adapters" }, "start_command": { "type": "string", @@ -68,15 +58,28 @@ "http", "https" ], - "title": "Type of console connection for the administration of the appliance" + "title": "Type of console" }, "console_http_port": { - "description": "Internal port in the container of the HTTP server", + "title": "Internal port in the container of the HTTP server", "type": "integer" }, "console_http_path": { - "description": "Path of the web interface", + "title": "Path of the web interface", + "type": "string" + }, + "console_resolution": { + "title": "Console resolution for VNC, for example 1024x768", + "type": "string", + "pattern": "^[0-9]+x[0-9]+$" + }, + "extra_hosts": { + "title": "Docker extra hosts (added to /etc/hosts)", "type": "string" + }, + "extra_volumes": { + "title": "Additional directories to make persistent", + "type": "array" } }, "required": [ @@ -86,8 +89,28 @@ }, "iou_properties": { "type": "object", - "title": "IOU specific properties", + "title": "IOU template properties", "properties": { + "name": { + "type": "string", + "title": "Name of the template" + }, + "category": { + "$ref": "#/definitions/categories", + "title": "Category of the template" + }, + "default_name_format": { + "type": "string", + "title": "Default name format" + }, + "usage": { + "type": "string", + "title": "How to use the template" + }, + "symbol": { + "type": "string", + "title": "Symbol of the template" + }, "ethernet_adapters": { "type": "integer", "title": "Number of ethernet adapters" @@ -96,14 +119,14 @@ "type": "integer", "title": "Number of serial adapters" }, - "nvram": { - "type": "integer", - "title": "Host NVRAM" - }, "ram": { "type": "integer", "title": "Host RAM" }, + "nvram": { + "type": "integer", + "title": "Host NVRAM" + }, "startup_config": { "type": "string", "title": "Config loaded at startup" @@ -117,10 +140,68 @@ "startup_config" ] }, + "dynamips_slot": { + "enum": [ + "C2600-MB-2FE", + "C2600-MB-1E", + "PA-A1", + "PA-8E", + "C1700-MB-1FE", + "PA-8T", + "PA-2FE-TX", + "PA-FE-TX", + "PA-GE", + "C2600-MB-2E", + "C7200-IO-FE", + "NM-4T", + "C2600-MB-1FE", + "C7200-IO-2FE", + "PA-POS-OC3", + "PA-4T+", + "C1700-MB-WIC1", + "NM-16ESW", + "C7200-IO-GE-E", + "NM-4E", + "GT96100-FE", + "NM-1FE-TX", + "Leopard-2FE", + "NM-1E", + "PA-4E", + "" + ] + }, + "dynamips_wic": { + "enum": [ + "WIC-1ENET", + "WIC-1T", + "WIC-2T", + "" + ] + }, "dynamips_properties": { "type": "object", - "title": "Dynamips specific properties", + "title": "Dynamips template properties", "properties": { + "name": { + "type": "string", + "title": "Name of the template" + }, + "category": { + "$ref": "#/definitions/categories", + "title": "Category of the template" + }, + "default_name_format": { + "type": "string", + "title": "Default name format" + }, + "usage": { + "type": "string", + "title": "How to use the template" + }, + "symbol": { + "type": "string", + "title": "Symbol of the template" + }, "chassis": { "title": "Chassis type", "enum": [ @@ -166,6 +247,10 @@ "type": "integer", "minimum": 1 }, + "idlepc": { + "type": "string", + "pattern": "^0x[0-9a-f]{8}" + }, "startup_config": { "type": "string", "title": "Config loaded at startup" @@ -225,10 +310,42 @@ "nvram" ] }, + "qemu_disk_interfaces": { + "enum": [ + "ide", + "scsi", + "sd", + "mtd", + "floppy", + "pflash", + "virtio", + "sata" + ] + }, "qemu_properties": { "type": "object", - "title": "Qemu specific properties", + "title": "Qemu template properties", "properties": { + "name": { + "type": "string", + "title": "Name of the template" + }, + "category": { + "$ref": "#/definitions/categories", + "title": "Category of the template" + }, + "default_name_format": { + "type": "string", + "title": "Default name format" + }, + "usage": { + "type": "string", + "title": "How to use the template" + }, + "symbol": { + "type": "string", + "title": "Symbol of the template" + }, "adapter_type": { "enum": [ "e1000", @@ -311,6 +428,22 @@ ] } }, + "first_port_name": { + "type": "string", + "title": "Optional name of the first networking port example: eth0" + }, + "port_name_format": { + "type": "string", + "title": "Optional formating of the networking port example: eth{0}" + }, + "port_segment_size": { + "type": "integer", + "title": "Optional port segment size. A port segment is a block of port. For example Ethernet0/0 Ethernet0/1 is the module 0 with a port segment size of 2" + }, + "linked_clone": { + "type": "boolean", + "title": "False if you don't want to use a single image for all nodes" + }, "ram": { "type": "integer", "title": "Ram allocated to the appliance (MB)" @@ -320,58 +453,22 @@ "title": "Number of Virtual CPU" }, "hda_disk_interface": { - "enum": [ - "ide", - "scsi", - "sd", - "mtd", - "floppy", - "pflash", - "virtio", - "sata" - ], + "$ref": "#/definitions/qemu_disk_interfaces", "title": "Disk interface for the installed hda_disk_image" }, "hdb_disk_interface": { - "enum": [ - "ide", - "scsi", - "sd", - "mtd", - "floppy", - "pflash", - "virtio", - "sata" - ], + "$ref": "#/definitions/qemu_disk_interfaces", "title": "Disk interface for the installed hdb_disk_image" }, "hdc_disk_interface": { - "enum": [ - "ide", - "scsi", - "sd", - "mtd", - "floppy", - "pflash", - "virtio", - "sata" - ], + "$ref": "#/definitions/qemu_disk_interfaces", "title": "Disk interface for the installed hdc_disk_image" }, "hdd_disk_interface": { - "enum": [ - "ide", - "scsi", - "sd", - "mtd", - "floppy", - "pflash", - "virtio", - "sata" - ], + "$ref": "#/definitions/qemu_disk_interfaces", "title": "Disk interface for the installed hdd_disk_image" }, - "arch": { + "platform": { "enum": [ "aarch64", "alpha", @@ -402,13 +499,14 @@ "xtensa", "xtensaeb" ], - "title": "Architecture emulated" + "title": "Platform to emulate" }, "console_type": { "enum": [ "telnet", "vnc", - "spice" + "spice", + "spice+agent" ], "title": "Type of console connection for the administration of the appliance" }, @@ -481,7 +579,7 @@ "adapter_type", "adapters", "ram", - "arch", + "platform", "console_type", "kvm" ] @@ -500,12 +598,7 @@ "title": "Appliance name" }, "category": { - "enum": [ - "router", - "multilayer_switch", - "firewall", - "guest" - ], + "$ref": "#/definitions/categories", "title": "Category of the appliance" }, "description": { @@ -537,16 +630,9 @@ }, "registry_version": { "enum": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, 8 ], - "title": "Version of the registry compatible with this appliance" + "title": "Version of the registry compatible with this appliance (version >=8 introduced breaking changes)" }, "status": { "enum": [ @@ -594,22 +680,6 @@ "type": "string", "title": "An optional symbol for the appliance" }, - "first_port_name": { - "type": "string", - "title": "Optional name of the first networking port example: eth0" - }, - "port_name_format": { - "type": "string", - "title": "Optional formating of the networking port example: eth{0}" - }, - "port_segment_size": { - "type": "integer", - "title": "Optional port segment size. A port segment is a block of port. For example Ethernet0/0 Ethernet0/1 is the module 0 with a port segment size of 2" - }, - "linked_clone": { - "type": "boolean", - "title": "False if you don't want to use a single image for all nodes" - }, "settings": { "type": "array", "title": "Settings for running the appliance", @@ -625,7 +695,12 @@ "type": "boolean", "title": "Whether these are the default settings" }, - "emulator_type": { + "inherit_default_settings": { + "type": "boolean", + "title": "Whether the default settings should be used", + "default": "true" + }, + "template_type": { "enum": [ "docker", "iou", @@ -634,219 +709,211 @@ ], "title": "Type of emulator properties" }, - "emulator_versions": { - "type": "array", - "title": "Versions of the emulator", - "items": { - "type": "string", - "title": "Version of the emulator" - }, - "emulator_properties": { - "type": "object", - "title": "Properties for the emulator", - "oneOf": [ - { - "$ref": "#/definitions/qemu_properties" - }, - { - "$ref": "#/definitions/dynamips_properties" - }, - { - "$ref": "#/definitions/iou_properties" - }, - { - "$ref": "#/definitions/docker_properties" - } - ] - } - }, - "required": [ - "name", - "emulator_type", - "emulator_properties" - ] - } - } - }, - "images": { - "type": "array", - "title": "Images for this appliance", - "items": { - "type": "object", - "title": "An image file", - "properties": { - "filename": { - "type": "string", - "title": "Filename" - }, - "version": { - "type": "string", - "title": "Version of the file" - }, - "checksum": { - "type": "string", - "title": "checksum of the file" - }, - "checksum_type": { - "title": "checksum type", - "enum": [ - "md5" - ] - }, - "filesize": { - "type": "integer", - "title": "File size in bytes" - }, - "download_url": { - "type": "string", - "format": "uri", - "title": "Download url where you can download the appliance from a browser" - }, - "direct_download_url": { - "type": "string", - "format": "uri", - "title": "Optional. Non authenticated url to the image file where you can download the image." - }, - "compression": { - "enum": [ - "bzip2", - "gzip", - "lzma", - "xz", - "rar", - "zip", - "7z" - ], - "title": "Optional, compression type of direct download url image." - }, - "compression_target": { - "type": "string", - "title": "Optional, file name of the image file inside the compressed file." - } - }, - "required": [ - "filename", - "version", - "checksum", - "filesize" - ] - } - }, - "versions": { - "type": "array", - "title": "Versions of the appliance", - "items": { - "type": "object", - "title": "A version of the appliance", - "properties": { - "name": { - "type": "string", - "title": "Name of the version" - }, - "settings": { - "type": "string", - "title": "Emulator settings to use to run the version" - }, - "installation_instructions": { - "type": "string", - "title": "Optional installation instructions for the version" - }, - "usage": { - "type": "string", - "title": "Optional instructions about using the version" - }, - "default_username": { - "type": "string", - "title": "Default username for the version" - }, - "default_password": { - "type": "string", - "title": "Default password for the version" - }, - "symbol": { - "type": "string", - "title": "An optional symbol for the version" - }, - "first_port_name": { - "type": "string", - "title": "Optional name of the first networking port example: eth0" - }, - "port_name_format": { - "type": "string", - "title": "Optional formating of the networking port example: eth{0}" - }, - "port_segment_size": { - "type": "integer", - "title": "Optional port segment size. A port segment is a block of port. For example Ethernet0/0 Ethernet0/1 is the module 0 with a port segment size of 2" - }, - "linked_clone": { - "type": "boolean", - "title": "False if you don't want to use a single image for all nodes" - }, - "idlepc": { - "type": "string", - "pattern": "^0x[0-9a-f]{8}" - }, - "images": { + "template_properties": { "type": "object", - "title": "Images used for this version", - "properties": { - "kernel_image": { - "type": "string", - "title": "Kernel image" + "title": "Properties for the template", + "oneOf": [ + { + "$ref": "#/definitions/qemu_properties" }, - "initrd": { - "type": "string", - "title": "Initrd disk image" + { + "$ref": "#/definitions/dynamips_properties" }, - "image": { - "type": "string", - "title": "OS image" - }, - "bios_image": { - "type": "string", - "title": "Bios image" - }, - "hda_disk_image": { - "type": "string", - "title": "Hda disk image" + { + "$ref": "#/definitions/iou_properties" }, - "hdb_disk_image": { - "type": "string", - "title": "Hdc disk image" - }, - "hdc_disk_image": { - "type": "string", - "title": "Hdd disk image" - }, - "hdd_disk_image": { - "type": "string", - "title": "Hdd diskimage" - }, - "cdrom_image": { - "type": "string", - "title": "cdrom image" + { + "$ref": "#/definitions/docker_properties" } - } + ] } }, "required": [ - "name" + "template_type", + "template_properties" ] } - }, - "required": [ - "appliance_id", - "name", - "category", - "description", - "vendor_name", - "vendor_url", - "product_name", - "registry_version", - "status", - "maintainer", - "maintainer_email" - ] - } -} \ No newline at end of file + } + }, + "images": { + "type": "array", + "title": "Images for this appliance", + "items": { + "type": "object", + "title": "An image file", + "properties": { + "filename": { + "type": "string", + "title": "Filename" + }, + "version": { + "type": "string", + "title": "Version of the image file" + }, + "md5sum": { + "type": "string", + "title": "MD5 cheksum of the image file", + "pattern": "^[a-f0-9]{32}$" + }, + "checksum": { + "type": "string", + "title": "checksum of the image file" + }, + "checksum_type": { + "title": "checksum type of the image file", + "enum": [ + "md5" + ] + }, + "filesize": { + "type": "integer", + "title": "File size in bytes of the image file" + }, + "download_url": { + "type": "string", + "format": "uri", + "title": "Download URL where you can download the image file from a browser" + }, + "direct_download_url": { + "type": "string", + "format": "uri", + "title": "Optional. Non authenticated URL to the image file where you can download the image directly" + }, + "compression": { + "enum": [ + "bzip2", + "gzip", + "lzma", + "xz", + "rar", + "zip", + "7z" + ], + "title": "Optional, compression type of direct download URL image." + }, + "compression_target": { + "type": "string", + "title": "Optional, file name of the image file inside the compressed file." + } + }, + "anyOf": [ + { + "required": [ + "filename", + "version", + "md5sum", + "filesize" + ] + }, + { + "required": [ + "filename", + "version", + "checksum", + "filesize" + ] + } + ] + } + }, + "versions": { + "type": "array", + "title": "Versions of the appliance", + "items": { + "type": "object", + "title": "A version of the appliance", + "properties": { + "name": { + "type": "string", + "title": "Name of the version" + }, + "settings": { + "type": "string", + "title": "Template settings to use to run the version" + }, + "category": { + "$ref": "#/definitions/categories", + "title": "Category of the version" + }, + "installation_instructions": { + "type": "string", + "title": "Optional installation instructions for the version" + }, + "usage": { + "type": "string", + "title": "Optional instructions about using the version" + }, + "default_username": { + "type": "string", + "title": "Default username for the version" + }, + "default_password": { + "type": "string", + "title": "Default password for the version" + }, + "symbol": { + "type": "string", + "title": "An optional symbol for the version" + }, + "images": { + "type": "object", + "title": "Images used for this version", + "properties": { + "kernel_image": { + "type": "string", + "title": "Kernel image (Qemu only)" + }, + "initrd": { + "type": "string", + "title": "Initrd disk image (Qemu only)" + }, + "image": { + "type": "string", + "title": "OS image (IOU and Dynamips only)" + }, + "bios_image": { + "type": "string", + "title": "Bios image (Qemu only)" + }, + "hda_disk_image": { + "type": "string", + "title": "Hda disk image (Qemu only)" + }, + "hdb_disk_image": { + "type": "string", + "title": "Hdc disk image (Qemu only)" + }, + "hdc_disk_image": { + "type": "string", + "title": "Hdd disk image (Qemu only)" + }, + "hdd_disk_image": { + "type": "string", + "title": "Hdd disk image (Qemu only)" + }, + "cdrom_image": { + "type": "string", + "title": "cdrom image (Qemu only)" + } + } + } + }, + "required": [ + "name" + ] + } + }, + "required": [ + "appliance_id", + "name", + "category", + "description", + "vendor_name", + "vendor_url", + "product_name", + "registry_version", + "status", + "maintainer", + "maintainer_email" + ] +} From b70bf4e6597ae8a793cbabfadc4929a7fd908fad Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 14 Aug 2023 12:00:59 +1000 Subject: [PATCH 7/9] Drop "kvm" field. --- schemas/appliance_v8.json | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/schemas/appliance_v8.json b/schemas/appliance_v8.json index 7598052b..c66c6db3 100644 --- a/schemas/appliance_v8.json +++ b/schemas/appliance_v8.json @@ -528,14 +528,6 @@ "type": "string", "title": "Command line parameters send to the kernel" }, - "kvm": { - "title": "KVM requirements", - "enum": [ - "require", - "allow", - "disable" - ] - }, "options": { "type": "string", "title": "Optional additional qemu command line options" @@ -580,8 +572,7 @@ "adapters", "ram", "platform", - "console_type", - "kvm" + "console_type" ] } }, From 5dd5f079f017debe1b88e7b8493a9b1adf59348f Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 16 Aug 2023 00:30:48 +1000 Subject: [PATCH 8/9] Update appliance_v8.json to be more strict --- schemas/appliance_v8.json | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/schemas/appliance_v8.json b/schemas/appliance_v8.json index c66c6db3..4fb0db7b 100644 --- a/schemas/appliance_v8.json +++ b/schemas/appliance_v8.json @@ -14,6 +14,7 @@ "docker_properties": { "type": "object", "title": "Docker template properties", + "additionalProperties": false, "properties": { "name": { "type": "string", @@ -83,13 +84,13 @@ } }, "required": [ - "adapters", "image" ] }, "iou_properties": { "type": "object", "title": "IOU template properties", + "additionalProperties": false, "properties": { "name": { "type": "string", @@ -131,14 +132,7 @@ "type": "string", "title": "Config loaded at startup" } - }, - "required": [ - "ethernet_adapters", - "serial_adapters", - "nvram", - "ram", - "startup_config" - ] + } }, "dynamips_slot": { "enum": [ @@ -181,6 +175,7 @@ "dynamips_properties": { "type": "object", "title": "Dynamips template properties", + "additionalProperties": false, "properties": { "name": { "type": "string", @@ -305,9 +300,7 @@ } }, "required": [ - "platform", - "ram", - "nvram" + "platform" ] }, "qemu_disk_interfaces": { @@ -325,6 +318,7 @@ "qemu_properties": { "type": "object", "title": "Qemu template properties", + "additionalProperties": false, "properties": { "name": { "type": "string", @@ -566,14 +560,7 @@ "null" ] } - }, - "required": [ - "adapter_type", - "adapters", - "ram", - "platform", - "console_type" - ] + } } }, "properties": { @@ -686,9 +673,9 @@ "type": "boolean", "title": "Whether these are the default settings" }, - "inherit_default_settings": { + "inherit_default_properties": { "type": "boolean", - "title": "Whether the default settings should be used", + "title": "Whether the default properties should be used", "default": "true" }, "template_type": { @@ -905,6 +892,7 @@ "registry_version", "status", "maintainer", - "maintainer_email" + "maintainer_email", + "settings" ] } From 8c59fd8d1f7cb5da48d35c1b22931bc6970d7575 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 16 Aug 2023 12:26:29 +1000 Subject: [PATCH 9/9] Update README.md to explain appliance version 8 format --- README.md | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 202 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 118b1eac..f1ec9568 100644 --- a/README.md +++ b/README.md @@ -40,15 +40,208 @@ the file and can be use as documentation for each field. GNS3 checks the schema version, if the schema of an appliance is not supported it shows the error "Please update GNS3 in order to install this appliance". -| Schema | min. GNS3 version | Additions | -| :-: | :-----: | --------- | -| 2 | 1.4.0 | | -| 3 | 1.5.0 | docker | -| 4 | 2.0.0 | availability
qemu/cpus
qemu/hd?_disk_interface: sata
versions/images/bios_image | -| 5 | 2.1.0 | qemu/console_type: spice | -| 6 | 2.2.0 | qemu/custom_adapters
qemu/console_type: spice+agent
all/console_type: none| -| 7 | 2.2.36 | qemu/tpm | -| 8 | 2.2.41 | qemu/uefi | +| Schema | min. GNS3 version | Additions | +| :-: |:-----------------:|------------------------------------------------------------------------------------------| +| 2 | 1.4.0 | | +| 3 | 1.5.0 | docker | +| 4 | 2.0.0 | availability
qemu/cpus
qemu/hd?_disk_interface: sata
versions/images/bios_image | +| 5 | 2.1.0 | qemu/console_type: spice | +| 6 | 2.2.0 | qemu/custom_adapters
qemu/console_type: spice+agent
all/console_type: none | +| 7 | 2.2.36 | qemu/tpm | +| 8 | 2.2.43 | See below | + +### Schema version 8 + +Schema version 8 is introduced many changes in the appliance schema. The most important changes are: + +* Support for `uefi_boot_mode` property in Qemu template properties. +* Possibility to have multiple set of settings to use with different image versions. Default settings are specified if + +1. a `default` field set to `true` exists +2. there is only one set present. + +**Notes** + +A `template_type` field must be added to tell GNS3 what template to create (qemu, iou, dynamips or docker), mixing different template types is not supported at the moment. +All template specific properties are defined in a `template_properties` field. + +**Example** + +```json +"settings": [ + { + "default": true, + "template_type": "qemu", + "template_properties": { + "platform": "x86_64", + "adapter_type": "e1000", + "adapters": 1, + "ram": 1024, + "console_type": "vnc" + } + }, + { + "name": "i386 settings", + "template_type": "qemu", + "template_properties": { + "platform": "i386", + "adapters": 8 + } + }, + { + "name": "ARM settings", + "template_type": "qemu", + "template_properties": { + "platform": "arm", + "ram": 512 + } + } +], +"versions": [ + { + "name": "1.0", + "images": { + "hda_disk_image": "disk1.qcow2" + } + }, + { + "name": "2.0", + "settings": "i386 settings", + "images": { + "hda_disk_image": "disk2.qcow2" + } + }, + { + "name": "3.0", + "settings": "ARM settings", + "images": { + "hda_disk_image": "disk3.qcow2" + } + }, +] +``` + +* The default settings are inherited by other settings set, this can be blocked by setting `inherit_default_properties` to `false` +* The controller template default is used if a template property is not defined or inherited from the default settings. +* The `md5sum` field is renamed `checksum`. The `md5sum` field is still accepted for easier migration from previous format versions. +* New optional `checksum_type` field for future development. The default and only checksum type remains MD5 for now. +* New optional `default_username` and `default_password` fields at the appliance and version levels. +* New optional `installation_instructions` field at the appliance and version levels to give download/unpack instructions to some appliances. +* New optional `compression_target` field to be used along with the compression field in future development. +* The `idlepc` field in versions section is moved to the `template_properties` for the `dynamips` template type +* The `first_port_name`, `port_name_format`, `port_segment_size` and `linked_clone` fields are moved to the `template_properties` for the qemu template type (these fields are only valid for Qemu templates). +* The `arch` field for qemu has been renamed `platform` to match the template properties on the controller side. +* The `kvm` field has been dropped and no longer required. Installing an appliance shouldn't take into account the available servers and their capabilities (e.g. capable of running kvm etc.) +* The `category`, `usage` and `symbol` fields can be defined in any `template_properties`. Defaults are at the appliance level or version level (they will be injected in `template_properties` if there aren't already defined there). +* The appliance version installed will be injected in the `version` field of the template (only controller version >= v3.0) +* Add `name` and `default_name_format` fields to all template properties. +* Add `console_resolution`, `extra_hosts` and `extra_volumes` to Docker template properties. +* Allow `spice+agent` in `console_type` for Qemu template properties. + +**Full example** + +```json +{ + "appliance_id": "709c2a9b-5dc3-4362-b147-fb848a0df963", + "name": "My appliance", + "category": "router", + "description": "This is my new appliance", + "vendor_name": "Cisco", + "vendor_url": "http://www.cisco.com/", + "documentation_url": "https://www.cisco.com/c/en/us/support/routing/xxx", + "product_name": "Appliance product xxx", + "product_url": "https://www.cisco.com/c/en/us/products/xxx/index.html", + "registry_version":8, + "status": "experimental", + "maintainer": "GNS3 Team", + "maintainer_email": "developers@gns3.net", + "installation_instructions": "This is how to install this appliance", + "usage": "This is how to use my appliance", + "symbol": "router.svg", + "default_username": "cisco", + "default_password": "admin", + "settings": [ + { + "name": "Default template settings", + "default": true, + "template_type": "qemu", + "template_properties": + { + "symbol": "multilayer_router.svg", + "first_port_name": "ethernet0", + "port_name_format": "ethernet{port1}", + "adapter_type": "e1000", + "adapters": 2, + "ram": 4096, + "cpus": 1, + "hda_disk_interface": "scsi", + "platform": "x86_64", + "console_type": "vnc", + "boot_priority": "cd", + "options": "" + } + }, + { + "name": "Custom settings for version 7.10.2", + "template_type": "qemu", + "inherit_default_properties": false, + "template_properties": + { + "adapters": 4, + "ram": 8192, + "cpus": 1 + } + } + ], + "images": [ + { + "filename": "file.iso", + "version": "7.10.2", + "checksum": "ef8712e655fcbc92dc1a1551ee2e4a80", + "checksum_type": "md5", + "filesize": 1287245824, + "download_url": "https://software.cisco.com/download/home/286307342/type/286307754/release/7.10.2" + }, + { + "filename": "file2.iso", + "version": "6.10.4", + "checksum": "68232f77da8f78cdc9aa6f3266a4d4c0", + "filesize": 3949459594, + "download_url": "https://software.cisco.com/download/home/286307342/type/286307754/release/6.10.4" + }, + { + "filename": "empty100G.qcow2", + "version": "1.0", + "md5sum": "1e6409a4523ada212dea2ebc50e50a65", + "filesize": 198656, + "download_url": "https://sourceforge.net/projects/gns-3/files/Empty%20Qemu%20disk/", + "direct_download_url": "https://sourceforge.net/projects/gns-3/files/Empty%20Qemu%20disk/empty100G.qcow2/download" + } + ], + "versions": [ + { + "name": "7.10.2", + "settings": "Custom settings for version 7.10.2", + "images": { + "hda_disk_image": "empty100G.qcow2", + "cdrom_image": "file.iso" + } + }, + { + "name": "6.10.4", + "default_username": "admin123", + "default_password": "admin123", + "installation_instructions": "This is how to install this version", + "usage": "This is how to use this version", + "symbol": "ethernet_switch.svg", + "images": { + "hda_disk_image": "empty100G.qcow2", + "cdrom_image": "file2.iso" + } + } + ] +} +``` Adding a new symbol -------------------