gns3-server 3.0.0rc1__py3-none-any.whl → 3.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gns3-server might be problematic. Click here for more details.

Files changed (89) hide show
  1. {gns3_server-3.0.0rc1.dist-info → gns3_server-3.0.1.dist-info}/METADATA +20 -19
  2. {gns3_server-3.0.0rc1.dist-info → gns3_server-3.0.1.dist-info}/RECORD +89 -79
  3. {gns3_server-3.0.0rc1.dist-info → gns3_server-3.0.1.dist-info}/WHEEL +1 -1
  4. gns3server/api/routes/compute/cloud_nodes.py +1 -1
  5. gns3server/api/routes/compute/docker_nodes.py +3 -0
  6. gns3server/api/routes/compute/nat_nodes.py +1 -1
  7. gns3server/api/routes/compute/vmware_nodes.py +1 -1
  8. gns3server/api/routes/compute/vpcs_nodes.py +10 -4
  9. gns3server/api/routes/controller/projects.py +29 -3
  10. gns3server/api/routes/controller/users.py +2 -2
  11. gns3server/api/routes/index.py +3 -3
  12. gns3server/api/server.py +38 -3
  13. gns3server/appliances/almalinux.gns3a +6 -6
  14. gns3server/appliances/arista-veos.gns3a +20 -514
  15. gns3server/appliances/cisco-7200.gns3a +26 -0
  16. gns3server/appliances/cisco-asav.gns3a +14 -1
  17. gns3server/appliances/cisco-csr1000v.gns3a +28 -2
  18. gns3server/appliances/cisco-iou-l2.gns3a +16 -4
  19. gns3server/appliances/cisco-iou-l3.gns3a +16 -4
  20. gns3server/appliances/cisco-vWLC.gns3a +29 -1
  21. gns3server/appliances/fortigate.gns3a +3 -3
  22. gns3server/appliances/hbcd-pe.gns3a +62 -0
  23. gns3server/appliances/innovaphone-app.gns3a +50 -0
  24. gns3server/appliances/innovaphone-ipva.gns3a +78 -0
  25. gns3server/appliances/mikrotik-chr.gns3a +30 -99
  26. gns3server/appliances/nixos.gns3a +52 -0
  27. gns3server/appliances/opnsense.gns3a +13 -0
  28. gns3server/appliances/pfsense.gns3a +14 -0
  29. gns3server/appliances/reactos.gns3a +10 -10
  30. gns3server/appliances/truenas.gns3a +104 -0
  31. gns3server/appliances/ubuntu-cloud.gns3a +35 -20
  32. gns3server/appliances/ubuntu-gui.gns3a +13 -0
  33. gns3server/appliances/viptela-edge-genericx86-64.gns3a +28 -2
  34. gns3server/appliances/viptela-smart-genericx86-64.gns3a +27 -1
  35. gns3server/appliances/viptela-vmanage-genericx86-64.gns3a +32 -4
  36. gns3server/appliances/vyos.gns3a +95 -98
  37. gns3server/compute/base_node.py +1 -0
  38. gns3server/compute/docker/docker_vm.py +56 -2
  39. gns3server/compute/docker/resources/init.sh +5 -2
  40. gns3server/compute/dynamips/__init__.py +0 -4
  41. gns3server/compute/dynamips/nodes/router.py +20 -0
  42. gns3server/compute/iou/iou_vm.py +22 -12
  43. gns3server/compute/notification_manager.py +2 -2
  44. gns3server/compute/qemu/qemu_vm.py +0 -5
  45. gns3server/controller/__init__.py +35 -25
  46. gns3server/controller/appliance_manager.py +2 -4
  47. gns3server/controller/compute.py +1 -1
  48. gns3server/controller/export_project.py +18 -14
  49. gns3server/controller/import_project.py +21 -0
  50. gns3server/controller/node.py +10 -8
  51. gns3server/controller/notification.py +4 -4
  52. gns3server/controller/project.py +88 -5
  53. gns3server/controller/symbols.py +1 -1
  54. gns3server/controller/topology.py +1 -1
  55. gns3server/crash_report.py +1 -1
  56. gns3server/db/models/templates.py +1 -0
  57. gns3server/db/repositories/pools.py +1 -1
  58. gns3server/db/tasks.py +1 -1
  59. gns3server/db_migrations/versions/9a5292aa4389_add_mac_address_field_in_docker_.py +27 -0
  60. gns3server/disks/empty100G.qcow2 +0 -0
  61. gns3server/disks/empty200G.qcow2 +0 -0
  62. gns3server/disks/empty30G.qcow2 +0 -0
  63. gns3server/disks/empty8G.qcow2 +0 -0
  64. gns3server/schemas/compute/docker_nodes.py +1 -0
  65. gns3server/schemas/compute/ethernet_switch_nodes.py +1 -1
  66. gns3server/schemas/config.py +1 -1
  67. gns3server/schemas/controller/templates/cloud_templates.py +2 -2
  68. gns3server/schemas/controller/templates/docker_templates.py +4 -3
  69. gns3server/schemas/controller/templates/dynamips_templates.py +5 -5
  70. gns3server/schemas/controller/templates/ethernet_hub_templates.py +1 -1
  71. gns3server/schemas/controller/templates/ethernet_switch_templates.py +2 -2
  72. gns3server/schemas/controller/templates/iou_templates.py +2 -2
  73. gns3server/schemas/controller/templates/qemu_templates.py +12 -12
  74. gns3server/schemas/controller/templates/virtualbox_templates.py +4 -5
  75. gns3server/schemas/controller/templates/vmware_templates.py +4 -4
  76. gns3server/schemas/controller/templates/vpcs_templates.py +2 -2
  77. gns3server/static/favicon.ico +0 -0
  78. gns3server/static/redoc.standalone.js +1782 -0
  79. gns3server/static/swagger-ui-bundle.js +2 -0
  80. gns3server/static/swagger-ui.css +3 -0
  81. gns3server/static/web-ui/index.html +1 -1
  82. gns3server/static/web-ui/{main.4185a8e61824af0d.js → main.e55eeff5c0ba1cf4.js} +1 -1
  83. gns3server/utils/__init__.py +12 -0
  84. gns3server/utils/asyncio/aiozipstream.py +15 -11
  85. gns3server/utils/images.py +45 -35
  86. gns3server/version.py +2 -2
  87. {gns3_server-3.0.0rc1.dist-info → gns3_server-3.0.1.dist-info}/LICENSE +0 -0
  88. {gns3_server-3.0.0rc1.dist-info → gns3_server-3.0.1.dist-info}/entry_points.txt +0 -0
  89. {gns3_server-3.0.0rc1.dist-info → gns3_server-3.0.1.dist-info}/top_level.txt +0 -0
