Skip to content

Commit 1a63590

Browse files
authored
Merge pull request #781 from GNS3/appliance-format-v8
New appliance format version 8
2 parents d055733 + 9bbf608 commit 1a63590

File tree

4 files changed

+1102
-10
lines changed

4 files changed

+1102
-10
lines changed

README.md

+202-8
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,208 @@ the file and can be use as documentation for each field.
4040

4141
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".
4242

43-
| Schema | min. GNS3 version | Additions |
44-
| :-: | :-----: | --------- |
45-
| 2 | 1.4.0 | |
46-
| 3 | 1.5.0 | docker |
47-
| 4 | 2.0.0 | availability<br>qemu/cpus<br>qemu/hd?_disk_interface: sata<br>versions/images/bios_image |
48-
| 5 | 2.1.0 | qemu/console_type: spice |
49-
| 6 | 2.2.0 | qemu/custom_adapters<br>qemu/console_type: spice+agent<br>all/console_type: none|
50-
| 7 | 2.2.36 | qemu/tpm |
43+
| Schema | min. GNS3 version | Additions |
44+
| :-: |:-----------------:|------------------------------------------------------------------------------------------|
45+
| 2 | 1.4.0 | |
46+
| 3 | 1.5.0 | docker |
47+
| 4 | 2.0.0 | availability<br>qemu/cpus<br>qemu/hd?_disk_interface: sata<br>versions/images/bios_image |
48+
| 5 | 2.1.0 | qemu/console_type: spice |
49+
| 6 | 2.2.0 | qemu/custom_adapters<br>qemu/console_type: spice+agent<br>all/console_type: none |
50+
| 7 | 2.2.36 | qemu/tpm |
51+
| 8 | 2.2.43 | See below |
52+
53+
### Schema version 8
54+
55+
Schema version 8 is introduced many changes in the appliance schema. The most important changes are:
56+
57+
* Support for `uefi_boot_mode` property in Qemu template properties.
58+
* Possibility to have multiple set of settings to use with different image versions. Default settings are specified if
59+
60+
1. a `default` field set to `true` exists
61+
2. there is only one set present.
62+
63+
**Notes**
64+
65+
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.
66+
All template specific properties are defined in a `template_properties` field.
67+
68+
**Example**
69+
70+
```json
71+
"settings": [
72+
{
73+
"default": true,
74+
"template_type": "qemu",
75+
"template_properties": {
76+
"platform": "x86_64",
77+
"adapter_type": "e1000",
78+
"adapters": 1,
79+
"ram": 1024,
80+
"console_type": "vnc"
81+
}
82+
},
83+
{
84+
"name": "i386 settings",
85+
"template_type": "qemu",
86+
"template_properties": {
87+
"platform": "i386",
88+
"adapters": 8
89+
}
90+
},
91+
{
92+
"name": "ARM settings",
93+
"template_type": "qemu",
94+
"template_properties": {
95+
"platform": "arm",
96+
"ram": 512
97+
}
98+
}
99+
],
100+
"versions": [
101+
{
102+
"name": "1.0",
103+
"images": {
104+
"hda_disk_image": "disk1.qcow2"
105+
}
106+
},
107+
{
108+
"name": "2.0",
109+
"settings": "i386 settings",
110+
"images": {
111+
"hda_disk_image": "disk2.qcow2"
112+
}
113+
},
114+
{
115+
"name": "3.0",
116+
"settings": "ARM settings",
117+
"images": {
118+
"hda_disk_image": "disk3.qcow2"
119+
}
120+
},
121+
]
122+
```
123+
124+
* The default settings are inherited by other settings set, this can be blocked by setting `inherit_default_properties` to `false`
125+
* The controller template default is used if a template property is not defined or inherited from the default settings.
126+
* The `md5sum` field is renamed `checksum`. The `md5sum` field is still accepted for easier migration from previous format versions.
127+
* New optional `checksum_type` field for future development. The default and only checksum type remains MD5 for now.
128+
* New optional `default_username` and `default_password` fields at the appliance and version levels.
129+
* New optional `installation_instructions` field at the appliance and version levels to give download/unpack instructions to some appliances.
130+
* New optional `compression_target` field to be used along with the compression field in future development.
131+
* The `idlepc` field in versions section is moved to the `template_properties` for the `dynamips` template type
132+
* 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).
133+
* The `arch` field for qemu has been renamed `platform` to match the template properties on the controller side.
134+
* 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.)
135+
* 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).
136+
* The appliance version installed will be injected in the `version` field of the template (only controller version >= v3.0)
137+
* Add `name` and `default_name_format` fields to all template properties.
138+
* Add `console_resolution`, `extra_hosts` and `extra_volumes` to Docker template properties.
139+
* Allow `spice+agent` in `console_type` for Qemu template properties.
140+
141+
**Full example**
142+
143+
```json
144+
{
145+
"appliance_id": "709c2a9b-5dc3-4362-b147-fb848a0df963",
146+
"name": "My appliance",
147+
"category": "router",
148+
"description": "This is my new appliance",
149+
"vendor_name": "Cisco",
150+
"vendor_url": "http://www.cisco.com/",
151+
"documentation_url": "https://www.cisco.com/c/en/us/support/routing/xxx",
152+
"product_name": "Appliance product xxx",
153+
"product_url": "https://www.cisco.com/c/en/us/products/xxx/index.html",
154+
"registry_version":8,
155+
"status": "experimental",
156+
"maintainer": "GNS3 Team",
157+
"maintainer_email": "[email protected]",
158+
"installation_instructions": "This is how to install this appliance",
159+
"usage": "This is how to use my appliance",
160+
"symbol": "router.svg",
161+
"default_username": "cisco",
162+
"default_password": "admin",
163+
"settings": [
164+
{
165+
"name": "Default template settings",
166+
"default": true,
167+
"template_type": "qemu",
168+
"template_properties":
169+
{
170+
"symbol": "multilayer_router.svg",
171+
"first_port_name": "ethernet0",
172+
"port_name_format": "ethernet{port1}",
173+
"adapter_type": "e1000",
174+
"adapters": 2,
175+
"ram": 4096,
176+
"cpus": 1,
177+
"hda_disk_interface": "scsi",
178+
"platform": "x86_64",
179+
"console_type": "vnc",
180+
"boot_priority": "cd",
181+
"options": ""
182+
}
183+
},
184+
{
185+
"name": "Custom settings for version 7.10.2",
186+
"template_type": "qemu",
187+
"inherit_default_properties": false,
188+
"template_properties":
189+
{
190+
"adapters": 4,
191+
"ram": 8192,
192+
"cpus": 1
193+
}
194+
}
195+
],
196+
"images": [
197+
{
198+
"filename": "file.iso",
199+
"version": "7.10.2",
200+
"checksum": "ef8712e655fcbc92dc1a1551ee2e4a80",
201+
"checksum_type": "md5",
202+
"filesize": 1287245824,
203+
"download_url": "https://software.cisco.com/download/home/286307342/type/286307754/release/7.10.2"
204+
},
205+
{
206+
"filename": "file2.iso",
207+
"version": "6.10.4",
208+
"checksum": "68232f77da8f78cdc9aa6f3266a4d4c0",
209+
"filesize": 3949459594,
210+
"download_url": "https://software.cisco.com/download/home/286307342/type/286307754/release/6.10.4"
211+
},
212+
{
213+
"filename": "empty100G.qcow2",
214+
"version": "1.0",
215+
"md5sum": "1e6409a4523ada212dea2ebc50e50a65",
216+
"filesize": 198656,
217+
"download_url": "https://sourceforge.net/projects/gns-3/files/Empty%20Qemu%20disk/",
218+
"direct_download_url": "https://sourceforge.net/projects/gns-3/files/Empty%20Qemu%20disk/empty100G.qcow2/download"
219+
}
220+
],
221+
"versions": [
222+
{
223+
"name": "7.10.2",
224+
"settings": "Custom settings for version 7.10.2",
225+
"images": {
226+
"hda_disk_image": "empty100G.qcow2",
227+
"cdrom_image": "file.iso"
228+
}
229+
},
230+
{
231+
"name": "6.10.4",
232+
"default_username": "admin123",
233+
"default_password": "admin123",
234+
"installation_instructions": "This is how to install this version",
235+
"usage": "This is how to use this version",
236+
"symbol": "ethernet_switch.svg",
237+
"images": {
238+
"hda_disk_image": "empty100G.qcow2",
239+
"cdrom_image": "file2.iso"
240+
}
241+
}
242+
]
243+
}
244+
```
51245

52246
Adding a new symbol
53247
-------------------

check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from picture import get_size
2626

2727
APPLIANCE_IDS = []
28-
SCHEMA_VERSIONS = [4, 5, 6, 7]
28+
SCHEMA_VERSIONS = [4, 5, 6, 7, 8]
2929

3030
warnings = 0
3131

schemas/appliance_v7.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"title": "An optional product url on vendor website"
6363
},
6464
"registry_version": {
65-
"enum": [1, 2, 3, 4, 5, 6],
65+
"enum": [1, 2, 3, 4, 5, 6, 7],
6666
"title": "Version of the registry compatible with this appliance"
6767
},
6868
"status": {

0 commit comments

Comments
 (0)