@@ -1,181 +1,178 @@
1
1
  {
2
2
  "appliance_id": "f82b74c4-0f30-456f-a582-63daca528502",
3
- "name": "VyOS",
3
+ "name": "VyOS Universal Router",
4
4
  "category": "router",
5
- "description": "VyOS is a community fork of Vyatta, a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality.",
6
- "vendor_name": "Linux",
7
- "vendor_url": "https://vyos.net/",
5
+ "description": "VyOS is an open-source network operating system that provides a comprehensive suite of features for routing, firewalling, and VPN functionality. VyOS offers a robust and flexible solution for both small-scale and large-scale network environments. It is designed to support enterprise-grade networking with the added benefits of community-driven development and continuous updates.\n\nThe VyOS Universal Router, when used in GNS3, brings the power and versatility of VyOS to network simulation and emulation. GNS3 users can deploy the VyOS Universal Router to create and test complex network topologies in a virtual environment. This appliance provides a rich set of features, including dynamic routing protocols, stateful firewall capabilities, various VPNs, as well as high availability configurations.\n\nThe seamless integration with GNS3 allows network engineers and architects to validate network designs, perform testing and troubleshooting, and enhance their skill sets in a controlled, risk-free environment.",
6
+ "vendor_name": "VyOS Inc.",
7
+ "vendor_url": "https://vyos.io/",
8
+ "vendor_logo_url": "https://raw.githubusercontent.com/GNS3/gns3-registry/master/vendor-logos/VyOS.png",
8
9
  "documentation_url": "https://docs.vyos.io/",
9
- "product_name": "VyOS",
10
- "product_url": "https://vyos.net/",
10
+ "product_name": "VyOS Universal Router",
11
+ "product_url": "https://vyos.io/vyos-universal-router",
11
12
  "registry_version": 4,
12
13
  "status": "stable",
13
- "maintainer": "GNS3 Team",
14
- "maintainer_email": "developers@gns3.net",
15
- "usage": "Default username/password is vyos/vyos.\n\nThe -KVM versions are ready to use, no installation is required.\nThe other images will start the router from the CDROM on initial boot. Login and then type \"install image\" and follow the instructions.",
14
+ "availability": "service-contract",
15
+ "maintainer": "VyOS Inc.",
16
+ "maintainer_email": "support@vyos.io",
17
+ "usage": "\nDefault credentials:\nUser: vyos\nPassword: vyos",
16
18
  "symbol": "vyos.svg",
17
19
  "port_name_format": "eth{0}",
18
20
  "qemu": {
19
- "adapter_type": "e1000",
20
- "adapters": 3,
21
- "ram": 512,
22
- "hda_disk_interface": "scsi",
21
+ "adapter_type": "virtio-net-pci",
22
+ "adapters": 10,
23
+ "ram": 2048,
24
+ "cpus": 4,
25
+ "hda_disk_interface": "virtio",
23
26
  "arch": "x86_64",
24
27
  "console_type": "telnet",
25
- "boot_priority": "cd",
26
- "kvm": "allow"
28
+ "boot_priority": "c",
29
+ "kvm": "require",
30
+ "on_close": "shutdown_signal"
27
31
  },
28
32
  "images": [
29
33
  {
30
- "filename": "vyos-1.3.2-amd64.iso",
34
+ "filename": "vyos-1.4.0-kvm-amd64.qcow2",
35
+ "version": "1.4.0",
36
+ "md5sum": "a130e446bc5bf87391981f183ee3694b",
37
+ "filesize": 468320256,
38
+ "download_url": "https://support.vyos.io/"
39
+ },
40
+ {
41
+ "filename": "vyos-1.3.7-qemu-amd64.qcow2",
42
+ "version": "1.3.7",
43
+ "md5sum": "f4663b1e2df115bfa5c7ec17584514d6",
44
+ "filesize": 359792640,
45
+ "download_url": "https://support.vyos.io/"
46
+ },
47
+ {
48
+ "filename": "vyos-1.3.2-10G-qemu.qcow2",
31
49
  "version": "1.3.2",
32
- "md5sum": "070743faac800f9e5197058a8b6b3ba1",
33
- "filesize": 334495744,
34
- "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-3-2-generic-iso-image"
50
+ "md5sum": "68ad3fb530213189ac9ed496d5fe7897",
51
+ "filesize": 326893568,
52
+ "download_url": "https://support.vyos.io/"
35
53
  },
36
54
  {
37
- "filename": "vyos-1.3.1-S1-amd64.iso",
55
+ "filename": "vyos-1.3.1-S1-10G-qemu.qcow2",
38
56
  "version": "1.3.1-S1",
39
- "md5sum": "781f345e8a4ab9eb9e075ce5c87c8817",
40
- "filesize": 351272960,
41
- "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-3-1-s1-generic-iso-image"
57
+ "md5sum": "d8ed9f82a983295b94b07f8e37c48ed0",
58
+ "filesize": 343801856,
59
+ "download_url": "https://support.vyos.io/"
42
60
  },
43
61
  {
44
- "filename": "vyos-1.3.1-amd64.iso",
62
+ "filename": "vyos-1.3.1-10G-qemu.qcow2",
45
63
  "version": "1.3.1",
46
- "md5sum": "b6f57bd0cf9b60cdafa337b08ba4f2bc",
47
- "filesize": 350224384,
48
- "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-3-1-generic-iso-image"
64
+ "md5sum": "482367c833990fb2b9350e3708d33dc9",
65
+ "filesize": 342556672,
66
+ "download_url": "https://support.vyos.io/"
49
67
  },
50
68
  {
51
- "filename": "vyos-1.3.0-amd64.iso",
69
+ "filename": "vyos-1.3.0-10G-qemu.qcow2",
52
70
  "version": "1.3.0",
53
- "md5sum": "2019bd9c5efa6194e2761de678d0073f",
54
- "filesize": 338690048,
55
- "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-3-0-generic-iso-image"
56
- },
57
- {
58
- "filename": "vyos-1.2.9-S1-amd64.iso",
59
- "version": "1.2.9-S1",
60
- "md5sum": "3fece6363f9766f862e26d292d0ed5a3",
61
- "filesize": 430964736,
62
- "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-2-9-s1-generic-iso-image",
63
- "direct_download_url": "https://legacy-lts-images.vyos.io/1.2.9-S1/vyos-1.2.9-S1-amd64.iso"
71
+ "md5sum": "086e95e992e9b4d014c5f154cd01a6e6",
72
+ "filesize": 330956800,
73
+ "download_url": "https://support.vyos.io/"
64
74
  },
65
75
  {
66
76
  "filename": "vyos-1.2.9-S1-10G-qemu.qcow2",
67
- "version": "1.2.9-S1-KVM",
77
+ "version": "1.2.9-S1",
68
78
  "md5sum": "0a70d78b80a3716d42487c02ef44f41f",
69
79
  "filesize": 426967040,
70
- "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-2-9-s1-for-kvm",
71
- "direct_download_url": "https://legacy-lts-images.vyos.io/1.2.9-S1/vyos-1.2.9-S1-10G-qemu.qcow2"
72
- },
73
- {
74
- "filename": "vyos-1.2.9-amd64.iso",
75
- "version": "1.2.9",
76
- "md5sum": "586be23b6256173e174c82d8f1f699a1",
77
- "filesize": 430964736,
78
- "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-2-9-generic-iso-image",
79
- "direct_download_url": "https://legacy-lts-images.vyos.io/1.2.9/vyos-1.2.9-amd64.iso"
80
+ "download_url": "https://support.vyos.io/"
80
81
  },
81
82
  {
82
- "filename": "vyos-1.2.9-10G-qemu.qcow2",
83
- "version": "1.2.9-KVM",
84
- "md5sum": "76871c7b248c32f75177c419128257ac",
85
- "filesize": 427360256,
86
- "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-2-9-10g-qemu-qcow2",
87
- "direct_download_url": "https://legacy-lts-images.vyos.io/1.2.9/vyos-1.2.9-10G-qemu.qcow2"
83
+ "filename": "vyos-1.2.8-10G-qemu.qcow2",
84
+ "version": "1.2.8",
85
+ "md5sum": "96c76f619d0f8ea11dc8a3a18ed67b98",
86
+ "filesize": 425852928,
87
+ "download_url": "https://support.vyos.io/"
88
88
  },
89
89
  {
90
- "filename": "vyos-1.2.8-amd64.iso",
91
- "version": "1.2.8",
92
- "md5sum": "0ad879db903efdbf1c39dc945e165931",
93
- "filesize": 429916160,
94
- "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-2-8-generic-iso-image"
90
+ "filename": "vyos-1.2.7-qemu.qcow2",
91
+ "version": "1.2.7",
92
+ "md5sum": "1be4674c970fcdd65067e504baea5d74",
93
+ "filesize": 424607744,
94
+ "download_url": "https://support.vyos.io/"
95
95
  },
96
96
  {
97
- "filename": "vyos-1.1.8-amd64.iso",
98
- "version": "1.1.8",
99
- "md5sum": "95a141d4b592b81c803cdf7e9b11d8ea",
100
- "filesize": 241172480,
101
- "direct_download_url": "https://legacy-lts-images.vyos.io/vyos-1.1.8-amd64.iso"
97
+ "filename": "vyos-1.2.6-qemu.qcow2",
98
+ "version": "1.2.6",
99
+ "md5sum": "d8010d79889ca0ba5cb2634665e548e3",
100
+ "filesize": 424607744,
101
+ "download_url": "https://support.vyos.io/"
102
102
  },
103
103
  {
104
- "filename": "empty8G.qcow2",
105
- "version": "1.0",
106
- "md5sum": "f1d2c25b6990f99bd05b433ab603bdb4",
107
- "filesize": 197120,
108
- "download_url": "https://sourceforge.net/projects/gns-3/files/Empty%20Qemu%20disk/",
109
- "direct_download_url": "https://sourceforge.net/projects/gns-3/files/Empty%20Qemu%20disk/empty8G.qcow2/download"
104
+ "filename": "vyos-1.2.5-amd64.qcow2",
105
+ "version": "1.2.5",
106
+ "md5sum": "110c22309ec480600446fd2fb4f27a0d",
107
+ "filesize": 411500544 ,
108
+ "download_url": "https://support.vyos.io/"
110
109
  }
111
110
  ],
112
111
  "versions": [
112
+ {
113
+ "name": "1.4.0",
114
+ "images": {
115
+ "hda_disk_image": "vyos-1.4.0-kvm-amd64.qcow2"
116
+ }
117
+ },
118
+ {
119
+ "name": "1.3.7",
120
+ "images": {
121
+ "hda_disk_image": "vyos-1.3.7-qemu-amd64.qcow2"
122
+ }
123
+ },
113
124
  {
114
125
  "name": "1.3.2",
115
126
  "images": {
116
- "hda_disk_image": "empty8G.qcow2",
117
- "cdrom_image": "vyos-1.3.2-amd64.iso"
127
+ "hda_disk_image": "vyos-1.3.2-10G-qemu.qcow2"
118
128
  }
119
129
  },
120
130
  {
121
131
  "name": "1.3.1-S1",
122
132
  "images": {
123
- "hda_disk_image": "empty8G.qcow2",
124
- "cdrom_image": "vyos-1.3.1-S1-amd64.iso"
133
+ "hda_disk_image": "vyos-1.3.1-S1-10G-qemu.qcow2"
125
134
  }
126
135
  },
127
136
  {
128
137
  "name": "1.3.1",
129
138
  "images": {
130
- "hda_disk_image": "empty8G.qcow2",
131
- "cdrom_image": "vyos-1.3.1-amd64.iso"
139
+ "hda_disk_image": "vyos-1.3.1-10G-qemu.qcow2"
132
140
  }
133
141
  },
134
142
  {
135
143
  "name": "1.3.0",
136
144
  "images": {
137
- "hda_disk_image": "empty8G.qcow2",
138
- "cdrom_image": "vyos-1.3.0-amd64.iso"
145
+ "hda_disk_image": "vyos-1.3.0-10G-qemu.qcow2"
139
146
  }
140
147
  },
141
148
  {
142
149
  "name": "1.2.9-S1",
143
- "images": {
144
- "hda_disk_image": "empty8G.qcow2",
145
- "cdrom_image": "vyos-1.2.9-S1-amd64.iso"
146
- }
147
- },
148
- {
149
- "name": "1.2.9-S1-KVM",
150
150
  "images": {
151
151
  "hda_disk_image": "vyos-1.2.9-S1-10G-qemu.qcow2"
152
152
  }
153
153
  },
154
154
  {
155
- "name": "1.2.9",
155
+ "name": "1.2.8",
156
156
  "images": {
157
- "hda_disk_image": "empty8G.qcow2",
158
- "cdrom_image": "vyos-1.2.9-amd64.iso"
157
+ "hda_disk_image": "vyos-1.2.8-10G-qemu.qcow2"
159
158
  }
160
159
  },
161
160
  {
162
- "name": "1.2.9-KVM",
161
+ "name": "1.2.7",
163
162
  "images": {
164
- "hda_disk_image": "vyos-1.2.9-10G-qemu.qcow2"
163
+ "hda_disk_image": "vyos-1.2.7-qemu.qcow2"
165
164
  }
166
165
  },
167
166
  {
168
- "name": "1.2.8",
167
+ "name": "1.2.6",
169
168
  "images": {
170
- "hda_disk_image": "empty8G.qcow2",
171
- "cdrom_image": "vyos-1.2.8-amd64.iso"
169
+ "hda_disk_image": "vyos-1.2.6-qemu.qcow2"
172
170
  }
173
171
  },
174
172
  {
175
- "name": "1.1.8",
173
+ "name": "1.2.5",
176
174
  "images": {
177
- "hda_disk_image": "empty8G.qcow2",
178
- "cdrom_image": "vyos-1.1.8-amd64.iso"
175
+ "hda_disk_image": "vyos-1.2.5-amd64.qcow2"
179
176
  }
180
177
  }
181
178
  ]
@@ -742,6 +742,7 @@ class BaseNode:
742
742
  path = shutil.which(self._manager.config.settings.Server.ubridge_path)
743
743
  return path
744
744
 
745
+ @locking
745
746
  async def _ubridge_send(self, command):
746
747
  """
747
748
  Sends a command to uBridge hypervisor.
@@ -34,6 +34,7 @@ from gns3server.utils.asyncio import wait_for_file_creation
34
34
  from gns3server.utils.asyncio import monitor_process
35
35
  from gns3server.utils.get_resource import get_resource
36
36
  from gns3server.utils.hostname import is_rfc1123_hostname_valid
37
+ from gns3server.utils import macaddress_to_int, int_to_macaddress
37
38
 
38
39
  from gns3server.compute.ubridge.ubridge_error import UbridgeError, UbridgeNamespaceError
39
40
  from ..base_node import BaseNode
@@ -78,6 +79,7 @@ class DockerVM(BaseNode):
78
79
  aux=None,
79
80
  start_command=None,
80
81
  adapters=None,
82
+ mac_address="",
81
83
  environment=None,
82
84
  console_type="telnet",
83
85
  aux_type="none",
@@ -130,6 +132,8 @@ class DockerVM(BaseNode):
130
132
  else:
131
133
  self.adapters = adapters
132
134
 
135
+ self.mac_address = mac_address
136
+
133
137
  log.debug(
134
138
  "{module}: {name} [{image}] initialized.".format(
135
139
  module=self.manager.module_name, name=self.name, image=self._image
@@ -145,6 +149,7 @@ class DockerVM(BaseNode):
145
149
  "project_id": self._project.id,
146
150
  "image": self._image,
147
151
  "adapters": self.adapters,
152
+ "mac_address": self.mac_address,
148
153
  "console": self.console,
149
154
  "console_type": self.console_type,
150
155
  "console_resolution": self.console_resolution,
@@ -190,6 +195,36 @@ class DockerVM(BaseNode):
190
195
  def ethernet_adapters(self):
191
196
  return self._ethernet_adapters
192
197
 
198
+ @property
199
+ def mac_address(self):
200
+ """
201
+ Returns the MAC address for this Docker container.
202
+
203
+ :returns: adapter type (string)
204
+ """
205
+
206
+ return self._mac_address
207
+
208
+ @mac_address.setter
209
+ def mac_address(self, mac_address):
210
+ """
211
+ Sets the MAC address for this Docker container.
212
+
213
+ :param mac_address: MAC address
214
+ """
215
+
216
+ if not mac_address:
217
+ # use the node UUID to generate a random MAC address
218
+ self._mac_address = "02:42:%s:%s:%s:00" % (self.id[2:4], self.id[4:6], self.id[6:8])
219
+ else:
220
+ self._mac_address = mac_address
221
+
222
+ log.info('Docker container "{name}" [{id}]: MAC address changed to {mac_addr}'.format(
223
+ name=self._name,
224
+ id=self._id,
225
+ mac_addr=self._mac_address)
226
+ )
227
+
193
228
  @property
194
229
  def start_command(self):
195
230
  return self._start_command
@@ -429,6 +464,7 @@ class DockerVM(BaseNode):
429
464
  "Mounts": self._mount_binds(image_infos),
430
465
  "Memory": self._memory * (1024 * 1024), # convert memory to bytes
431
466
  "NanoCpus": int(self._cpus * 1e9), # convert cpus to nano cpus
467
+ "UsernsMode": "host"
432
468
  },
433
469
  "Volumes": {},
434
470
  "Env": ["container=docker"], # Systemd compliant: https://github.com/GNS3/gns3-server/issues/573
@@ -799,7 +835,10 @@ class DockerVM(BaseNode):
799
835
  """
800
836
 
801
837
  # resize the container TTY.
802
- await self._manager.query("POST", f"containers/{self._cid}/resize?h={rows}&w={columns}")
838
+ try:
839
+ await self._manager.query("POST", f"containers/{self._cid}/resize?h={rows}&w={columns}")
840
+ except DockerError as e:
841
+ log.warning(f"Could not resize the container TTY: {e}")
803
842
 
804
843
  async def _start_console(self):
805
844
  """
@@ -1058,7 +1097,20 @@ class DockerVM(BaseNode):
1058
1097
  adapter_number=adapter_number, hostif=adapter.host_ifc
1059
1098
  )
1060
1099
  )
1061
- log.debug("Move container %s adapter %s to namespace %s", self.name, adapter.host_ifc, self._namespace)
1100
+
1101
+ mac_address = int_to_macaddress(macaddress_to_int(self._mac_address) + adapter_number)
1102
+ custom_adapter = self._get_custom_adapter_settings(adapter_number)
1103
+ custom_mac_address = custom_adapter.get("mac_address")
1104
+ if custom_mac_address:
1105
+ mac_address = custom_mac_address
1106
+
1107
+ try:
1108
+ await self._ubridge_send('docker set_mac_addr {ifc} {mac}'.format(ifc=adapter.host_ifc, mac=mac_address))
1109
+ except UbridgeError:
1110
+ log.warning(f"Could not set MAC address {mac_address} on interface {adapter.host_ifc}")
1111
+
1112
+
1113
+ log.debug(f"Move container {self.name} adapter {adapter.host_ifc} to namespace {self._namespace}")
1062
1114
  try:
1063
1115
  await self._ubridge_send(
1064
1116
  "docker move_to_ns {ifc} {ns} eth{adapter}".format(
@@ -1067,6 +1119,8 @@ class DockerVM(BaseNode):
1067
1119
  )
1068
1120
  except UbridgeError as e:
1069
1121
  raise UbridgeNamespaceError(e)
1122
+ else:
1123
+ log.info(f"Created adapter {adapter_number} with MAC address {mac_address} in namespace {self._namespace}")
1070
1124
 
1071
1125
  if nio:
1072
1126
  await self._connect_nio(adapter_number, nio)
@@ -25,7 +25,10 @@ PATH=/gns3/bin:/tmp/gns3/bin:/sbin:$PATH
25
25
  # bootstrap busybox commands
26
26
  if [ ! -d /tmp/gns3/bin ]; then
27
27
  busybox mkdir -p /tmp/gns3/bin
28
- /gns3/bin/busybox --install -s /tmp/gns3/bin
28
+ for applet in `busybox --list`
29
+ do
30
+ ln -s /gns3/bin/busybox "/tmp/gns3/bin/$applet"
31
+ done
29
32
  fi
30
33
 
31
34
  # Restore file permission and mount volumes
@@ -75,7 +78,7 @@ ip link set dev lo up
75
78
  while true
76
79
  do
77
80
  grep $GNS3_MAX_ETHERNET /proc/net/dev > /dev/null && break
78
- sleep 0.5
81
+ usleep 500000 # wait 0.5 seconds
79
82
  done
80
83
 
81
84
  # activate eth interfaces
@@ -521,10 +521,6 @@ class Dynamips(BaseManager):
521
521
  if usage is not None and usage != vm.usage:
522
522
  vm.usage = usage
523
523
 
524
- aux_type = settings.get("aux_type")
525
- if aux_type is not None and aux_type != vm.aux_type:
526
- vm.aux_type = aux_type
527
-
528
524
  # update the configs if needed
529
525
  await self.set_vm_configs(vm, settings)
530
526
 
@@ -1030,6 +1030,26 @@ class Router(BaseNode):
1030
1030
  self.aux = aux
1031
1031
  await self._hypervisor.send(f'vm set_aux_tcp_port "{self._name}" {aux}')
1032
1032
 
1033
+ async def set_aux_type(self, aux_type):
1034
+ """
1035
+ Sets the aux type.
1036
+
1037
+ :param aux_type: auxiliary console type
1038
+ """
1039
+
1040
+ if self.aux_type != aux_type:
1041
+ status = await self.get_status()
1042
+ if status == "running":
1043
+ raise DynamipsError('"{name}" must be stopped to change the auxiliary console type to {aux_type}'.format(
1044
+ name=self._name,
1045
+ aux_type=aux_type)
1046
+ )
1047
+
1048
+ self.aux_type = aux_type
1049
+
1050
+ if self._aux and aux_type == "telnet":
1051
+ await self._hypervisor.send(f'vm set_aux_tcp_port "{self._name}" {self._aux}')
1052
+
1033
1053
  async def reset_console(self):
1034
1054
  """
1035
1055
  Reset console
@@ -436,14 +436,16 @@ class IOUVM(BaseNode):
436
436
  )
437
437
  )
438
438
 
439
- async def _check_iou_licence(self):
439
+ def _is_iou_license_check_enabled(self):
440
440
  """
441
- Checks for a valid IOU key in the iourc file (paranoid mode).
441
+ Returns if IOU license check is enabled.
442
+
443
+ :return: boolean
442
444
  """
443
445
 
444
446
  # license check is sent by the controller
445
447
  if self.license_check is False:
446
- return
448
+ return False
447
449
 
448
450
  try:
449
451
  # we allow license check to be disabled server wide
@@ -453,7 +455,14 @@ class IOUVM(BaseNode):
453
455
 
454
456
  if server_wide_license_check is False:
455
457
  log.warning("License check is explicitly disabled on this server")
456
- return
458
+ return False
459
+
460
+ return True
461
+
462
+ async def _check_iou_license(self):
463
+ """
464
+ Checks for a valid IOU key in the iourc file (paranoid mode).
465
+ """
457
466
 
458
467
  config = configparser.ConfigParser()
459
468
  try:
@@ -559,15 +568,16 @@ class IOUVM(BaseNode):
559
568
  except OSError as e:
560
569
  raise IOUError(f"Could not rename nvram files: {e}")
561
570
 
562
- iourc_path = self.iourc_path
563
- if not iourc_path:
564
- raise IOUError("Could not find an iourc file (IOU license), please configure an IOU license")
565
- if not os.path.isfile(iourc_path):
566
- raise IOUError(f"The iourc path '{iourc_path}' is not a regular file")
571
+ iourc_path = None
572
+ if self._is_iou_license_check_enabled():
573
+ iourc_path = self.iourc_path
574
+ if not iourc_path:
575
+ raise IOUError("Could not find an iourc file (IOU license), please configure an IOU license")
576
+ if not os.path.isfile(iourc_path):
577
+ raise IOUError(f"The iourc path '{iourc_path}' is not a regular file")
578
+ await self._check_iou_license()
567
579
 
568
- await self._check_iou_licence()
569
580
  await self._start_ubridge()
570
-
571
581
  self._create_netmap_config()
572
582
  if self.use_default_iou_values:
573
583
  # make sure we have the default nvram amount to correctly push the configs
@@ -579,7 +589,7 @@ class IOUVM(BaseNode):
579
589
 
580
590
  self._nvram_watcher = FileWatcher(self._nvram_file(), self._nvram_changed, delay=2)
581
591
 
582
- # created a environment variable pointing to the iourc file.
592
+ # created an environment variable pointing to the iourc file.
583
593
  env = os.environ.copy()
584
594
  if "IOURC" not in os.environ and iourc_path:
585
595
  env["IOURC"] = iourc_path
@@ -15,7 +15,7 @@
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
 
18
-
18
+ import asyncio
19
19
  from contextlib import contextmanager
20
20
  from gns3server.utils.notification_queue import NotificationQueue
21
21
 
@@ -54,7 +54,7 @@ class NotificationManager:
54
54
  """
55
55
 
56
56
  for listener in self._listeners:
57
- listener.put_nowait((action, event, kwargs))
57
+ asyncio.get_running_loop().call_soon_threadsafe(listener.put_nowait, (action, event, kwargs))
58
58
 
59
59
  @staticmethod
60
60
  def reset():
@@ -2157,11 +2157,6 @@ class QemuVM(BaseNode):
2157
2157
  continue
2158
2158
 
2159
2159
  interface = getattr(self, f"hd{drive}_disk_interface")
2160
- # fail-safe: use "ide" if there is a disk image and no interface type has been explicitly configured
2161
- if interface == "none":
2162
- interface = "ide"
2163
- setattr(self, f"hd{drive}_disk_interface", interface)
2164
-
2165
2160
  disk_name = f"hd{drive}"
2166
2161
  if not os.path.isfile(disk_image) or not os.path.exists(disk_image):
2167
2162
  if os.path.islink(disk_image):