Compare commits

...
127 Commits
Author SHA1 Message Date
grossmj 3915918c41 Release v3.0.6 2026-01-28 22:30:36 +08:00
grossmj a72980b2d9 Sync appliances 2026-01-28 22:24:10 +08:00
grossmj 600d3d38da Fix creating Qemu disk image. Fixes #2542 2026-01-28 19:36:22 +08:00
grossmj 7f45cc6f47 Disable checking for available disk space. Ref #2548 2026-01-28 18:32:42 +08:00
grossmj abaeab6242 Upgrade greenlet and sqlalchemy dependencies 2026-01-26 19:50:42 +08:00
grossmj 1d45df6613 Upgrade dependencies 2026-01-24 21:38:58 +08:00
grossmj 69a695c9e6 Merge branch '2.2' into 3.0
# Conflicts:
#	dev-requirements.txt
#	gns3server/appliances/infix.gns3a
#	gns3server/crash_report.py
#	gns3server/run.py
#	gns3server/utils/asyncio/__init__.py
#	gns3server/version.py
#	requirements.txt
#	setup.py
2026-01-24 19:27:39 +08:00
grossmj 7b20314edb Delete random_query.py 2026-01-24 19:17:55 +08:00
grossmj 193f470eaf Upgrade dependencies 2026-01-24 19:12:58 +08:00
grossmj 4335fd7ce0 Drop Python 3.8 support 2026-01-24 18:51:44 +08:00
grossmj ef2cf277c1 Development on 2.2.57.dev1 2026-01-24 16:53:43 +08:00
grossmj 27fbe37375 Release v2.2.56 2026-01-21 22:15:12 +08:00
grossmj 7b3fd4450e Sync appliances 2026-01-17 18:37:41 +08:00
grossmj 58d1e8f0c5 Set default location of udhcpc in "/etc/network/udhcpc". Fixes #2582 2026-01-17 18:01:42 +08:00
grossmj 8ce690ce78 Upgrade pywin32 to v311 2026-01-17 17:54:27 +08:00
grossmj c676a5bf82 Development on v2.2.56.dev1 2025-12-16 16:46:31 +08:00
grossmj 60c10e7ecc Merge remote-tracking branch 'origin/2.2' into 3.0
# Conflicts:
#	.github/workflows/testing.yml
#	CHANGELOG
#	README.md
#	gns3server/appliances/infix.gns3a
#	gns3server/compute/docker/__init__.py
#	gns3server/compute/docker/docker_vm.py
#	gns3server/crash_report.py
#	gns3server/version.py
#	gns3server/web/web_server.py
#	setup.py
#	tests/controller/test_project.py
2025-11-29 11:42:02 +10:00
grossmj 37f17209d3 Release v2.2.55 2025-11-19 12:13:56 +10:00
grossmj f24134a8f5 Sync appliances 2025-11-19 12:08:29 +10:00
Jeremy Grossmann 1f2036defd Merge pull request #2575 from GNS3/bugfix/2574
Handle Docker API version requirements
2025-11-17 22:31:41 +10:00
grossmj f2aaf5ab38 Docker API version requirements and process to handle older daemons 2025-11-17 22:26:18 +10:00
Jeremy Grossmann 32f48e555c Merge pull request #2573 from GNS3/bugfix/2541
Python 3.14 compatibility
2025-11-17 11:30:42 +10:00
grossmj 942f021b58 Fix test_config.py 2025-11-17 11:26:06 +10:00
Jeremy Grossmann 4dc321454e Merge pull request #2572 from GNS3/feature/name-of-container-in-docker
Set name of container in Docker
2025-11-17 11:13:47 +10:00
grossmj 3a24318694 Use docker_name property when creating a container 2025-11-17 11:11:11 +10:00
grossmj bae6221991 Set name of container in Docker 2025-11-17 10:59:05 +10:00
grossmj c67ba6da0d Fix config tests 2025-11-17 10:21:12 +10:00
grossmj 4d23ca221f Comment out some tests in test_project.py 2025-11-16 20:52:14 +10:00
grossmj 09eab9529a Fix syntax error in testing.yml 2025-11-16 19:32:19 +10:00
grossmj 3bb23708fc Support for Python 3.14 2025-11-16 19:30:45 +10:00
grossmj 672b3c052b Downgrade aiofiles version 2025-11-16 19:25:12 +10:00
grossmj bfe7b7a735 Upgrade dependencies 2025-11-16 19:16:38 +10:00
Jeremy Grossmann d269a4c125 Merge pull request #2570 from Mytic2330/3.0-patch3
Fixed Connection closed when exporting a running project
2025-11-04 04:07:01 +01:00
Jeremy Grossmann 8ada95b9fd Merge pull request #2569 from Mytic2330/3.0
Fix database pool error and non-ASCII character project export
2025-11-04 04:05:56 +01:00
Bine d5f360c176 Update projects.py 2025-10-18 19:28:15 +02:00
Bine e817228280 Fix non-ASCII characters in project names 2025-10-18 18:10:24 +02:00
BineandUfi 4a059be480 Increase DB engine pool size and max overflow
As described in #2568 when multiple clients connect simultaneously, an excessive number of database pool connections are created. This leads to resource exhaustion and connection management issues.

We have introduced the pool_size and max_overflow parameters to better control the database connection pool.
These parameters ensure the database can handle a sufficient number of concurrent connections without over-allocating resources.

Added pool_size and max_overflow arguments to the database initialization.

This change overrides the default initialization configuration where the temporary fix was applied.

Co-Authored-By: Ufi <86113085+ufiking@users.noreply.github.com>
2025-10-17 22:17:10 +02:00
Jeremy Grossmann 230866890e Merge pull request #2556 from GNS3/bugfix/2543
Enable ip cef in IOU L2 and IOU L3 base configs
2025-09-01 18:59:10 +02:00
grossmj 355cfb7571 Enable ip cef in IOU L2 and IOU L3 base configs 2025-09-01 18:55:36 +02:00
grossmj 8dddfe056e Merge branch 'master' into 2.2 2025-09-01 18:42:02 +02:00
Jeremy Grossmann 9c33827de3 Merge pull request #2555 from GNS3/update-gh-docker-build
Update docker-build.yml
2025-09-01 18:28:04 +02:00
grossmj a34fa53823 Update tags 2025-09-01 18:27:04 +02:00
grossmj 565a76ae27 Only build and push Docker image when releasing a new version 2025-09-01 18:23:52 +02:00
grossmj dc9c3b1c5d Fix pushing Docker image to Docker hub 2025-09-01 18:17:52 +02:00
grossmj a394fb71dc Update method to login to ghcr.io 2025-09-01 17:55:46 +02:00
grossmj 6cbf3baa1b Update docker-build.yml 2025-09-01 17:49:34 +02:00
grossmj 10322135e3 Upgrade sentry-sdk package 2025-08-30 21:51:20 +02:00
grossmj 12d1d04462 Update security issues again in README.md. Fixes #2535 2025-08-29 18:28:14 +02:00
grossmj 8b4c2f5e90 Update security issues in README.md. Fixes #2535 2025-08-29 18:25:57 +02:00
grossmj 1ed549fdb1 Upgrade requests dev dependency 2025-08-29 14:01:19 +02:00
grossmj 845cad35f0 Upgrade pydantic, fastapi & sqlalchemy dependencies 2025-08-29 13:55:00 +02:00
grossmj 31613630cf Update pyproject.toml to support LICENSE file 2025-06-09 22:24:23 +02:00
Jeremy Grossmann aaffc731ee Merge pull request #2538 from Nick1200000/enhancement/docker-build
Add automated Docker build and publish workflow
2025-06-09 22:14:11 +02:00
Nick1200000 5ce55aff02 Resolving the Error 2025-06-08 14:11:01 +05:30
Nick1200000 aa1c0bb557 Resolving the Errors 2025-06-08 13:38:35 +05:30
Nick1200000 25bc2dce57 Resolving the Errors 2025-06-08 13:30:49 +05:30
Nick1200000 7e35d164dc Resolving the Errors 2025-06-08 13:26:40 +05:30
Nick1200000 8666ffaff3 Resolving the Errors 2025-06-08 13:24:38 +05:30
Nick1200000 020f6a123d Docker build CI/CD pipeline 2025-06-07 18:16:47 +05:30
grossmj 232b9c2806 Fix tests 2025-05-25 17:35:45 +02:00
Jeremy Grossmann f260f6e2b4 Merge pull request #2531 from PsyBlade42/docker-vnc-name
use GNS3 node name as vnc Desktop name
2025-05-23 14:26:08 +02:00
Thomas Schmidt a7108e1592 use GNS3 node name as vnc Desktop name
Most VNC clients use the Desktop name in their window title.
Currently this defaults to user@host which means all docker vnc
connections have identical window names of e.g.
  SSVNC: gns3@gns3server

This uses the node name instead.
2025-05-22 13:13:47 +02:00
grossmj 975ca254fd Release v3.0.5 2025-05-14 19:11:44 +02:00
grossmj 89cf5ea8e7 Bundle web-ui v3.0.5 2025-05-14 19:06:42 +02:00
grossmj bfbe2bf885 Sync appliances 2025-05-14 18:55:51 +02:00
grossmj 5c036dfd90 Upgrade uvicorn and pydantic 2025-05-14 18:54:55 +02:00
grossmj 2fbfe5385a Use Ubuntu 24.04 LTS in Dockerfile. Ref #2523 2025-05-14 18:30:43 +02:00
grossmj 2cdaa1cd06 Fix tests 2025-05-14 17:19:18 +02:00
grossmj f2080979a1 Fix tests 2025-05-14 16:56:46 +02:00
grossmj df576f0668 Merge remote-tracking branch 'origin/2.2' into 3.0
# Conflicts:
#	gns3server/compute/qemu/qemu_vm.py
#	gns3server/schemas/template.py
2025-05-14 16:42:59 +02:00
grossmj c2c89b0ff3 Add missing 'nat' template type in schema. Fixes #2529 2025-05-13 20:52:44 +02:00
grossmj ef3570dc95 Merge branch 'master' into 2.2 2025-05-13 20:48:59 +02:00
grossmj 2bf3eff143 Remove debug message in tests 2025-05-13 20:47:38 +02:00
Jeremy Grossmann add8c4e8a2 Merge pull request #2526 from emmanuel-ferdman/master
Resolve deprecation warnings of regex library
2025-04-30 14:14:37 +07:00
Jeremy Grossmann 53eac771d6 Merge pull request #2528 from tobiasstein/fix-pci-bridges
Fix adding pci_bridges to qemu vms
2025-04-30 14:09:22 +07:00
grossmj 2b96e54629 Fix tests and require Qemu version >= 2.4 2025-04-30 13:38:52 +07:00
Tobias Stein cdf819f820 Fix adding pci_bridges to qemu vms
* Offset pci_device_id for network devices by 32 (formerly 4)
  to reserve first 32 IDs for non-netdev devices
  * This implies a new pci_bridge for the netdevs and
    the pci_device_ids starting at 0 (using modulo)
  * Fixes a bug in the creation of the qemu command
    when the number of qemu pcie devices (storage_controller, disks, …)
    was greater than 4 and the number of network devices
    saturated the 32 pcie ids of the root bridge
    causing qemu not to start.
2025-04-28 21:07:52 +02:00
Emmanuel Ferdman c05e6f4de4 Resolve deprecation warnings of regex library
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-04-26 00:15:16 -07:00
grossmj d9dcc2738d Merge remote-tracking branch 'origin/2.2' into 3.0
# Conflicts:
#	CHANGELOG
#	Dockerfile
#	README.md
#	gns3server/appliances/infix.gns3a
#	gns3server/compute/docker/docker_vm.py
#	gns3server/compute/qemu/qemu_vm.py
#	gns3server/controller/gns3vm/virtualbox_gns3_vm.py
#	gns3server/crash_report.py
#	gns3server/static/web-ui/index.html
#	gns3server/static/web-ui/main.9bcf455e62558dedfd48.js
#	gns3server/version.py
2025-04-21 20:13:31 +07:00
grossmj e32576d5ed Development on 2.2.55.dev1 2025-04-21 19:35:13 +07:00
Jeremy Grossmann bd3657d8f3 Merge pull request #2524 from GNS3/release/v2.2.54
Release v2.2.54
2025-04-21 19:30:57 +07:00
grossmj 4418d6bb2b Release v2.2.54 2025-04-21 17:15:22 +07:00
grossmj dbcafdd314 Merge branch 'master' into 2.2 2025-04-21 17:08:59 +07:00
grossmj 4dd1803a70 Bundle web-ui v2.2.54 2025-04-21 16:40:59 +07:00
grossmj 99272fb7e0 Sync appliances 2025-04-21 16:30:32 +07:00
grossmj a24d2e25ed Add new method to find the IP address of a VBox GNS3 VM + allow NAT Network 2025-04-21 16:29:32 +07:00
grossmj a5a663bc99 Remove OVMF_CODE_4M.secboot.fd and associated code 2025-04-18 17:31:31 +07:00
grossmj 2b7eb91694 Add edk2-stable202502 UEFI firmwares and try to first use firmwares from the ovmf package if installed. Fixes #2494 2025-04-18 17:13:29 +07:00
grossmj 684770a220 Prettify TPM error message 2025-04-18 15:25:50 +07:00
grossmj f6546bf1de Fix bug in qemu_stdout message 2025-04-18 15:19:06 +07:00
grossmj 355b97398b Reduce matching error for TPM result 2025-04-18 15:13:41 +07:00
grossmj 6242a0be80 Try to detect swtpm and AppArmor issue. Ref https://github.com/GNS3/gns3-gui/issues/3725 2025-04-18 15:06:49 +07:00
grossmj 18413c923c Development on 2.2.54.dev1 2025-04-18 15:05:34 +07:00
grossmj ffd628902c Fix Docker logs decoding. Ref #2522 2025-04-18 13:58:56 +07:00
grossmj ca34053125 Add delay after starting a Docker container and adding connections in uBridge. Ref #2522 2025-04-18 13:50:20 +07:00
grossmj d06f93e772 Fix TypeError when reading Docker container logs. Ref #2522 2025-04-18 13:47:29 +07:00
grossmj 90cf73e434 Fix tests 2025-04-18 13:38:01 +07:00
grossmj aa8ccf4f82 Allow an image to be uploaded to the controller again even if it is already in the database 2025-04-17 19:07:22 +07:00
grossmj 0826b9c259 Fix controller not reporting an error if invalid options are passed to Qemu command line. Fixes #2517 2025-04-17 19:00:52 +07:00
grossmj 0e8d969cd2 Merge branch '2.2' into 3.0
# Conflicts:
#	gns3server/compute/docker/__init__.py
#	gns3server/compute/docker/docker_vm.py
#	requirements.txt
2025-04-16 17:53:44 +07:00
grossmj 0e89ff56a8 Replace "Docker hub" by "Docker repository" because it is possible to use different repositories 2025-04-16 17:42:40 +07:00
grossmj ffb5bc7ffd Upgrade aiohttp to v3.11.16 2025-04-16 17:09:09 +07:00
grossmj f00f21c4bd Upgrade dependencies 2025-04-16 17:08:08 +07:00
grossmj 773076c40e Fix unable to add NAT cloud after configuring “allowed_interfaces” in configuration file. Fixes #2508 2025-04-16 16:04:57 +07:00
grossmj 5019167098 Fix interface information API endpoint for Cloud/NAT devices 2025-04-16 15:26:56 +07:00
grossmj f525916195 Merge remote-tracking branch 'origin/3.0' into 3.0 2025-04-16 14:39:59 +07:00
grossmj 2ac3e0b39f Upgrade dependencies 2025-04-16 14:39:36 +07:00
Jeremy Grossmann e532c83538 Merge pull request #2518 from markparonyan/get-link-ifaces
Get iface/udp tunnel from links with Cloud,Nat
2025-03-23 20:10:23 +07:00
Mark Paronyan f21887dbab tests(get_iface): add unittests 2025-03-23 14:28:58 +00:00
Mark Paronyan bab173ee52 feat(get_iface): add type information in response 2025-03-23 14:28:27 +00:00
Mark Paronyan ea2856289a feat: add endpoint to get iface/udp tunnel from links with Cloud,Nat 2025-03-23 13:46:27 +00:00
grossmj 8e6f5d2b57 Merge branch '2.2' into 3.0
# Conflicts:
#	requirements.txt
2025-03-18 21:34:43 +07:00
grossmj 2e9127449c Upgrade Jinja2 to v3.1.6. Fixes #2515 2025-03-18 21:33:31 +07:00
grossmj ee9f974362 Fix packet capture for links connected to a cloud node. Fixes #2513 2025-03-16 21:12:33 +07:00
grossmj c9231d7b83 Upgrade dependencies 2025-03-16 20:26:26 +07:00
Jeremy Grossmann 483719568f Merge pull request #2511 from NAKNAO-nnct/feature/update-dockerfile-ubuntu-2404
Update Dockerfile base image to Ubuntu 24.04
2025-03-08 20:26:12 +07:00
NAKNAO-nnct 018598a300 refactor 2025-03-08 20:22:06 +09:00
NAKNAO-nnct e262a46cfd rm space 2025-03-08 20:19:37 +09:00
NAKNAO-nnct 00bf1c028b Update README to Run Docker Compose 2025-03-08 14:11:42 +09:00
NAKNAO-nnct 21ebb934f4 add compose.yaml 2025-03-08 14:08:42 +09:00
NAKNAO-nnct 2ecd2cfe3b update Ubuntu24.04 2025-03-08 13:59:05 +09:00
Jeremy Grossmann ce4b3091dd Merge pull request #2507 from GNS3/fix-remote-install-script
Improvements for remote-install.sh
2025-03-03 05:55:42 +07:00
grossmj f722816849 Improvements for remote-install.sh
* Use apt-add-repository to install repository
* Add option to not upgrade the system
* Check if Python version is >= 3.9 when installing from ppa-v3 repository
2025-03-02 22:27:53 +07:00
Jeremy Grossmann 4cb38b23eb Merge pull request #2506 from FedericoTorres233/patch-1
Check if remote-install.sh is being run as root
2025-03-02 16:14:33 +08:00
Federico Torres f3e46227d8 fix: check if remote-install.sh is being run as root 2025-03-01 16:56:21 -03:00
grossmj 3ba109c651 Development on 3.0.5.dev1 2025-02-25 22:39:38 +08:00
Jeremy Grossmann 185cd01e19 Merge pull request #2488 from GNS3/release/v2.2.53
Release v2.2.53
2025-01-21 09:47:43 +07:00
71 changed files with 1382 additions and 849 deletions

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
name: Build and Push Docker Image
on:
workflow_dispatch:
push:
tags:
- v2.*
- v3.*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push to GitHub Container Registry
run: |
docker build -t ghcr.io/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):latest .
docker push ghcr.io/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):latest
- name: Build and push to Docker Hub
run: |
docker build -t gns3/${{ github.event.repository.name }}:latest .
docker push gns3/${{ github.event.repository.name }}:latest
+1 -5
View File
@@ -18,11 +18,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
#include:
# only test with Python 3.10 on Windows
# - os: windows-latest
# python-version: "3.10"
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
+68
View File
@@ -1,5 +1,73 @@
# Change Log
## 3.0.6 28/01/2026
* Sync appliances
* Fix creating Qemu disk image. Fixes #2542
* Disable checking for available disk space. Ref #2548
* Set default location of udhcpc in "/etc/network/udhcpc". Fixes #2582
* Support for Python 3.14
* Fix non-ASCII characters in project names
* Increase DB engine pool size and max overflow
* Enable ip cef in IOU L2 and IOU L3 base configs
## 2.2.56 21/01/2026
* Set default location of udhcpc in "/etc/network/udhcpc". Fixes #2582
* Upgrade pywin32 to v311
## 2.2.55 19/11/2025
* Docker API version requirements and process to handle older daemons
* Use docker_name property when creating a container
* Set name of container in Docker
* Support for Python 3.14
* Enable ip cef in IOU L2 and IOU L3 base configs
* Only build and push Docker image when releasing a new version
* Fix pushing Docker image to Docker hub
* Update security issues in README.md. Fixes #2535
* Add missing 'nat' template type in schema. Fixes #2529
* Resolve deprecation warnings of regex library
## 3.0.5 14/05/2025
* Bundle web-ui v3.0.5
* Sync appliances
* Use Ubuntu 24.04 LTS in Dockerfile. Ref #2523
* Fix tests and require Qemu version >= 2.4
* Fix adding pci_bridges to qemu vms
* Resolve deprecation warnings of regex library
* Remove OVMF_CODE_4M.secboot.fd and associated code
* Add edk2-stable202502 UEFI firmwares and try to first use firmwares from the ovmf package if installed. Fixes #2494
* Prettify TPM error message
* Fix bug in qemu_stdout message
* Try to detect swtpm and AppArmor issue. Ref https://github.com/GNS3/gns3-gui/issues/3725
* Fix Docker logs decoding. Ref #2522
* Add delay after starting a Docker container and adding connections in uBridge. Ref #2522
* Fix TypeError when reading Docker container logs. Ref #2522
* Allow an image to be uploaded to the controller again even if it is already in the database
* Fix controller not reporting an error if invalid options are passed to Qemu command line. Fixes #2517
* Replace "Docker hub" by "Docker repository" because it is possible to use different repositories
* Fix unable to add NAT cloud after configuring “allowed_interfaces” in configuration file. Fixes #2508
* Fix interface information API endpoint for Cloud/NAT devices
* Upgrade Jinja2 to v3.1.6. Fixes #2515
* Fix packet capture for links connected to a cloud node. Fixes #2513
* fix: check if remote-install.sh is being run as root
## 2.2.54 21/04/2025
* Bundle web-ui v2.2.54
* Add new method to find the IP address of a VBox GNS3 VM + allow NAT Network
* Add edk2-stable202502 UEFI firmwares and try to first use firmwares from the ovmf package if installed. Fixes #2494
* Try to detect swtpm and AppArmor issue. Ref https://github.com/GNS3/gns3-gui/issues/3725
* Fix Docker logs decoding. Ref #2522
* Add delay after starting a Docker container and adding connections in uBridge. Ref #2522
* Fix TypeError when reading Docker container logs. Ref #2522
* Replace "Docker hub" by "Docker repository" because it is possible to use different repositories
* Upgrade dependencies
* Improvements for remote-install.sh
## 3.0.4 25/02/2025
* Require minimum 8 characters for passwords
+2 -2
View File
@@ -1,4 +1,4 @@
FROM ubuntu:focal
FROM ubuntu:noble
WORKDIR /gns3server
@@ -34,4 +34,4 @@ COPY . /gns3server
RUN mkdir -p ~/.config/GNS3/3.0/
RUN cp scripts/gns3_server.conf ~/.config/GNS3/3.0/
RUN python3 -m pip install .
RUN python3 -m pip install --break-system-packages .
+6
View File
@@ -99,6 +99,12 @@ Alternatively, you can run the GNS3 server in a container
bash scripts/docker_dev_server.sh
```
#### use Docker Compose
``` {.bash}
docker compose up -d
```
### Running tests
First, install the development dependencies:
+7
View File
@@ -0,0 +1,7 @@
services:
gen3-server:
build:
context: .
dockerfile: Dockerfile
ports:
- "8001:3080"
+6 -6
View File
@@ -1,7 +1,7 @@
pytest==8.3.4
flake8==7.1.1
pytest-timeout==2.3.1
pytest-asyncio==0.25.2
requests==2.32.3
pytest==8.4.2 # version 8.4.2 is the last one supporting Python 3.9
flake8==7.3.0
pytest-timeout==2.4.0
pytest-asyncio==0.26.0 # upgrading leads to stuck / failed tests
requests==2.32.5
httpx==0.28.1
httpx_ws==0.7.1
httpx_ws==0.7.1 # upgrading leads to failures in tests
+1 -1
View File
@@ -232,7 +232,7 @@ async def stop_cloud_capture(
await node.stop_capture(port_number)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/pcap")
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")
async def stream_pcap_file(
*,
adapter_number: int = Path(..., ge=0, le=0),
+7 -6
View File
@@ -96,7 +96,13 @@ async def create_qemu_image(
await Qemu.instance().create_disk_image(disk_image_path, options)
image_info = await read_image_info(disk_image_path, "qemu")
return await images_repo.add_image(**image_info)
image = await images_repo.get_image(disk_image_path)
if image:
# the image has already been added to the database
return image
else:
return await images_repo.add_image(**image_info)
@router.get(
"",
@@ -148,11 +154,6 @@ async def upload_image(
if os.path.commonprefix([base_images_directory, full_path]) != base_images_directory:
raise ControllerForbiddenError(f"Cannot write image, '{image_path}' is forbidden")
image = await images_repo.get_image(image_path)
if image:
log.warning(f"Image '{image_path}' already exists")
return image
try:
allow_raw_image = Config.instance().settings.Server.allow_raw_images
image = await write_image(image_path, full_path, request.stream(), images_repo, allow_raw_image=allow_raw_image)
+52 -1
View File
@@ -24,7 +24,7 @@ import aiohttp
from fastapi import APIRouter, Depends, Request, status
from fastapi.responses import StreamingResponse
from fastapi.encoders import jsonable_encoder
from typing import List
from typing import List, Union
from uuid import UUID
from gns3server.controller import Controller
@@ -285,3 +285,54 @@ async def stream_pcap(request: Request, link: Link = Depends(dep_link)) -> Strea
raise ControllerError(f"Client error received when receiving pcap stream from compute: {e}")
return StreamingResponse(compute_pcap_stream(), media_type="application/vnd.tcpdump.pcap")
@router.get(
"/{link_id}/iface",
response_model=Union[schemas.UDPPortInfo, schemas.EthernetPortInfo],
dependencies=[Depends(has_privilege("Link.Audit"))]
)
async def get_iface(link: Link = Depends(dep_link)) -> Union[schemas.UDPPortInfo, schemas.EthernetPortInfo]:
"""
Return iface info for links to Cloud or NAT devices.
Required privilege: Link.Audit
"""
ifaces_info = {}
for node_data in link._nodes:
node = node_data["node"]
if node.node_type not in ("cloud", "nat"):
continue
port_number = node_data["port_number"]
compute = node.compute
project_id = link.project.id
response = await compute.get(f"/projects/{project_id}/{node.node_type}/nodes/{node.id}")
if "ports_mapping" not in response.json:
continue
ports_mapping = response.json["ports_mapping"]
for port in ports_mapping:
port_num = port.get("port_number")
if port_num and int(port_num) == int(port_number):
port_type = port.get("type", "")
if "udp" in port_type.lower():
ifaces_info = {
"node_id": node.id,
"type": f"{port_type}",
"lport": port["lport"],
"rhost": port["rhost"],
"rport": port["rport"]
}
else:
ifaces_info = {
"node_id": node.id,
"type": f"{port_type}",
"interface": port["interface"],
}
if not ifaces_info:
raise ControllerError("Link not connected to Cloud/NAT")
return ifaces_info
+10 -1
View File
@@ -330,6 +330,9 @@ async def export_project(
Required privilege: Project.Audit
"""
if project.is_running():
raise ControllerError("Project must be stopped in order to export it")
compression_query = compression.lower()
if compression_query == "zip":
compression = zipfile.ZIP_DEFLATED
@@ -380,7 +383,13 @@ async def export_project(
except (ValueError, OSError, RuntimeError) as e:
raise ConnectionError(f"Cannot export project: {e}")
headers = {"CONTENT-DISPOSITION": f'attachment; filename="{project.name}.gns3project"'}
fallback = project.name.encode("ascii", "ignore").decode() or "project"
encoded = urllib.parse.quote(project.name, safe="")
headers = {
"Content-Disposition": (
f'attachment; filename="{fallback}.gns3project"; filename*=UTF-8\'\'{encoded}.gns3project'
)
}
return StreamingResponse(streamer(), media_type="application/gns3project", headers=headers)
+30
View File
@@ -25,6 +25,14 @@
"options": "-cpu host -nographic"
},
"images": [
{
"filename": "AlmaLinux-9-GenericCloud-9.4-20240805.x86_64.qcow2",
"version": "9.4",
"md5sum": "7c5040c044a989c524d40824cebb4a4d",
"filesize": 591724544,
"download_url": "https://vault.almalinux.org/9.4/cloud/x86_64/images/",
"direct_download_url": "https://vault.almalinux.org/9.4/cloud/x86_64/images/AlmaLinux-9-GenericCloud-9.4-20240805.x86_64.qcow2"
},
{
"filename": "AlmaLinux-9-GenericCloud-9.2-20230513.x86_64.qcow2",
"version": "9.2",
@@ -33,6 +41,14 @@
"download_url": "https://vault.almalinux.org/9.2/cloud/x86_64/images/",
"direct_download_url": "https://vault.almalinux.org/9.2/cloud/x86_64/images/AlmaLinux-9-GenericCloud-9.2-20230513.x86_64.qcow2"
},
{
"filename": "AlmaLinux-8-GenericCloud-8.9-20231128.x86_64.qcow2",
"version": "8.9",
"md5sum": "1afc48c798960f0c6ebb65428c0ea973",
"filesize": 697434112,
"download_url": "https://vault.almalinux.org/8.9/cloud/x86_64/images/",
"direct_download_url": "https://vault.almalinux.org/8.9/cloud/x86_64/images/AlmaLinux-8-GenericCloud-8.9-20231128.x86_64.qcow2"
},
{
"filename": "AlmaLinux-8-GenericCloud-8.8-20230524.x86_64.qcow2",
"version": "8.8",
@@ -59,6 +75,13 @@
}
],
"versions": [
{
"name": "9.4",
"images": {
"hda_disk_image": "AlmaLinux-9-GenericCloud-9.4-20240805.x86_64.qcow2",
"cdrom_image": "almalinux-cloud-init-data.iso"
}
},
{
"name": "9.2",
"images": {
@@ -66,6 +89,13 @@
"cdrom_image": "almalinux-cloud-init-data.iso"
}
},
{
"name": "8.9",
"images": {
"hda_disk_image": "AlmaLinux-8-GenericCloud-8.9-20231128.x86_64.qcow2",
"cdrom_image": "almalinux-cloud-init-data.iso"
}
},
{
"name": "8.8",
"images": {
+15 -15
View File
@@ -29,23 +29,23 @@
},
"images": [
{
"filename": "vEOS-lab-4.33.1F.qcow2",
"version": "4.33.1F",
"md5sum": "8f662409c0732ed9f682edce63601e8a",
"filesize": 611909632,
"filename": "vEOS64-lab-4.33.2F.qcow2",
"version": "4.33.2F",
"md5sum": "fbe629a8342cd0b3b19566b9d7ef4f4f",
"filesize": 610992128,
"download_url": "https://www.arista.com/en/support/software-download"
},
{
"filename": "vEOS-lab-4.32.3M.qcow2",
"version": "4.32.3M",
"md5sum": "46fc46f5ed1da8752eed8396f08862f8",
"filesize": 605683712,
"filename": "vEOS64-lab-4.32.4.1M.qcow2",
"version": "4.32.4.1M",
"md5sum": "cd369b5ccfd87ccd83a34538681ba35f",
"filesize": 605159424,
"download_url": "https://www.arista.com/en/support/software-download"
},
{
"filename": "vEOS-lab-4.31.6M.qcow2",
"filename": "vEOS64-lab-4.31.6M.qcow2",
"version": "4.31.6M",
"md5sum": "7410110b77472f058322ec4681f8a356",
"md5sum": "02fbd929de9416e1096cd2454507d6ce",
"filesize": 590479360,
"download_url": "https://www.arista.com/en/support/software-download"
},
@@ -59,24 +59,24 @@
],
"versions": [
{
"name": "4.33.1F",
"name": "4.33.2F",
"images": {
"hda_disk_image": "Aboot-veos-serial-8.0.2.iso",
"hdb_disk_image": "vEOS-lab-4.33.1F.qcow2"
"hdb_disk_image": "vEOS64-lab-4.33.2F.qcow2"
}
},
{
"name": "4.32.3M",
"name": "4.32.4.1M",
"images": {
"hda_disk_image": "Aboot-veos-serial-8.0.2.iso",
"hdb_disk_image": "vEOS-lab-4.32.3M.qcow2"
"hdb_disk_image": "vEOS64-lab-4.32.4.1M.qcow2"
}
},
{
"name": "4.31.6M",
"images": {
"hda_disk_image": "Aboot-veos-serial-8.0.2.iso",
"hdb_disk_image": "vEOS-lab-4.31.6M.qcow2"
"hdb_disk_image": "vEOS64-lab-4.31.6M.qcow2"
}
}
]
@@ -32,6 +32,27 @@
"process_priority": "normal"
},
"images": [
{
"filename": "arubaoscx-disk-image-genericx86-p4-20241115202521.vmdk",
"version": "10.15.0005",
"md5sum": "69b3675391c04c1a6e0fd0bf8d8bc2d9",
"filesize": 420049408,
"download_url": "https://networkingsupport.hpe.com"
},
{
"filename": "arubaoscx-disk-image-genericx86-p4-20240731173624.vmdk",
"version": "10.14.1000",
"md5sum": "01d6932fbc9c46180a4f41aee9e98301",
"filesize": 412140544,
"download_url": "https://networkingsupport.hpe.com"
},
{
"filename": "arubaoscx-disk-image-genericx86-p4-20240528190307.vmdk",
"version": "10.14.0001",
"md5sum": "83902dbaa74c37cdda3f066f79431933",
"filesize": 401023488,
"download_url": "https://networkingsupport.hpe.com"
},
{
"filename": "arubaoscx-disk-image-genericx86-p4-20240129204649.vmdk",
"version": "10.13.1000",
@@ -139,6 +160,24 @@
}
],
"versions": [
{
"name": "10.15.0005",
"images": {
"hda_disk_image": "arubaoscx-disk-image-genericx86-p4-20241115202521.vmdk"
}
},
{
"name": "10.14.1000",
"images": {
"hda_disk_image": "arubaoscx-disk-image-genericx86-p4-20240731173624.vmdk"
}
},
{
"name": "10.14.0001",
"images": {
"hda_disk_image": "arubaoscx-disk-image-genericx86-p4-20240528190307.vmdk"
}
},
{
"name": "10.13.1000",
"images": {
@@ -0,0 +1,33 @@
{
"appliance_id": "4aa78f74-c769-43e0-9ef1-5dd2cf1909c6",
"name": "Asterfusion AsterNOS-VPP",
"category": "router",
"description": "AsterNOS-VPP leverages SONiC’s robust routing features and management capability with VPP’s high-performance data forwarding. It supports L3 routing, NAT, PPPoE, and VPN services. Minimum requirements: 4 vCPUs and 4GB RAM.",
"vendor_name": "Asterfusion",
"vendor_url": "https://cloudswit.ch/product/sonic-enterprise-distribution/#vAsterNOS",
"documentation_url": "https://docs.asternos.com/routing",
"product_name": "AsterNOS-VPP",
"registry_version": 6,
"status": "stable",
"maintainer": "Asterfusion Product Team",
"maintainer_email": "bd@cloudswit.ch",
"images": [
{
"filename": "AsterNOS-VPP_V6.1-R0101P02_x86.img.gz",
"version": "V6.1",
"md5sum": "55834c3e8849ab226144d79ef76acf81",
"filesize": 1318201015,
"download_url": "https://asternos.dev/api/file/b2c9fd83-a9d3-46f3-9676-6b49dd481d6c",
"comments": "Registration is required to download the image."
}
],
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": 4,
"ram": 4096,
"cpus": 4,
"arch": "x86_64",
"console_type": "telnet",
"kvm": "require"
}
}
@@ -0,0 +1,50 @@
{
"appliance_id": "9e934470-d898-4289-a5ed-50af094e629e",
"name": "Asterfusion vAsterNOS campus",
"category": "multilayer_switch",
"description": "AsterNOS is the core technology of Asterfusion’s one-stop SONiC turnkey solution designed for cloud, enterprise, and AI-driven scenarios. AsterNOS v5.2 Campus is specifically designed for traditional campus networks, offering comprehensive L2/L3 capabilities suitable for various campus scenarios such as schools, office buildings, and hospitals. This version supports a fully cloud-integrated Layer 3 network architecture, providing rich routing and switching functionalities to ensure high-performance operation and ease of maintenance. It can also be deployed in the GNS3 simulation environment to experience a complete All-Layer 3 Cloud-Campus network. This version is ideal for enterprises and campus networks requiring high-performance multi-service transport, supporting cross-domain connectivity and providing nanosecond-level time synchronization. It is well-suited for applications with stringent time accuracy requirements, such as financial trading, industrial automation, and smart manufacturing. NOTICE: This appliance file is a virtualized version of AsterNOS and is intended to be used only to experience the basic functionality and industry standard CLI (Klish), not for official software testing. For more information about AsterNOS commercial version, please feel free to contact us via Email: bd@cloudswit.ch",
"vendor_name": "Asterfusion",
"vendor_url": "https://cloudswit.ch/",
"vendor_logo_url": "https://raw.githubusercontent.com/GNS3/gns3-registry/master/vendor-logos/asterfusion.png",
"documentation_url": "https://help.cloudswit.ch/portal/en/kb/articles/vasternos",
"product_name": "vAsterNOS",
"product_url": "https://cloudswit.ch/",
"registry_version": 4,
"status": "experimental",
"maintainer": "Asterfusion",
"maintainer_email": "bd@cloudswit.ch",
"usage": "The login is admin and the password is asteros",
"symbol": "asterfusion-vAsterNOS.svg",
"first_port_name": "eth0",
"port_name_format": "Ethernet{0}",
"qemu": {
"adapter_type": "e1000",
"adapters": 10,
"ram": 4096,
"cpus": 4,
"hda_disk_interface": "virtio",
"arch": "x86_64",
"console_type": "telnet",
"boot_priority": "d",
"kvm": "require"
},
"images": [
{
"filename": "vAsterNOS-V5.2R012P01.img",
"version": "5.2-12-1",
"md5sum": "d18c0cfd786607ccc6dc1069a8f40465",
"filesize": 2823290880,
"download_url": "https://drive.cloudswitch.io/external/d29f6d0a6c8322fea42b3c08e95113d026b8ec6aafbe29193c338333077f3da7"
}
],
"versions": [
{
"name": "5.2-12-1",
"images": {
"hda_disk_image": "vAsterNOS-V5.2R012P01.img"
}
}
]
}
@@ -6,14 +6,14 @@
"vendor_name": "Asterfusion",
"vendor_url": "https://cloudswit.ch/",
"vendor_logo_url": "https://raw.githubusercontent.com/GNS3/gns3-registry/master/vendor-logos/asterfusion.png",
"documentation_url": "https://help.cloudswit.ch/portal/en/kb/articles/vasternos",
"documentation_url": "https://asternos.com/community/space/vasternos/post/vasternos-for-data-center-network",
"product_name": "vAsterNOS",
"product_url": "https://cloudswit.ch/product/sonic-enterprise-distribution",
"registry_version": 4,
"status": "experimental",
"maintainer": "Asterfusion",
"maintainer_email": "bd@cloudswit.ch",
"usage": "The login is admin, passwd asteros",
"usage": "The login is admin and the password is asteros",
"symbol": "asterfusion-vAsterNOS.svg",
"first_port_name": "eth0",
"port_name_format": "Ethernet{0}",
@@ -30,18 +30,18 @@
},
"images": [
{
"filename": "vAsterNOS-V3.1.img",
"filename": "AsterNOS_V3.1_R0408P01-VS.img.gz",
"version": "V3.1",
"md5sum": "c323c9c3f60e1a93eca2acdc5034b85c",
"filesize": 2724659200,
"download_url": "https://drive.cloudswitch.io/external/8ae2e3932ad8bb2ec30dd25be415d288ff3e4a949c557c6bd48ac6e6265bcfc1"
"md5sum": "5c182306af67be2c79a5642551412e48",
"filesize": 1425945924,
"download_url": "http://pub.asternos.com/AsterNOS_V3.1_R0408P01-VS.img.gz"
}
],
"versions": [
{
"name": "V3.1",
"images": {
"hda_disk_image": "vAsterNOS-V3.1.img"
"hda_disk_image": "AsterNOS_V3.1_R0408P01-VS.img.gz"
}
}
]
+24 -54
View File
@@ -27,44 +27,28 @@
},
"images": [
{
"filename": "CentOS-Stream-GenericCloud-9-20230704.1.x86_64.qcow2",
"version": "Stream-9 (20230704.1)",
"md5sum": "e04511e019325a97837edd9eafe02b48",
"filesize": 1087868416,
"filename": "CentOS-Stream-GenericCloud-x86_64-10-20250331.0.x86_64.qcow2",
"version": "Stream-10 (20250331.0)",
"md5sum": "776033371ca346001dd6390f0cbaf0d0",
"filesize": 952041472,
"download_url": "https://cloud.centos.org/centos/10-stream/x86_64/images",
"direct_download_url": "https://cloud.centos.org/centos/10-stream/x86_64/images/CentOS-Stream-GenericCloud-x86_64-10-20250331.0.x86_64.qcow2"
},
{
"filename": "CentOS-Stream-GenericCloud-9-20250331.0.x86_64.qcow2",
"version": "Stream-9 (20250331.0)",
"md5sum": "4aaeddc6ca497065522c75a7471f9bfd",
"filesize": 1250625536,
"download_url": "https://cloud.centos.org/centos/9-stream/x86_64/images",
"direct_download_url": "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20230704.1.x86_64.qcow2"
"direct_download_url": "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20250331.0.x86_64.qcow2"
},
{
"filename": "CentOS-Stream-GenericCloud-8-20230710.0.x86_64.qcow2",
"version": "Stream-8 (20230710.0)",
"md5sum": "83e02ce98c29753c86fb7be7d802aa75",
"filesize": 1676164096,
"filename": "CentOS-Stream-GenericCloud-8-20240603.0.x86_64.qcow2",
"version": "Stream-8 (20240603.0)",
"md5sum": "77f3c9650785b8e977209796e09ee33e",
"filesize": 2003698688,
"download_url": "https://cloud.centos.org/centos/8-stream/x86_64/images",
"direct_download_url": "https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20230710.0.x86_64.qcow2"
},
{
"filename": "CentOS-8-GenericCloud-8.4.2105-20210603.0.x86_64.qcow2",
"version": "8.4 (2105)",
"md5sum": "032eed270415526546eac07628905a62",
"filesize": 1309652992,
"download_url": "https://cloud.centos.org/centos/8/x86_64/images",
"direct_download_url": "https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-GenericCloud-8.4.2105-20210603.0.x86_64.qcow2"
},
{
"filename": "CentOS-7-x86_64-GenericCloud-2111.qcow2",
"version": "7 (2111)",
"md5sum": "730b8662695831670721c8245be61dac",
"filesize": 897384448,
"download_url": "https://cloud.centos.org/centos/7/images",
"direct_download_url": "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-2111.qcow2"
},
{
"filename": "CentOS-7-x86_64-GenericCloud-1809.qcow2",
"version": "7 (1809)",
"md5sum": "da79108d1324b27bd1759362b82fbe40",
"filesize": 914948096,
"download_url": "https://cloud.centos.org/centos/7/images",
"direct_download_url": "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1809.qcow2"
"direct_download_url": "https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20240603.0.x86_64.qcow2"
},
{
"filename": "centos-cloud-init-data.iso",
@@ -77,37 +61,23 @@
],
"versions": [
{
"name": "Stream-9 (20230704.1)",
"name": "Stream-10 (20250331.0)",
"images": {
"hda_disk_image": "CentOS-Stream-GenericCloud-9-20230704.1.x86_64.qcow2",
"hda_disk_image": "CentOS-Stream-GenericCloud-x86_64-10-20250331.0.x86_64.qcow2",
"cdrom_image": "centos-cloud-init-data.iso"
}
},
{
"name": "Stream-8 (20230710.0)",
"name": "Stream-9 (20250331.0)",
"images": {
"hda_disk_image": "CentOS-Stream-GenericCloud-8-20230710.0.x86_64.qcow2",
"hda_disk_image": "CentOS-Stream-GenericCloud-9-20250331.0.x86_64.qcow2",
"cdrom_image": "centos-cloud-init-data.iso"
}
},
{
"name": "8.4 (2105)",
"name": "Stream-8 (20240603.0)",
"images": {
"hda_disk_image": "CentOS-8-GenericCloud-8.4.2105-20210603.0.x86_64.qcow2",
"cdrom_image": "centos-cloud-init-data.iso"
}
},
{
"name": "7 (2111)",
"images": {
"hda_disk_image": "CentOS-7-x86_64-GenericCloud-2111.qcow2",
"cdrom_image": "centos-cloud-init-data.iso"
}
},
{
"name": "7 (1809)",
"images": {
"hda_disk_image": "CentOS-7-x86_64-GenericCloud-1809.qcow2",
"hda_disk_image": "CentOS-Stream-GenericCloud-8-20240603.0.x86_64.qcow2",
"cdrom_image": "centos-cloud-init-data.iso"
}
}
+13
View File
@@ -50,6 +50,12 @@
"version": "124-25G",
"md5sum": "9c7cc9b3f3b3571411a7f62faaa2c036",
"filesize": 71528984
},
{
"filename": "c7200-itpk9-mz.124-15.SW.image",
"version": "124-15.SW",
"md5sum": "3334a0facdbd26164e83d3c201fff5b5",
"filesize": 46423952
}
],
"versions": [
@@ -87,6 +93,13 @@
"images": {
"image": "c7200-a3jk9s-mz.124-25g.image"
}
},
{
"name": "124-15.SW",
"idlepc": "0x60b2bc68",
"images": {
"image": "c7200-itpk9-mz.124-15.SW.image"
}
}
]
}
+13
View File
@@ -30,6 +30,13 @@
"images": [
{
"filename": "EXOS-VM_32.7.2.19.qcow2",
"version": "32.7.2.19",
"md5sum": "eba580a2e18d2a9cc972c9ece8917ea8",
"filesize": 236847104,
"direct_download_url": "https://akamai-ep.extremenetworks.com/Extreme_P/github-en/Virtual_EXOS/EXOS-VM_32.7.2.19.qcow2"
},
{
"filename": "EXOS-VM_v32.6.3.126.qcow2",
"version": "32.6.3.126",
"md5sum": "5856b6c427bd605fe1c7adb6ee6b2659",
@@ -41,6 +48,12 @@
"versions": [
{
"name": "32.7.2.19",
"images": {
"hda_disk_image": "EXOS-VM_32.7.2.19.qcow2"
}
},
{
"name": "32.6.3.126",
"images": {
@@ -28,6 +28,13 @@
"options": "-nographic"
},
"images": [
{
"filename": "FEGNS3.9.3.0.0.qcow2",
"version": "v9.3.0.0",
"md5sum": "2abfa8d64219aa75522238f87b782726",
"filesize": 490209280,
"direct_download_url": "https://akamai-ep.extremenetworks.com/Extreme_P/github-en/Virtual_VOSS/FEGNS3.9.3.0.0.qcow2"
},
{
"filename": "VOSSGNS3.8.10.1.0.qcow2",
"version": "v8.10.1.0",
@@ -93,6 +100,13 @@
}
],
"versions": [
{
"name": "v9.3.0.0",
"images":
{
"hda_disk_image": "FEGNS3.9.3.0.0.qcow2"
}
},
{
"name": "v8.10.1.0",
"images":
+30
View File
@@ -26,6 +26,22 @@
"options": "-nographic"
},
"images": [
{
"filename": "Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2",
"version": "41-1.4",
"md5sum": "8efc9edc04f38775de72ce067166b2a1",
"filesize": 491716608,
"download_url": "https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images",
"direct_download_url": "https://fedora.mirrorservice.org/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2"
},
{
"filename": "Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2",
"version": "40-1.14",
"md5sum": "3eed4b1a9de35208ed30d9bb72c1522d",
"filesize": 397475840,
"download_url": "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images",
"direct_download_url": "https://fedora.mirrorservice.org/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2"
},
{
"filename": "Fedora-Cloud-Base-39-1.5.x86_64.qcow2",
"version": "39-1.5",
@@ -52,6 +68,20 @@
}
],
"versions": [
{
"name": "41-1.4",
"images": {
"hda_disk_image": "Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2",
"cdrom_image": "fedora-cloud-init-data.iso"
}
},
{
"name": "40-1.14",
"images": {
"hda_disk_image": "Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2",
"cdrom_image": "fedora-cloud-init-data.iso"
}
},
{
"name": "39-1.5",
"images": {
+8 -8
View File
@@ -25,19 +25,19 @@
},
"images": [
{
"filename": "rtr.qcow2",
"version": "20.7.1",
"md5sum": "4707415d15d20ced92423d90e52eedcd",
"filesize": 254767616,
"download_url": "http://freerouter.nop.hu/",
"direct_download_url": "http://dl.nop.hu/rtr.qcow2"
"filename": "rtr-x86_64.qcow2",
"version": "25.8.29",
"md5sum": "13d72fdfd772258808a9d4b75fa67083",
"filesize": 73269248,
"download_url": "http://www.freertr.org/",
"direct_download_url": "http://dl.nop.hu/rtr-x86_64.qcow2"
}
],
"versions": [
{
"name": "20.7.1",
"name": "25.8.29",
"images": {
"hda_disk_image": "rtr.qcow2"
"hda_disk_image": "rtr-x86_64.qcow2"
}
}
]
+121 -8
View File
@@ -2,13 +2,13 @@
"appliance_id": "4d351078-c6f5-444c-ab30-0ef20e3d8c53",
"name": "Infix",
"category": "router",
"description": "Infix is a Network Operating System based on Linux. It can be set up both as a switch, with offloading using switchdev, and a router with firewalling.",
"description": "Infix OS is a free Linux-based operating system with made-easy management using NETCONF, RESTCONF, or the built-in command line interface (CLI). It is suitable for both end-devices with a single Ethernet port and switches/routers with multiple ports. Immutable by design, extensions are possible using Docker containers.",
"vendor_name": "KernelKit",
"vendor_url": "https://github.com/kernelkit",
"vendor_logo_url": "https://kernelkit.org/assets/img/jack.png",
"product_name": "Infix",
"registry_version": 4,
"documentation_url": "https://github.com/kernelkit/infix/tree/main/doc",
"documentation_url": "https://kernelkit.org/infix/latest/",
"status": "stable",
"availability": "free",
"maintainer": "KernelKit",
@@ -37,26 +37,139 @@
"download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/",
"direct_download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/OVMF-edk2-stable202305.fd.zip/download",
"compression": "zip"
},
{
},
{
"filename": "infix-x86_64-disk-24.11.1.img",
"filesize": 536870912,
"md5sum": "673a123fe122d1c2f5724baf9965a19d",
"version": "24.11.1",
"download_url": "https://github.com/kernelkit/infix/releases/download/v24.11.1/infix-x86_64-24.11.1.tar.gz",
"compression": "gzip"
},
{
},
{
"filename": "infix-x86_64-disk-25.01.0.img",
"filesize": 536870912,
"md5sum": "a814d93b385116b4a35712c445b5f830",
"version": "25.01.0",
"download_url": "https://github.com/kernelkit/infix/releases/download/v25.01.0/infix-x86_64-25.01.0.tar.gz",
"compression": "gzip"
},
{
"filename": "infix-x86_64-disk-25.02.0.img",
"filesize": 536870912,
"md5sum": "8e29474c97df3486eb063a8af5043f50",
"version": "25.02.0",
"download_url": "https://github.com/kernelkit/infix/releases/download/v25.02.0/infix-x86_64-25.02.0.tar.gz",
"compression": "gzip"
},
{
"filename": "infix-x86_64-disk-25.03.0.img",
"filesize": 536870912,
"md5sum": "5e1ed1081cd1673bfed4a9b5b1c58e08",
"version": "25.03.0",
"download_url": "https://github.com/kernelkit/infix/releases/download/v25.03.0/infix-x86_64-25.03.0.tar.gz",
"compression": "gzip"
},
{
"filename": "infix-x86_64-disk-25.04.0.qcow2",
"filesize": 259723776,
"md5sum": "84bd999513325d0007d0e6587abc6140",
"version": "25.04.0",
"direct_download_url": "https://github.com/kernelkit/infix/releases/download/v25.04.0/infix-x86_64-disk-25.04.0.qcow2"
},
{
"filename": "infix-x86_64-disk-25.05.0.qcow2",
"filesize": 259958784,
"md5sum": "a6b1b3a6bccc60bb5214f2b864602fde",
"version": "25.05.0",
"direct_download_url": "https://github.com/kernelkit/infix/releases/download/v25.05.0/infix-x86_64-disk-25.05.0.qcow2"
},
{
"filename": "infix-x86_64-disk-25.08.0.qcow2",
"filesize": 284453888,
"md5sum": "5fbf146d2ac73d1bd8fa1c509d6169b1",
"version": "25.08.0",
"direct_download_url": "https://github.com/kernelkit/infix/releases/download/v25.08.0/infix-x86_64-disk-25.08.0.qcow2"
},
{
"filename": "infix-x86_64-disk-25.09.0.qcow2",
"filesize": 285120000,
"md5sum": "9761968406780a5b28311b8527f8629f",
"version": "25.09.0",
"direct_download_url": "https://github.com/kernelkit/infix/releases/download/v25.09.0/infix-x86_64-disk-25.09.0.qcow2"
},
{
"filename": "infix-x86_64-disk-25.10.0.qcow2",
"filesize": 288818688,
"md5sum": "781d0fce9fbf789f6ea6ff10dc104afb",
"version": "25.10.0",
"direct_download_url": "https://github.com/kernelkit/infix/releases/download/v25.10.0/infix-x86_64-disk-25.10.0.qcow2"
},
{
"filename": "infix-x86_64-disk-25.11.0.qcow2",
"filesize": 288930816,
"md5sum": "e2eb1a4fff9d56815f37c2e82a6279fb",
"version": "25.11.0",
"direct_download_url": "https://github.com/kernelkit/infix/releases/download/v25.11.0/infix-x86_64-disk-25.11.0.qcow2"
}
],
"versions": [
{
"name": "25.11.0",
"images": {
"bios_image": "OVMF-edk2-stable202305.fd",
"hda_disk_image": "infix-x86_64-disk-25.11.0.qcow2"
}
},
{
"name": "25.10.0",
"images": {
"bios_image": "OVMF-edk2-stable202305.fd",
"hda_disk_image": "infix-x86_64-disk-25.10.0.qcow2"
}
},
{
"name": "25.09.0",
"images": {
"bios_image": "OVMF-edk2-stable202305.fd",
"hda_disk_image": "infix-x86_64-disk-25.09.0.qcow2"
}
},
{
"name": "25.08.0",
"images": {
"bios_image": "OVMF-edk2-stable202305.fd",
"hda_disk_image": "infix-x86_64-disk-25.08.0.qcow2"
}
},
{
"name": "25.05.0",
"images": {
"bios_image": "OVMF-edk2-stable202305.fd",
"hda_disk_image": "infix-x86_64-disk-25.05.0.qcow2"
}
},
{
"name": "25.04.0",
"images": {
"bios_image": "OVMF-edk2-stable202305.fd",
"hda_disk_image": "infix-x86_64-disk-25.04.0.qcow2"
}
},
{
"name": "25.03.0",
"images": {
"bios_image": "OVMF-edk2-stable202305.fd",
"hda_disk_image": "infix-x86_64-disk-25.03.0.img"
}
},
{
"name": "25.02.0",
"images": {
"bios_image": "OVMF-edk2-stable202305.fd",
"hda_disk_image": "infix-x86_64-disk-25.02.0.img"
}
},
{
"name": "25.01.0",
"images": {
@@ -72,4 +185,4 @@
}
}
]
}
}
@@ -0,0 +1,75 @@
{
"appliance_id": "12394e0d-9ac5-4da5-8e91-94a462536b61",
"name": "vJunos-router",
"category": "router",
"description": "vJunos-router",
"vendor_name": "Juniper",
"vendor_url": "https://www.juniper.net",
"documentation_url": "https://www.juniper.net/documentation/product/us/en/vjunos-router/",
"product_name": "vJunos Router",
"registry_version": 6,
"status": "stable",
"availability": "free",
"maintainer": "AAm-kun",
"maintainer_email": "github@sugarpapa.mozmail.com",
"usage": "GNS3 SHOULD be a baremetal installation. Using the GNS3 VM MIGHT result in unwanted issues. Default user is root. No password is needed.",
"symbol": "juniper-vmx.svg",
"first_port_name": "ge-0/0/0",
"port_name_format": "ge-0/0/{port0}",
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": 17,
"ram": 5120,
"cpus": 4,
"hda_disk_interface": "virtio",
"arch": "x86_64",
"console_type": "telnet",
"kvm": "require",
"options": "-serial mon:stdio -nographic -smbios type=1,product=VM-VMX,family=lab -cpu host",
"on_close": "power_off"
},
"images": [
{
"filename": "vJunos-router-24.2R1-S2.qcow2",
"version": "24.2R1-S2",
"md5sum": "dd906b4d19463e22f3e1a297ff1a7464",
"filesize": 3675783168,
"download_url": "https://support.juniper.net/support/downloads/?p=vjunos-router"
},
{
"filename": "vJunos-router-23.4R2-S2.1.qcow2",
"version": "23.4R2-S2.1",
"md5sum": "e25f5acdfc6c076d0023fd8289bcdd89",
"filesize": 3644063744,
"download_url": "https://support.juniper.net/support/downloads/?p=vjunos-router"
},
{
"filename": "vJunos-router-23.2R1.15.qcow2",
"version": "23.2R1.15",
"md5sum": "18670fb67633822697fdd3cf982e7eb1",
"filesize": 3653566464,
"download_url": "https://support.juniper.net/support/downloads/?p=vjunos-router"
}
],
"versions": [
{
"images": {
"hda_disk_image": "vJunos-router-24.2R1-S2.qcow2"
},
"name": "24.2R1-S2"
},
{
"images": {
"hda_disk_image": "vJunos-router-23.4R2-S2.1.qcow2"
},
"name": "23.4R2-S2.1"
},
{
"images": {
"hda_disk_image": "vJunos-router-23.2R1.15.qcow2"
},
"name": "23.2R1.15"
}
]
}
+13 -216
View File
@@ -11,237 +11,34 @@
"status": "stable",
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"usage": "Default password is toor\nEnable persistence by selecting boot option 'Live USB Persistence'",
"usage": "Default username is kali and the default password is kali",
"port_name_format": "eth{0}",
"qemu": {
"adapter_type": "e1000",
"adapters": 8,
"ram": 1024,
"ram": 2048,
"cpus": 2,
"hda_disk_interface": "ide",
"arch": "x86_64",
"console_type": "vnc",
"boot_priority": "d",
"kvm": "require"
},
"images": [
{
"filename": "kali-linux-2021.1-live-amd64.iso",
"version": "2021.1",
"md5sum": "3a3716fef866e5c29a1c1ccfc94264b5",
"filesize": 3591385088,
"download_url": "http://cdimage.kali.org/kali-2021.1/",
"direct_download_url": "http://cdimage.kali.org/kali-2021.1/kali-linux-2021.1-live-amd64.iso"
},
{
"filename": "kali-linux-2019.3-amd64.iso",
"version": "2019.3",
"md5sum": "9c6fb00558f78ed06992d89f745ef975",
"filesize": 3037736960,
"download_url": "http://old.kali.org/kali-images/kali-2019.3",
"direct_download_url": "http://old.kali.org/kali-images/kali-2019.3/kali-linux-2019.3-amd64.iso"
},
{
"filename": "kali-linux-2019.2-amd64.iso",
"version": "2019.2",
"md5sum": "0f89b6225d7ea9c18682f7cc541c1179",
"filesize": 3353227264,
"download_url": "http://old.kali.org/kali-images/kali-2019.2",
"direct_download_url": "http://old.kali.org/kali-images/kali-2019.2/kali-linux-2019.2-amd64.iso"
},
{
"filename": "kali-linux-mate-2019.2-amd64.iso",
"version": "2019.2 (MATE)",
"md5sum": "fec8dd7009f932c51a74323df965a709",
"filesize": 3313217536,
"download_url": "http://old.kali.org/kali-images/kali-2019.2",
"direct_download_url": "http://old.kali.org/kali-images/kali-2019.2/kali-linux-mate-2019.2-amd64.iso"
},
{
"filename": "kali-linux-2019.1a-amd64.iso",
"version": "2019.1a",
"md5sum": "58c6111ed0be1919ea87267e7e65ab0f",
"filesize": 3483873280,
"download_url": "http://old.kali.org/kali-images/kali-2019.1a",
"direct_download_url": "http://old.kali.org/kali-images/kali-2019.1a/kali-linux-2019.1a-amd64.iso"
},
{
"filename": "kali-linux-2018.4-amd64.iso",
"version": "2018.4",
"md5sum": "1b2d598bb8d2003e6207c119c0ba42fe",
"filesize": 3139436544,
"download_url": "http://old.kali.org/kali-images/kali-2018.4",
"direct_download_url": "http://old.kali.org/kali-images/kali-2018.4/kali-linux-2018.4-amd64.iso"
},
{
"filename": "kali-linux-2018.3a-amd64.iso",
"version": "2018.3a",
"md5sum": "2da675d016bd690c05e180e33aa98b94",
"filesize": 3192651776,
"download_url": "http://old.kali.org/kali-images/kali-2018.3a",
"direct_download_url": "http://old.kali.org/kali-images/kali-2018.3a/kali-linux-2018.3a-amd64.iso"
},
{
"filename": "kali-linux-2018.1-amd64.iso",
"version": "2018.1",
"md5sum": "a3feb90df5b71b3c7f4a02bdddf221d7",
"filesize": 3028500480,
"download_url": "http://old.kali.org/kali-images/kali-2018.1",
"direct_download_url": "http://old.kali.org/kali-images/kali-2018.1/kali-linux-2018.1-amd64.iso"
},
{
"filename": "kali-linux-2017.3-amd64.iso",
"version": "2017.3",
"md5sum": "b465580c897e94675ac1daf031fa66b9",
"filesize": 2886402048,
"download_url": "http://old.kali.org/kali-images/kali-2017.3/",
"direct_download_url": "http://old.kali.org/kali-images/kali-2017.3/kali-linux-2017.3-amd64.iso"
},
{
"filename": "kali-linux-2017.2-amd64.iso",
"version": "2017.2",
"md5sum": "541654f8f818450dc0db866a0a0f6eec",
"filesize": 3020619776,
"download_url": "http://old.kali.org/kali-images/kali-2017.2/",
"direct_download_url": "http://old.kali.org/kali-images/kali-2017.2/kali-linux-2017.2-amd64.iso"
},
{
"filename": "kali-linux-2017.1-amd64.iso",
"version": "2017.1",
"md5sum": "c8e742283929d7a12dbe7c58e398ff08",
"filesize": 2794307584,
"download_url": "http://old.kali.org/kali-images/kali-2017.1/",
"direct_download_url": "http://old.kali.org/kali-images/kali-2017.1/kali-linux-2017.1-amd64.iso"
},
{
"filename": "kali-linux-2016.2-amd64.iso",
"version": "2016.2",
"md5sum": "3d163746bc5148e61ad689d94bc263f9",
"filesize": 3076767744,
"download_url": "http://old.kali.org/kali-images/kali-2016.2/",
"direct_download_url": "http://old.kali.org/kali-images/kali-2016.2/kali-linux-2016.2-amd64.iso"
},
{
"filename": "kali-linux-2016.1-amd64.iso",
"version": "2016.1",
"md5sum": "2e1230dc14036935b3279dfe3e49ad39",
"filesize": 2945482752,
"download_url": "http://old.kali.org/kali-images/kali-2016.1/",
"direct_download_url": "http://old.kali.org/kali-images/kali-2016.1/kali-linux-2016.1-amd64.iso"
},
{
"filename": "kali-linux-2.0-amd64.iso",
"version": "2.0",
"md5sum": "ef192433017c5d99a156eaef51fd389d",
"filesize": 3320512512,
"download_url": "https://www.offensive-security.com/kali-linux-vmware-arm-image-download/",
"direct_download_url": "http://images.kali.org/Kali-Linux-2.0.0-vm-amd64.7z"
},
{
"filename": "kali-linux-persistence-1gb.qcow2",
"version": "1.0",
"md5sum": "14e9c92f3ba5a0bd1128c1ea26a129ea",
"filesize": 34734080,
"download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/",
"direct_download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/kali-linux-persistence-1gb.qcow2/download"
{
"filename": "kali-linux-2025.4-qemu-amd64.qcow2",
"version": "2025.4",
"md5sum": "a4be43351b5deb5b2823cb38a73b2095",
"filesize": 15719268352,
"download_url": "https://cdimage.kali.org/kali-2025.4/",
"direct_download_url": "https://cdimage.kali.org/kali-2025.4/kali-linux-2025.4-qemu-amd64.7z",
"compression": "7z"
}
],
"versions": [
{
"name": "2021.1",
"name": "2025.4",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2021.1-live-amd64.iso"
}
},
{
"name": "2019.3",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2019.3-amd64.iso"
}
},
{
"name": "2019.2",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2019.2-amd64.iso"
}
},
{
"name": "2019.2 (MATE)",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-mate-2019.2-amd64.iso"
}
},
{
"name": "2019.1a",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2019.1a-amd64.iso"
}
},
{
"name": "2018.4",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2018.4-amd64.iso"
}
},
{
"name": "2018.3a",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2018.3a-amd64.iso"
}
},
{
"name": "2018.1",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2018.1-amd64.iso"
}
},
{
"name": "2017.3",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2017.3-amd64.iso"
}
},
{
"name": "2017.2",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2017.2-amd64.iso"
}
},
{
"name": "2017.1",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2017.1-amd64.iso"
}
},
{
"name": "2016.2",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2016.2-amd64.iso"
}
},
{
"name": "2016.1",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2016.1-amd64.iso"
}
},
{
"name": "2.0",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2.0-amd64.iso"
"hda_disk_image": "kali-linux-2025.4-qemu-amd64.qcow2"
}
}
]
@@ -0,0 +1,22 @@
{
"appliance_id": "1174e46d-4a29-4554-a1e8-71ed90682295",
"name": "MikroTik WinBox 2026",
"category": "guest",
"description": "Mikrotik's WinBox router management software for GNS3 2026",
"vendor_name": "MikroTik",
"vendor_url": "https://mikrotik.com",
"documentation_url": "https://mikrotik.com/winbox",
"product_name": "MikroTik WinBox",
"product_url": "https://mikrotik.com/winbox",
"registry_version": 4,
"status": "stable",
"availability": "free",
"maintainer": "h3ck13r",
"maintainer_email": "pisdushko1886@gmail.com",
"usage": "Connect WinBox to a MikroTik CHR port and start them both. Open WinBox console and wait until MikroTik appear in neighbors tab, provide credentials and connect.",
"docker": {
"adapters": 1,
"image": "snatao808/winbox-mikrotik-2026",
"console_type": "vnc"
}
}
+44
View File
@@ -0,0 +1,44 @@
{
"appliance_id": "bb9ff73a-701e-40e8-b68a-6a6efeb04e99",
"name": "NethSecurity",
"category": "firewall",
"description": "NethSecurity is an Unified Threat Management (UTM) solution that provides a comprehensive suite of security features, including firewall, content filtering, deep packet inspection (DPI) using Netifyd, Dedalo hotspot, OpenVPN, and an optional remote controller. It is designed to be easy to install and configure, making it a good choice for both small and medium-sized businesses (SMBs) as well as enterprise organizations.",
"vendor_name": "Nethesis",
"vendor_url": "https://www.nethesis.it/",
"documentation_url": "https://docs.nethsecurity.org/en/latest/",
"product_name": "NethSecurity",
"product_url": "https://nethsecurity.org/",
"registry_version": 4,
"status": "stable",
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"usage": "Ethernet0 is the LAN link, Ethernet1 the WAN link. The default username is root and the password is Nethesis,1234",
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": 2,
"ram": 1024,
"hda_disk_interface": "scsi",
"arch": "x86_64",
"console_type": "telnet",
"kvm": "allow"
},
"images": [
{
"filename": "nethsecurity-8-24.10.0-ns.1.5.1-x86-64-generic-squashfs-combined-efi.img",
"version": "8-24.10.0-ns.1.5.1",
"md5sum": "be670218effca1b86dac6b8d95012791",
"filesize": 331644416,
"download_url": "https://nethsecurity.org/download",
"direct_download_url": "https://updates.nethsecurity.nethserver.org/stable/8-24.10.0-ns.1.5.1/targets/x86/64/nethsecurity-8-24.10.0-ns.1.5.1-x86-64-generic-squashfs-combined-efi.img.gz",
"compression": "gzip"
}
],
"versions": [
{
"name": "8-24.10.0-ns.1.5.1",
"images": {
"hda_disk_image": "nethsecurity-8-24.10.0-ns.1.5.1-x86-64-generic-squashfs-combined-efi.img"
}
}
]
}
+16 -1
View File
@@ -23,6 +23,15 @@
"kvm": "allow"
},
"images": [
{
"filename": "openwrt-24.10.2-x86-64-generic-ext4-combined.img",
"version": "24.10.2",
"md5sum": "0769916238524161b0a9a639ae261381",
"filesize": 126353408,
"download_url": "https://downloads.openwrt.org/releases/24.10.2/targets/x86/64/",
"direct_download_url": "https://downloads.openwrt.org/releases/24.10.2/targets/x86/64/openwrt-24.10.2-x86-64-generic-ext4-combined.img.gz",
"compression": "gzip"
},
{
"filename": "openwrt-23.05.0-x86-64-generic-ext4-combined.img",
"version": "23.05.0",
@@ -223,7 +232,13 @@
}
],
"versions": [
{
{
"name": "24.10.2",
"images": {
"hda_disk_image": "openwrt-24.10.2-x86-64-generic-ext4-combined.img"
}
},
{
"name": "23.05.0",
"images": {
"hda_disk_image": "openwrt-23.05.0-x86-64-generic-ext4-combined.img"
+14
View File
@@ -25,6 +25,20 @@
"kvm": "require"
},
"images": [
{
"filename": "OPNsense-25.7-nano-amd64.img",
"version": "25.7",
"md5sum": "07aa8b44ebc57fa9ca0145f777901a59",
"filesize": 3221225472,
"download_url": "https://opnsense.c0urier.net/releases/25.7/"
},
{
"filename": "OPNsense-25.1-nano-amd64.img",
"version": "25.1",
"md5sum": "9c119e4fed7dd7c1c162d8be4088d983",
"filesize": 3221225472,
"download_url": "https://opnsense.c0urier.net/releases/25.1/"
},
{
"filename": "OPNsense-24.7-nano-amd64.img",
"version": "24.7",
+31 -1
View File
@@ -26,6 +26,14 @@
"options": "-cpu host -nographic"
},
"images": [
{
"filename": "OL9U5_x86_64-kvm-b259.qcow2",
"version": "9.5",
"md5sum": "05e9b62c408ab49a02d6833fc683d1ad",
"filesize": 652935168,
"download_url": "https://yum.oracle.com/oracle-linux-templates.html",
"direct_download_url": "https://yum.oracle.com/templates/OracleLinux/OL9/u5/x86_64/OL9U5_x86_64-kvm-b259.qcow2"
},
{
"filename": "OL9U2_x86_64-kvm-b197.qcow",
"version": "9.2",
@@ -42,6 +50,14 @@
"download_url": "https://yum.oracle.com/oracle-linux-templates.html",
"direct_download_url": "https://yum.oracle.com/templates/OracleLinux/OL9/u1/x86_64/OL9U1_x86_64-kvm-b158.qcow"
},
{
"filename": "OL8U10_x86_64-kvm-b258.qcow2",
"version": "8.10",
"md5sum": "bb07581af5122515b6822595ded5deef",
"filesize": 1251672064,
"download_url": "https://yum.oracle.com/oracle-linux-templates.html",
"direct_download_url": "https://yum.oracle.com/templates/OracleLinux/OL8/u10/x86_64/OL8U10_x86_64-kvm-b258.qcow2"
},
{
"filename": "OL8U8_x86_64-kvm-b198.qcow",
"version": "8.8",
@@ -76,7 +92,14 @@
}
],
"versions": [
{
{
"name": "9.5",
"images": {
"hda_disk_image": "OL9U5_x86_64-kvm-b259.qcow2",
"cdrom_image": "oracle-cloud-init-data.iso"
}
},
{
"name": "9.2",
"images": {
"hda_disk_image": "OL9U2_x86_64-kvm-b197.qcow",
@@ -90,6 +113,13 @@
"cdrom_image": "oracle-cloud-init-data.iso"
}
},
{
"name": "8.10",
"images": {
"hda_disk_image": "OL8U10_x86_64-kvm-b258.qcow2",
"cdrom_image": "oracle-cloud-init-data.iso"
}
},
{
"name": "8.8",
"images": {
+57 -1
View File
@@ -13,7 +13,7 @@
"availability": "service-contract",
"maintainer": "Da-Geek",
"maintainer_email": "dageek@dageeks-geeks.gg",
"usage": "You should download Red Hat Enterprise Linux KVM Guest Image from https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.3/x86_64/product-software attach/customize rhel-cloud-init.iso and start.\nusername: cloud-user\npassword: redhat",
"usage": "You should download Red Hat Enterprise Linux KVM Guest Image from https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.5/x86_64/product-software attach/customize rhel-cloud-init.iso and start.\nusername: cloud-user\npassword: redhat",
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": 1,
@@ -26,6 +26,20 @@
"options": "-cpu host -nographic"
},
"images": [
{
"filename": "rhel-9.5-x86_64-kvm.qcow2",
"version": "9.5",
"md5sum": "8174396d5cb47727c59dd04dd9a05418",
"filesize": 974389248,
"download_url": "https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.5/x86_64/product-software"
},
{
"filename": "rhel-9.4-x86_64-kvm.qcow2",
"version": "9.4",
"md5sum": "77a2ca9a4cb0448260e04f0d2ebf9807",
"filesize": 957218816,
"download_url": "https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.4/x86_64/product-software"
},
{
"filename": "rhel-9.3-x86_64-kvm.qcow2",
"version": "9.3",
@@ -54,6 +68,20 @@
"filesize": 696582144,
"download_url": "https://access.redhat.com/downloads/content/479/ver=/rhel---8/9.0/x86_64/product-software"
},
{
"filename": "rhel-8.10-x86_64-kvm.qcow2",
"version": "8.10",
"md5sum": "5fda99fcab47e3b235c6ccdb6e80d362",
"filesize": 1065091072,
"download_url": "https://access.redhat.com/downloads/content/479/ver=/rhel---8/8.10/x86_64/product-software"
},
{
"filename": "rhel-8.9-x86_64-kvm.qcow2",
"version": "8.9",
"md5sum": "23295fe508678cbdebfbdbd41ef6e6e2",
"filesize": 971833344,
"download_url": "https://access.redhat.com/downloads/content/479/ver=/rhel---8/8.9/x86_64/product-software"
},
{
"filename": "rhel-8.8-x86_64-kvm.qcow2",
"version": "8.8",
@@ -119,6 +147,20 @@
}
],
"versions": [
{
"name": "9.5",
"images": {
"hda_disk_image": "rhel-9.5-x86_64-kvm.qcow2",
"cdrom_image": "rhel-cloud-init.iso"
}
},
{
"name": "9.4",
"images": {
"hda_disk_image": "rhel-9.4-x86_64-kvm.qcow2",
"cdrom_image": "rhel-cloud-init.iso"
}
},
{
"name": "9.3",
"images": {
@@ -147,6 +189,20 @@
"cdrom_image": "rhel-cloud-init.iso"
}
},
{
"name": "8.10",
"images": {
"hda_disk_image": "rhel-8.10-x86_64-kvm.qcow2",
"cdrom_image": "rhel-cloud-init.iso"
}
},
{
"name": "8.9",
"images": {
"hda_disk_image": "rhel-8.9-x86_64-kvm.qcow2",
"cdrom_image": "rhel-cloud-init.iso"
}
},
{
"name": "8.8",
"images": {
+15
View File
@@ -26,6 +26,14 @@
"options": "-nographic -cpu host"
},
"images": [
{
"filename": "Rocky-9-GenericCloud-Base-9.5-20241118.0.x86_64.qcow2",
"version": "9.5",
"md5sum": "880eccf788301bb9f34669faebe09276",
"filesize": 609812480,
"download_url": "https://download.rockylinux.org/pub/rocky/9/images/x86_64/",
"direct_download_url": "https://download.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud-Base-9.5-20241118.0.x86_64.qcow2"
},
{
"filename": "Rocky-9-GenericCloud-Base-9.3-20231113.0.x86_64.qcow2",
"version": "9.3",
@@ -68,6 +76,13 @@
}
],
"versions": [
{
"name": "9.5",
"images": {
"hda_disk_image": "Rocky-9-GenericCloud-Base-9.5-20241118.0.x86_64.qcow2",
"cdrom_image": "rocky-cloud-init-data.iso"
}
},
{
"name": "9.3",
"images": {
+39
View File
@@ -30,6 +30,27 @@
"on_close": "shutdown_signal"
},
"images": [
{
"filename": "vyos-1.4.4-kvm-amd64.qcow2",
"version": "1.4.4",
"md5sum": "942dae45d63924b58b65d069890765d4",
"filesize": 518782976,
"download_url": "https://support.vyos.io/"
},
{
"filename": "vyos-1.4.3-kvm-amd64.qcow2",
"version": "1.4.3",
"md5sum": "4eec0ba2ec367bbbdf2d2f212f947746",
"filesize": 515047424,
"download_url": "https://support.vyos.io/"
},
{
"filename": "vyos-1.4.2-kvm-amd64.qcow2",
"version": "1.4.2",
"md5sum": "78c5935e05a7bbd94a639fcee18f5799",
"filesize": 514064384,
"download_url": "https://support.vyos.io/"
},
{
"filename": "vyos-1.4.1-kvm-amd64.qcow2",
"version": "1.4.1",
@@ -116,6 +137,24 @@
}
],
"versions": [
{
"name": "1.4.4",
"images": {
"hda_disk_image": "vyos-1.4.4-kvm-amd64.qcow2"
}
},
{
"name": "1.4.3",
"images": {
"hda_disk_image": "vyos-1.4.3-kvm-amd64.qcow2"
}
},
{
"name": "1.4.2",
"images": {
"hda_disk_image": "vyos-1.4.2-kvm-amd64.qcow2"
}
},
{
"name": "1.4.1",
"images": {
+3 -2
View File
@@ -24,6 +24,7 @@ import socket
import shutil
import re
import logging
import inspect
log = logging.getLogger(__name__)
@@ -196,7 +197,7 @@ class BaseManager:
node_id = str(uuid4())
node = self._NODE_CLASS(name, node_id, project, self, *args, **kwargs)
if asyncio.iscoroutinefunction(node.create):
if inspect.iscoroutinefunction(node.create):
await node.create()
else:
node.create()
@@ -245,7 +246,7 @@ class BaseManager:
"""
node = self.get_node(node_id)
if asyncio.iscoroutinefunction(node.close):
if inspect.iscoroutinefunction(node.close):
await node.close()
else:
node.close()
+1 -1
View File
@@ -37,7 +37,7 @@ class Nat(Cloud):
def __init__(self, name, node_id, project, manager, ports=None):
allowed_interfaces = Config.instance().settings.Server.allowed_interfaces
if allowed_interfaces:
if allowed_interfaces and isinstance(allowed_interfaces, str):
allowed_interfaces = allowed_interfaces.split(',')
if sys.platform.startswith("linux"):
nat_interface = Config.instance().settings.Server.default_nat_interface
+29 -25
View File
@@ -38,9 +38,9 @@ log = logging.getLogger(__name__)
# Be careful to keep it consistent
DOCKER_MINIMUM_API_VERSION = "1.25"
DOCKER_MINIMUM_VERSION = "1.13"
DOCKER_PREFERRED_API_VERSION = "1.30"
DOCKER_MINIMUM_API_VERSION = "1.40"
DOCKER_MINIMUM_VERSION = "19.03.8"
DOCKER_PREFERRED_API_VERSION = "1.44"
CHUNK_SIZE = 1024 * 8 # 8KB
@@ -125,22 +125,28 @@ class Docker(BaseManager):
if not self._connected:
try:
self._connected = True
version = await self.query("GET", "version")
docker_info = await self.query("GET", "version")
except (aiohttp.ClientError, FileNotFoundError):
self._connected = False
raise DockerError("Can't connect to docker daemon")
raise DockerError("Can't connect to Docker daemon")
docker_version = parse_version(version["ApiVersion"])
api_version = parse_version(docker_info['ApiVersion'])
version = docker_info["Version"]
if docker_version < parse_version(DOCKER_MINIMUM_API_VERSION):
raise DockerError(
f"Docker version is {version['Version']}. "
f"GNS3 requires a minimum version of {DOCKER_MINIMUM_VERSION}"
if api_version < parse_version(DOCKER_MINIMUM_API_VERSION):
raise DockerError(f"Docker version is {version}. "
f"GNS3 requires a minimum version of {DOCKER_MINIMUM_VERSION}"
)
preferred_api_version = parse_version(DOCKER_PREFERRED_API_VERSION)
if docker_version >= preferred_api_version:
if api_version >= preferred_api_version:
self._api_version = DOCKER_PREFERRED_API_VERSION
else:
# use the Min API version supported by the daemon
self._api_version = docker_info['MinAPIVersion']
log.warning("Using Docker client with the minimum API version {}".format(self._api_version))
log.info("Connected to Docker daemon version {} using API version {}".format(version, self._api_version))
def connector(self):
@@ -175,11 +181,10 @@ class Docker(BaseManager):
response = await self.http_query(method, path, data=data, params=params)
body = await response.read()
response.close()
if body and len(body):
if response.headers.get('CONTENT-TYPE') == 'application/json':
body = json.loads(body.decode("utf-8"))
else:
body = body.decode("utf-8")
if response.headers.get('CONTENT-TYPE') == 'application/json':
body = json.loads(body.decode("utf-8", errors="ignore"))
else:
body = body.decode("utf-8", errors="ignore")
log.debug("Query Docker %s %s params=%s data=%s Response: %s", method, path, params, data, body)
return body
@@ -189,7 +194,7 @@ class Docker(BaseManager):
:param method: HTTP method
:param path: Endpoint in API
:param data: Dictionnary with the body. Will be transformed to a JSON
:param data: Dictionary with the body. Will be transformed to a JSON
:param params: Parameters added as a query arg
:param timeout: Timeout
:returns: HTTP response
@@ -200,12 +205,11 @@ class Docker(BaseManager):
timeout = 60 * 60 * 24 * 31 # One month timeout
if path == 'version':
url = "http://docker/v1.24/" + path
url = "http://docker/" + path
else:
url = "http://docker/v" + DOCKER_MINIMUM_API_VERSION + "/" + path
await self._check_connection() # version is use by check connection
url = "http://docker/v" + self._api_version + "/" + path
try:
if path != "version": # version is use by check connection
await self._check_connection()
if self._session is None or self._session.closed:
connector = self.connector()
self._session = aiohttp.ClientSession(connector=connector)
@@ -267,12 +271,12 @@ class Docker(BaseManager):
pass
if progress_callback:
progress_callback(f"Pulling '{image}' from docker hub")
progress_callback(f"Pulling '{image}' from Docker repository")
try:
response = await self.http_query("POST", "images/create", params={"fromImage": image}, timeout=None)
except DockerError as e:
raise DockerError(
f"Could not pull the '{image}' image from Docker Hub, "
f"Could not pull the '{image}' image from Docker repository, "
f"please check your Internet connection (original error: {e})"
)
# The pull api will stream status via an HTTP JSON stream
@@ -281,10 +285,10 @@ class Docker(BaseManager):
try:
chunk = await response.content.read(CHUNK_SIZE)
except aiohttp.ServerDisconnectedError:
log.error(f"Disconnected from server while pulling Docker image '{image}' from docker hub")
log.error(f"Disconnected from server while pulling Docker image '{image}' from Docker repository")
break
except asyncio.TimeoutError:
log.error(f"Timeout while pulling Docker image '{image}' from docker hub")
log.error("Timeout while pulling Docker image '{}' from Docker repository".format(image))
break
if not chunk:
break
+13 -2
View File
@@ -195,6 +195,14 @@ class DockerVM(BaseNode):
def ethernet_adapters(self):
return self._ethernet_adapters
@property
def docker_name(self):
"""
Container name in Docker
"""
return "GNS3.{}.{}".format(self.name, self._project.id)
@property
def mac_address(self):
"""
@@ -437,7 +445,7 @@ class DockerVM(BaseNode):
try:
image_infos = await self._get_image_information()
except DockerHttp404Error:
log.info(f"Image '{self._image}' is missing, pulling it from Docker hub...")
log.info("Image '{}' is missing, pulling it from Docker repository...".format(self._image))
await self.pull_image(self._image)
image_infos = await self._get_image_information()
@@ -539,7 +547,8 @@ class DockerVM(BaseNode):
if extra_hosts:
params["Env"].append(f"GNS3_EXTRA_HOSTS={extra_hosts}")
result = await self.manager.query("POST", "containers/create", data=params)
# Support name in Doker: [a-zA-Z0-9][a-zA-Z0-9_.-]
result = await self.manager.query("POST", f"containers/create?name={self.docker_name}", data=params)
self._cid = result["Id"]
log.info(f"Docker container '{self._name}' [{self._id}] created")
if self._cpus > 0:
@@ -617,6 +626,7 @@ class DockerVM(BaseNode):
await self._clean_servers()
await self.manager.query("POST", f"containers/{self._cid}/start")
await asyncio.sleep(0.5) # give the Docker container some time to start
self._namespace = await self._get_namespace()
await self._start_ubridge(require_privileged_access=True)
@@ -744,6 +754,7 @@ class DockerVM(BaseNode):
"-rfbport", str(self.console),
"-AlwaysShared",
"-SecurityTypes", "None",
"-desktop", self.name,
":{}".format(self._display),
stdout=fd, stderr=subprocess.STDOUT)
@@ -3,7 +3,12 @@
# script for udhcpc
# Copyright (c) 2008 Natanael Copa <natanael.copa@gmail.com>
UDHCPC="/gns3/etc/udhcpc"
if [ -d /etc/network ]; then
UDHCPC="/etc/network/udhcpc"
else
UDHCPC="/gns3/etc/udhcpc"
fi
UDHCPC_CONF="$UDHCPC/udhcpc.conf"
RESOLV_CONF="/etc/resolv.conf"
+1 -1
View File
@@ -106,7 +106,7 @@ class ProjectManager:
if project_id is not None and project_id in self._projects:
return self._projects[project_id]
project = Project(name=name, project_id=project_id, path=path, variables=variables)
self._check_available_disk_space(project)
#self._check_available_disk_space(project) # FIXME: disabled for now
self._projects[project.id] = project
return project
+69 -28
View File
@@ -32,6 +32,7 @@ import subprocess
import time
import json
import shlex
import psutil
from gns3server.utils import parse_version
from gns3server.utils.asyncio import subprocess_check_output, cancellable_wait_run_in_executor
@@ -265,17 +266,10 @@ class QemuVM(BaseNode):
if qemu_bin == "qemu":
self._platform = "i386"
else:
self._platform = re.sub(r'^qemu-system-(\w+).*$', r'\1', qemu_bin, re.IGNORECASE)
try:
QemuPlatform(self._platform.split(".")[0])
except ValueError:
self._platform = re.sub(r'^qemu-system-(\w+).*$', r'\1', qemu_bin, flags=re.IGNORECASE)
if self._platform.split(".")[0] not in list(QemuPlatform):
raise QemuError(f"Platform {self._platform} is unknown")
log.info(
'QEMU VM "{name}" [{id}] has set the QEMU path to {qemu_path}'.format(
name=self._name, id=self._id, qemu_path=qemu_path
)
)
log.info(f'QEMU VM "{self._name}" [{self._name}] has set the QEMU path to {qemu_path}')
def _check_qemu_path(self, qemu_path):
@@ -1225,6 +1219,21 @@ class QemuVM(BaseNode):
except OSError as e:
raise QemuError(f"Could not start Telnet QEMU console {e}\n")
def _find_partition_for_path(self, path):
"""
Finds the disk partition for a given path.
"""
path = os.path.abspath(path)
partitions = psutil.disk_partitions()
# find the partition with the longest matching mount point
matching_partition = None
for partition in partitions:
if path.startswith(partition.mountpoint):
if matching_partition is None or len(partition.mountpoint) > len(matching_partition.mountpoint):
matching_partition = partition
return matching_partition
async def _termination_callback(self, returncode):
"""
Called when the process has stopped.
@@ -1236,9 +1245,19 @@ class QemuVM(BaseNode):
log.info("QEMU process has stopped, return code: %d", returncode)
await self.stop()
if returncode != 0:
qemu_stdout = self.read_stdout()
# additional permissions need to be configured for swtpm in AppArmor if the working dir
# is located on a different partition than the partition for the root directory
if "TPM result for CMD_INIT" in qemu_stdout:
partition = self._find_partition_for_path(self.project.path)
if partition and partition.mountpoint != "/":
qemu_stdout += "\nTPM error: the project directory is not on the same partition as the root directory which can be a problem when using AppArmor.\n" \
"Please try to execute the following commands on the server:\n\n" \
"echo 'owner {}/** rwk,' | sudo tee /etc/apparmor.d/local/usr.bin.swtpm > /dev/null\n" \
"sudo service apparmor restart".format(os.path.dirname(self.project.path))
self.project.emit(
"log.error",
{"message": f"QEMU process has stopped, return code: {returncode}\n{self.read_stdout()}"},
{"message": f"QEMU process has stopped, return code: {returncode}\n{qemu_stdout}"},
)
async def stop(self):
@@ -2287,19 +2306,42 @@ class QemuVM(BaseNode):
else:
raise QemuError(f"bios image '{self._bios_image}' is not accessible")
options.extend(["-bios", self._bios_image.replace(",", ",,")])
elif self._uefi:
# get the OVMF firmware from the images directory
ovmf_firmware_path = self.manager.get_abs_image_path("OVMF_CODE.fd")
old_ovmf_vars_path = os.path.join(self.working_dir, "OVMF_VARS.fd")
if os.path.exists(old_ovmf_vars_path):
# the node has its own UEFI variables store already, we must also use the old UEFI firmware
ovmf_firmware_path = self.manager.get_abs_image_path("OVMF_CODE.fd")
else:
system_ovmf_firmware_path = "/usr/share/OVMF/OVMF_CODE_4M.fd"
if os.path.exists(system_ovmf_firmware_path):
ovmf_firmware_path = system_ovmf_firmware_path
else:
# otherwise, get the UEFI firmware from the images directory
ovmf_firmware_path = self.manager.get_abs_image_path("OVMF_CODE_4M.fd")
log.info("Configuring UEFI boot mode using OVMF file: '{}'".format(ovmf_firmware_path))
options.extend(["-drive", "if=pflash,format=raw,readonly,file={}".format(ovmf_firmware_path)])
# try to use the UEFI variables store from the system first
system_ovmf_vars_path = "/usr/share/OVMF/OVMF_VARS_4M.fd"
if os.path.exists(system_ovmf_vars_path):
ovmf_vars_path = system_ovmf_vars_path
else:
# otherwise, get the UEFI variables store from the images directory
ovmf_vars_path = self.manager.get_abs_image_path("OVMF_VARS_4M.fd")
# the node should have its own copy of OVMF_VARS.fd (the UEFI variables store)
ovmf_vars_node_path = os.path.join(self.working_dir, "OVMF_VARS.fd")
if not os.path.exists(ovmf_vars_node_path):
try:
shutil.copyfile(self.manager.get_abs_image_path("OVMF_VARS.fd"), ovmf_vars_node_path)
except OSError as e:
raise QemuError("Cannot copy OVMF_VARS.fd file to the node working directory: {}".format(e))
if os.path.exists(old_ovmf_vars_path):
ovmf_vars_node_path = old_ovmf_vars_path
else:
ovmf_vars_node_path = os.path.join(self.working_dir, "OVMF_VARS_4M.fd")
if not os.path.exists(ovmf_vars_node_path):
try:
shutil.copyfile(ovmf_vars_path, ovmf_vars_node_path)
except OSError as e:
raise QemuError("Cannot copy OVMF_VARS_4M.fd file to the node working directory: {}".format(e))
options.extend(["-drive", "if=pflash,format=raw,file={}".format(ovmf_vars_node_path)])
return options
@@ -2396,16 +2438,13 @@ class QemuVM(BaseNode):
) # we do not want any user networking back-end if no adapter is connected.
# Each 32 PCI device we need to add a PCI bridge with max 9 bridges
pci_devices = 4 + len(self._ethernet_adapters) # 4 PCI devices are use by default by qemu
pci_bridges = math.floor(pci_devices / 32)
# Reserve 32 devices on root pci_bridge,
# since the number of devices used by templates may differ significantly
# and pci_bridges also consume IDs.
# Move network devices to their own bridge
pci_devices_reserved = 32
pci_bridges_created = 0
if pci_bridges >= 1:
if self._qemu_version and parse_version(self._qemu_version) < parse_version("2.4.0"):
raise QemuError(
"Qemu version 2.4 or later is required to run this VM with a large number of network adapters"
)
pci_device_id = 4 + pci_bridges # Bridge consume PCI ports
pci_device_id = pci_devices_reserved
for adapter_number, adapter in enumerate(self._ethernet_adapters):
mac = int_to_macaddress(macaddress_to_int(self._mac_address) + adapter_number)
@@ -2596,6 +2635,8 @@ class QemuVM(BaseNode):
"""
self._qemu_version = await self.manager.get_qemu_version(self.qemu_path)
if self._qemu_version and parse_version(self._qemu_version) < parse_version("2.4.0"):
raise QemuError("Qemu version 2.4 or later is required to run Qemu VMs")
vm_name = self._name.replace(",", ",,")
project_path = self.project.path.replace(",", ",,")
additional_options = self._options.strip()
@@ -13,8 +13,7 @@ logging console discriminator EXCESS
!
no ip icmp rate-limit unreachable
!
! due to some bugs with IOU, try to change the following line to 'ip cef' if your routing does not work
no ip cef
ip cef
no ip domain lookup
!
!
@@ -12,8 +12,7 @@ no ip icmp rate-limit unreachable
!
!
!
! due to some bugs with IOU, try to change the following line to 'ip cef' if your routing does not work
no ip cef
ip cef
no ip domain lookup
!
!
+4 -3
View File
@@ -458,10 +458,11 @@ class Compute:
# FIXME: slow down number of compute events
self._controller.notification.controller_emit("compute.updated", self.asdict())
else:
if action == "log.error":
log.error(event.pop("message"))
await self._controller.notification.dispatch(
action, event, project_id=project_id, compute_id=self.id
action,
event,
project_id=project_id,
compute_id=self.id
)
else:
if response.type == aiohttp.WSMsgType.CLOSE:
@@ -249,6 +249,7 @@ class VirtualBoxGNS3VM(BaseGNS3VM):
return True
return False
async def list(self):
"""
List all VirtualBox VMs
@@ -269,8 +270,8 @@ class VirtualBoxGNS3VM(BaseGNS3VM):
# get a NAT interface number
nat_interface_number = await self._look_for_interface("nat")
if nat_interface_number < 0:
raise GNS3VMError(f'VM "{self.vmname}" must have a NAT interface configured in order to start')
if nat_interface_number < 0 and await self._look_for_interface("natnetwork") < 0:
raise GNS3VMError(f'VM "{self.vmname}" must have a NAT interface or NAT Network configured in order to start')
if sys.platform.startswith("darwin") and parse_version(self._system_properties["API version"]) >= parse_version("7_0"):
# VirtualBox 7.0+ on macOS requires a host-only network interface
@@ -339,42 +340,68 @@ class VirtualBoxGNS3VM(BaseGNS3VM):
elif vm_state == "paused":
args = [self._vmname, "resume"]
await self._execute("controlvm", args)
ip_address = "127.0.0.1"
try:
# get a random port on localhost
with socket.socket() as s:
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((ip_address, 0))
api_port = s.getsockname()[1]
except OSError as e:
raise GNS3VMError(f"Error while getting random port: {e}")
if await self._check_vbox_port_forwarding():
# delete the GNS3VM NAT port forwarding rule if it exists
log.info(f"Removing GNS3VM NAT port forwarding rule from interface {nat_interface_number}")
await self._execute("controlvm", [self._vmname, f"natpf{nat_interface_number}", "delete", "GNS3VM"])
log.info("Retrieving IP address from GNS3 VM...")
ip = await self._get_ip_from_guest_property()
if ip:
self.ip_address = ip
else:
# if we can't get the IP address from the guest property, we try to get it from the GNS3 server (a NAT interface is required)
if nat_interface_number < 0:
raise GNS3VMError("Could not find guest IP address for {}".format(self.vmname))
log.warning("Could not find IP address from guest property, trying to get it from GNS3 server")
ip_address = "127.0.0.1"
try:
# get a random port on localhost
with socket.socket() as s:
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((ip_address, 0))
api_port = s.getsockname()[1]
except OSError as e:
raise GNS3VMError("Error while getting random port: {}".format(e))
# add a GNS3VM NAT port forwarding rule to redirect 127.0.0.1 with random port to the port in the VM
log.info(f"Adding GNS3VM NAT port forwarding rule with port {api_port} to interface {nat_interface_number}")
await self._execute(
"controlvm",
[self._vmname, f"natpf{nat_interface_number}", f"GNS3VM,tcp,{ip_address},{api_port},,{self.port}"],
)
if await self._check_vbox_port_forwarding():
# delete the GNS3VM NAT port forwarding rule if it exists
log.info("Removing GNS3VM NAT port forwarding rule from interface {}".format(nat_interface_number))
await self._execute("controlvm", [self._vmname, "natpf{}".format(nat_interface_number), "delete", "GNS3VM"])
self.ip_address = await self._get_ip(interface_number, api_port)
log.info("GNS3 VM has been started with IP {}".format(self.ip_address))
# add a GNS3VM NAT port forwarding rule to redirect 127.0.0.1 with random port to the port in the VM
log.info("Adding GNS3VM NAT port forwarding rule with port {} to interface {}".format(api_port, nat_interface_number))
await self._execute("controlvm", [self._vmname, "natpf{}".format(nat_interface_number),
"GNS3VM,tcp,{},{},,{}".format(ip_address, api_port, self.port)])
self.ip_address = await self._get_ip_from_server(interface_number, api_port)
log.info("GNS3 VM has been started with IP '{}'".format(self.ip_address))
self.running = True
async def _get_ip(self, hostonly_interface_number, api_port):
async def _get_ip_from_guest_property(self):
"""
Get the IP from VirtualBox.
Get the IP from VirtualBox by retrieving the guest property (Guest Additions must be installed).
"""
remaining_try = 180 # try for 3 minutes
while remaining_try > 0:
result = await self._execute("guestproperty", ["get", self._vmname, "/VirtualBox/GuestInfo/Net/0/V4/IP"])
for info in result.splitlines():
if ':' in info:
name, value = info.split(':', 1)
if name == "Value":
return value.strip()
remaining_try -= 1
await asyncio.sleep(1)
return None
async def _get_ip_from_server(self, hostonly_interface_number, api_port):
"""
Get the IP from VirtualBox by sending a request to the GNS3 server.
Due to VirtualBox limitation the only way is to send request each
second to a GNS3 endpoint in order to get the list of the interfaces and
their IP and after that match it with VirtualBox host only.
"""
remaining_try = 300
remaining_try = 180 # try for 3 minutes
while remaining_try > 0:
try:
async with HTTPClient.get(f"http://127.0.0.1:{api_port}/v3/compute/network/interfaces") as resp:
+1 -1
View File
@@ -58,7 +58,7 @@ class CrashReport:
Report crash to a third party service
"""
DSN = "https://0d64280ffb5ae409d448f255b9956a88@o19455.ingest.us.sentry.io/38482"
DSN = "https://1c0ae79fd51b77c674718c6942337300@o19455.ingest.us.sentry.io/38482"
_instance = None
def __init__(self):
+1 -1
View File
@@ -78,7 +78,7 @@ async def connect_to_db(app: FastAPI) -> None:
db_path = os.path.join(Config.instance().config_dir, "gns3_controller.db")
db_url = os.environ.get("GNS3_DATABASE_URI", f"sqlite+aiosqlite:///{db_path}")
engine = create_async_engine(db_url, connect_args={"check_same_thread": False, "timeout": 20}, future=True)
engine = create_async_engine(db_url, connect_args={"check_same_thread": False, "timeout": 20}, future=True, pool_size=512, max_overflow=1024)
alembic_cfg = config.Config()
alembic_cfg.set_main_option("script_location", "gns3server:db_migrations")
#alembic_cfg.set_main_option('sqlalchemy.url', db_url)
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -20,7 +20,7 @@ from .common import ErrorMessage
from .version import Version
# Controller schemas
from .controller.links import LinkCreate, LinkUpdate, Link
from .controller.links import LinkCreate, LinkUpdate, Link, UDPPortInfo, EthernetPortInfo
from .controller.computes import ComputeCreate, ComputeUpdate, ComputeVirtualBoxVM, ComputeVMwareVM, ComputeDockerImage, AutoIdlePC, Compute
from .controller.templates import TemplateCreate, TemplateUpdate, TemplateUsage, Template
from .controller.images import Image, ImageType
+21
View File
@@ -92,3 +92,24 @@ class Link(LinkBase):
None,
description="Read only property. The compute identifier where a capture is running"
)
class UDPPortInfo(BaseModel):
"""
UDP port information.
"""
node_id: UUID
lport: int
rhost: str
rport: int
type: str
class EthernetPortInfo(BaseModel):
"""
Ethernet port information.
"""
node_id: UUID
interface: str
type: str
+1 -1
View File
@@ -46,6 +46,6 @@
gtag('config', 'G-0BT7QQV1W1');
</script>
<script src="runtime.24fa95b7061d7056.js" type="module"></script><script src="polyfills.319c79dd175e50d0.js" type="module"></script><script src="main.87178dd64c9c79ba.js" type="module"></script>
<script src="runtime.24fa95b7061d7056.js" type="module"></script><script src="polyfills.319c79dd175e50d0.js" type="module"></script><script src="main.fd9d76d279fa7d5e.js" type="module"></script>
</body></html>
@@ -1 +0,0 @@
(self.webpackChunkgns3_web_ui=self.webpackChunkgns3_web_ui||[]).push([[179],{5735:function(Ae,K,m){"use strict";m.d(K,{o:function(){return R}});var G=m(5671),W=m(3144),A=m(591),H=m(8929),R=function(){function P(){(0,G.Z)(this,P),this.data=[],this.dataChange=new A.X([]),this.itemUpdated=new H.xQ}return(0,W.Z)(P,[{key:"getItems",value:function(){return this.data}},{key:"add",value:function(D){this.findIndex(D)>=0?this.update(D):(this.data.push(D),this.dataChange.next(this.data))}},{key:"set",value:function(D){var j=this;D.forEach(function(v){var k=j.findIndex(v);if(k>=0){var b=Object.assign(j.data[k],v);j.data[k]=b}else j.data.push(v)}),this.data.filter(function(v){return 0===D.filter(function(k){return j.getItemKey(k)===j.getItemKey(v)}).length}).forEach(function(v){return j.remove(v)}),this.dataChange.next(this.data)}},{key:"get",value:function(D){var j=this,L=this.data.findIndex(function(v){return j.getItemKey(v)===D});if(L>=0)return this.data[L]}},{key:"update",value:function(D){var j=this.findIndex(D);if(j>=0){var L=Object.assign(this.data[j],D);this.data[j]=L,this.dataChange.next(this.data),this.itemUpdated.next(L)}}},{key:"remove",value:function(D){var j=this.findIndex(D);j>=0&&(this.data.splice(j,1),this.dataChange.next(this.data))}},{key:"changes",get:function(){return this.dataChange}},{key:"itemChanged",get:function(){return this.itemUpdated}},{key:"clear",value:function(){this.data=[],this.dataChange.next(this.data)}},{key:"findIndex",value:function(D){var j=this;return this.data.findIndex(function(L){return j.getItemKey(L)===j.getItemKey(D)})}}]),P}()},6215:function(Ae,K,m){"use strict";m.d(K,{F:function(){return x}});var G=m(5671),W=m(3144),A=m(136),H=m(9388),R=m(5735),P=m(5e3),x=function(D){(0,A.Z)(L,D);var j=(0,H.Z)(L);function L(){return(0,G.Z)(this,L),j.apply(this,arguments)}return(0,W.Z)(L,[{key:"getItemKey",value:function(k){return k.link_id}}]),L}(R.o);x.\u0275fac=function(){var D;return function(L){return(D||(D=P.n5z(x)))(L||x)}}(),x.\u0275prov=P.Yz7({token:x,factory:x.\u0275fac})},5366:function(Ae,K,m){"use strict";m.d(K,{G:function(){return x}});var G=m(5671),W=m(3144),A=m(136),H=m(9388),R=m(5735),P=m(5e3),x=function(D){(0,A.Z)(L,D);var j=(0,H.Z)(L);function L(){return(0,G.Z)(this,L),j.apply(this,arguments)}return(0,W.Z)(L,[{key:"getItemKey",value:function(k){return k.node_id}}]),L}(R.o);x.\u0275fac=function(){var D;return function(L){return(D||(D=P.n5z(x)))(L||x)}}(),x.\u0275prov=P.Yz7({token:x,factory:x.\u0275fac})},5542:function(Ae,K,m){"use strict";m.d(K,{X:function(){return R}});var G=m(5671),W=m(3144),A=m(5e3),H=m(2437),R=function(){function P(x){(0,G.Z)(this,P),this.httpController=x}return(0,W.Z)(P,[{key:"getComputes",value:function(D){return this.httpController.get(D,"/computes")}},{key:"getStatistics",value:function(D){return this.httpController.get(D,"/statistics")}}]),P}();R.\u0275fac=function(x){return new(x||R)(A.LFG(H.zw))},R.\u0275prov=A.Yz7({token:R,factory:R.\u0275fac})},2437:function(Ae,K,m){"use strict";m.d(K,{CJ:function(){return k},zw:function(){return b}});var G=m(5671),W=m(3144),A=m(136),H=m(9388),R=m(5724),P=m(5e3),x=m(4766),D=m(1737),j=m(7221),L=m(520),v=function(O){(0,A.Z)(y,O);var S=(0,H.Z)(y);function y(T){return(0,G.Z)(this,y),S.call(this,T)}return(0,W.Z)(y,null,[{key:"fromError",value:function(M,E){var N=new y(M);return N.originalError=E,N}}]),y}((0,R.Z)(Error)),k=function(){function O(){(0,G.Z)(this,O)}return(0,W.Z)(O,[{key:"handleError",value:function(y){var T=y;return"HttpErrorResponse"===y.name&&0===y.status&&(T=v.fromError("Controller is unreachable",y)),401===y.status&&window.location.reload(),(0,D._)(T)}}]),O}();k.\u0275fac=function(S){return new(S||k)},k.\u0275prov=P.Yz7({token:k,factory:k.\u0275fac});var b=function(){function O(S,y){(0,G.Z)(this,O),this.http=S,this.errorHandler=y,this.requestsNotificationEmitter=new P.vpe}return(0,W.Z)(O,[{key:"get",value:function(y,T,M){M=this.getJsonOptions(M);var E=this.getOptionsForController(y,T,M);return this.requestsNotificationEmitter.emit("GET ".concat(E.url)),this.http.get(E.url,E.options).pipe((0,j.K)(this.errorHandler.handleError))}},{key:"getText",value:function(y,T,M){M=this.getTextOptions(M);var E=this.getOptionsForController(y,T,M);return this.requestsNotificationEmitter.emit("GET ".concat(E.url)),this.http.get(E.url,E.options).pipe((0,j.K)(this.errorHandler.handleError))}},{key:"getBlob",value:function(y,T,M){M=this.getBlobOptions(M);var E=this.getOptionsForController(y,T,M);return this.requestsNotificationEmitter.emit("GET ".concat(E.url)),this.http.get(E.url,E.options).pipe((0,j.K)(this.errorHandler.handleError))}},{key:"post",value:function(y,T,M,E){E=this.getJsonOptions(E);var N=this.getOptionsForController(y,T,E);return this.requestsNotificationEmitter.emit("POST ".concat(N.url)),this.http.post(N.url,M,N.options).pipe((0,j.K)(this.errorHandler.handleError))}},{key:"put",value:function(y,T,M,E){E=this.getJsonOptions(E);var N=this.getOptionsForController(y,T,E);return this.requestsNotificationLine truncated
@@ -0,0 +1 @@
(self.webpackChunkgns3_web_ui=self.webpackChunkgns3_web_ui||[]).push([[179],{5735:function(Ae,K,m){"use strict";m.d(K,{o:function(){return R}});var G=m(5671),W=m(3144),A=m(591),H=m(8929),R=function(){function P(){(0,G.Z)(this,P),this.data=[],this.dataChange=new A.X([]),this.itemUpdated=new H.xQ}return(0,W.Z)(P,[{key:"getItems",value:function(){return this.data}},{key:"add",value:function(D){this.findIndex(D)>=0?this.update(D):(this.data.push(D),this.dataChange.next(this.data))}},{key:"set",value:function(D){var j=this;D.forEach(function(v){var k=j.findIndex(v);if(k>=0){var b=Object.assign(j.data[k],v);j.data[k]=b}else j.data.push(v)}),this.data.filter(function(v){return 0===D.filter(function(k){return j.getItemKey(k)===j.getItemKey(v)}).length}).forEach(function(v){return j.remove(v)}),this.dataChange.next(this.data)}},{key:"get",value:function(D){var j=this,L=this.data.findIndex(function(v){return j.getItemKey(v)===D});if(L>=0)return this.data[L]}},{key:"update",value:function(D){var j=this.findIndex(D);if(j>=0){var L=Object.assign(this.data[j],D);this.data[j]=L,this.dataChange.next(this.data),this.itemUpdated.next(L)}}},{key:"remove",value:function(D){var j=this.findIndex(D);j>=0&&(this.data.splice(j,1),this.dataChange.next(this.data))}},{key:"changes",get:function(){return this.dataChange}},{key:"itemChanged",get:function(){return this.itemUpdated}},{key:"clear",value:function(){this.data=[],this.dataChange.next(this.data)}},{key:"findIndex",value:function(D){var j=this;return this.data.findIndex(function(L){return j.getItemKey(L)===j.getItemKey(D)})}}]),P}()},6215:function(Ae,K,m){"use strict";m.d(K,{F:function(){return x}});var G=m(5671),W=m(3144),A=m(136),H=m(9388),R=m(5735),P=m(5e3),x=function(D){(0,A.Z)(L,D);var j=(0,H.Z)(L);function L(){return(0,G.Z)(this,L),j.apply(this,arguments)}return(0,W.Z)(L,[{key:"getItemKey",value:function(k){return k.link_id}}]),L}(R.o);x.\u0275fac=function(){var D;return function(L){return(D||(D=P.n5z(x)))(L||x)}}(),x.\u0275prov=P.Yz7({token:x,factory:x.\u0275fac})},5366:function(Ae,K,m){"use strict";m.d(K,{G:function(){return x}});var G=m(5671),W=m(3144),A=m(136),H=m(9388),R=m(5735),P=m(5e3),x=function(D){(0,A.Z)(L,D);var j=(0,H.Z)(L);function L(){return(0,G.Z)(this,L),j.apply(this,arguments)}return(0,W.Z)(L,[{key:"getItemKey",value:function(k){return k.node_id}}]),L}(R.o);x.\u0275fac=function(){var D;return function(L){return(D||(D=P.n5z(x)))(L||x)}}(),x.\u0275prov=P.Yz7({token:x,factory:x.\u0275fac})},5542:function(Ae,K,m){"use strict";m.d(K,{X:function(){return R}});var G=m(5671),W=m(3144),A=m(5e3),H=m(2437),R=function(){function P(x){(0,G.Z)(this,P),this.httpController=x}return(0,W.Z)(P,[{key:"getComputes",value:function(D){return this.httpController.get(D,"/computes")}},{key:"getStatistics",value:function(D){return this.httpController.get(D,"/statistics")}}]),P}();R.\u0275fac=function(x){return new(x||R)(A.LFG(H.zw))},R.\u0275prov=A.Yz7({token:R,factory:R.\u0275fac})},2437:function(Ae,K,m){"use strict";m.d(K,{CJ:function(){return k},zw:function(){return b}});var G=m(5671),W=m(3144),A=m(136),H=m(9388),R=m(5724),P=m(5e3),x=m(4766),D=m(1737),j=m(7221),L=m(520),v=function(O){(0,A.Z)(y,O);var S=(0,H.Z)(y);function y(T){return(0,G.Z)(this,y),S.call(this,T)}return(0,W.Z)(y,null,[{key:"fromError",value:function(M,E){var N=new y(M);return N.originalError=E,N}}]),y}((0,R.Z)(Error)),k=function(){function O(){(0,G.Z)(this,O)}return(0,W.Z)(O,[{key:"handleError",value:function(y){var T=y;return"HttpErrorResponse"===y.name&&0===y.status&&(T=v.fromError("Controller is unreachable",y)),(0,D._)(T)}}]),O}();k.\u0275fac=function(S){return new(S||k)},k.\u0275prov=P.Yz7({token:k,factory:k.\u0275fac});var b=function(){function O(S,y){(0,G.Z)(this,O),this.http=S,this.errorHandler=y,this.requestsNotificationEmitter=new P.vpe}return(0,W.Z)(O,[{key:"get",value:function(y,T,M){M=this.getJsonOptions(M);var E=this.getOptionsForController(y,T,M);return this.requestsNotificationEmitter.emit("GET ".concat(E.url)),this.http.get(E.url,E.options).pipe((0,j.K)(this.errorHandler.handleError))}},{key:"getText",value:function(y,T,M){M=this.getTextOptions(M);var E=this.getOptionsForController(y,T,M);return this.requestsNotificationEmitter.emit("GET ".concat(E.url)),this.http.get(E.url,E.options).pipe((0,j.K)(this.errorHandler.handleError))}},{key:"getBlob",value:function(y,T,M){M=this.getBlobOptions(M);var E=this.getOptionsForController(y,T,M);return this.requestsNotificationEmitter.emit("GET ".concat(E.url)),this.http.get(E.url,E.options).pipe((0,j.K)(this.errorHandler.handleError))}},{key:"post",value:function(y,T,M,E){E=this.getJsonOptions(E);var N=this.getOptionsForController(y,T,E);return this.requestsNotificationEmitter.emit("POST ".concat(N.url)),this.http.post(N.url,M,N.options).pipe((0,j.K)(this.errorHandler.handleError))}},{key:"put",value:function(y,T,M,E){E=this.getJsonOptions(E);var N=this.getOptionsForController(y,T,E);return this.requestsNotificationEmitter.emit("PUT ".concat(N.url)),this.hLine truncated
+2 -4
View File
@@ -20,6 +20,7 @@ import asyncio
import sys
import os
import threading
import inspect
async def wait_run_in_executor(func, *args, **kwargs):
@@ -90,9 +91,6 @@ async def wait_for_process_termination(process, timeout=10):
In theory this can be implemented by just:
await asyncio.wait_for(self._iou_process.wait(), timeout=100)
But it's broken before Python 3.4:
http://bugs.python.org/issue23140
:param process: An asyncio subprocess
:param timeout: Timeout in seconds
"""
@@ -106,7 +104,7 @@ async def wait_for_process_termination(process, timeout=10):
async def _check_process(process, termination_callback):
if not hasattr(sys, "_called_from_test") or not sys._called_from_test:
returncode = await process.wait()
if asyncio.iscoroutinefunction(termination_callback):
if inspect.iscoroutinefunction(termination_callback):
await termination_callback(returncode)
else:
termination_callback(returncode)
+8 -1
View File
@@ -60,7 +60,14 @@ class FileWatcher:
self._hashed[path] = zlib.adler32(open(path, "rb").read())
except OSError:
self._hashed[path] = None
asyncio.get_event_loop().call_later(self._delay, self._check_config_file_change)
try:
loop = asyncio.get_running_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.call_later(self._delay, self._check_config_file_change)
def __del__(self):
self._closed = True
+10
View File
@@ -342,6 +342,12 @@ async def write_image(
allow_raw_image=False
) -> models.Image:
db_image = await images_repo.get_image(image_path)
if db_image and os.path.exists(image_path):
# the image already exists in the database and on disk
log.info(f"Image {image_path} already exists")
return db_image
image_dir, image_name = os.path.split(image_filename)
log.info(f"Writing image file to '{image_path}'")
# Store the file under its final name only when the upload is completed
@@ -381,6 +387,10 @@ async def write_image(
except OSError:
log.warning(f"Could not remove '{tmp_path}'")
if db_image:
# the image already exists in the database, no need to add it again
return db_image
return await images_repo.add_image(
image_name,
image_type,
+2 -2
View File
@@ -22,8 +22,8 @@
# or negative for a release candidate or beta (after the base version
# number has been incremented)
__version__ = "3.0.4"
__version_info__ = (3, 0, 4, 0)
__version__ = "3.0.6"
__version_info__ = (3, 0, 6, 0)
if "dev" in __version__:
try:
+1 -1
View File
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "gns3-server"
description = "GNS3 graphical interface for the GNS3 server."
license = {file = "LICENSE"}
license-files = ["LICENSE"]
authors = [
{ name = "Jeremy Grossmann", email = "developers@gns3.com" }
]
+19 -20
View File
@@ -1,25 +1,24 @@
uvicorn==0.34.0 # uvicorn 0.33 is the last version supporting Python 3.8
pydantic==2.10.6
fastapi==0.115.8
python-multipart==0.0.20
websockets==15.0
aiohttp>=3.11.13,<3.12
async-timeout==5.0.1; python_version < '3.11'
aiofiles>=24.1.0,<25.0
Jinja2>=3.1.5,<3.2
sentry-sdk>=2.22,<2.23 # optional dependency
psutil>=7.0.0
uvicorn==0.39.0 # version 0.39.0 is the last version supporting Python 3.9
pydantic==2.12.5
fastapi==0.128.0
python-multipart==0.0.20 # version 0.0.20 is the last to support Python 3.9
websockets==15.0.1 # version 15.0.1 is the last to support Python 3.9
aiohttp>=3.13.3,<3.14
aiofiles>=25.1.0,<26.0
Jinja2>=3.1.6,<3.2
sentry-sdk>=2.50.0,<3 # optional dependency
psutil>=7.2.1
async-timeout>=5.0.1,<5.1; python_version < '3.11' # this library has effectively been upstreamed into Python 3.11+
distro>=1.9.0
py-cpuinfo>=9.0.0,<10.0
greenlet==3.1.1 # necessary to run sqlalchemy on Python 3.13
sqlalchemy==2.0.38
greenlet==3.3.1; python_version >= '3.13' # necessary to run sqlalchemy on Python >= 3.13
sqlalchemy==2.0.43
aiosqlite==0.21.0
alembic==1.14.1
bcrypt==4.2.1
joserfc==1.0.3
email-validator==2.2.0
alembic==1.15.2
bcrypt==5.0.0
joserfc==1.6.1
email-validator==2.3.0
watchdog==6.0.0
zstandard==0.23.0
zstandard==0.25.0
platformdirs>=2.4.0,<3 # platformdirs >=3 conflicts when building Debian packages
importlib-resources>=1.3; python_version <= '3.9'
truststore>=0.10.1; python_version >= '3.10'
truststore>=0.10.4; python_version >= '3.10'
-238
View File
@@ -1,238 +0,0 @@
#!/usr/bin/env python
#
# Copyright (C) 2016 GNS3 Technologies Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
This script connect to the local GNS3 server and will create a random topology
"""
import sys
import json
import math
import aiohttp
import aiohttp.web
import asyncio
import random
import coloredlogs
import logging
coloredlogs.install(fmt=" %(asctime)s %(levelname)s %(message)s")
log = logging.getLogger(__name__)
PROJECT_ID = "9e26e37d-4962-4921-8c0e-136d3b04ba9c"
HOST = "192.168.84.151:3080"
# Use for node names uniqueness
node_i = 1
def die(*args):
log.error(*args)
sys.exit(1)
class HTTPError(Exception):
def __init__(self, method, path, response):
self._method = method
self._path = path
self._response = response
@property
def response(self):
return self._response
@property
def path(self):
return self._path
@property
def method(self):
return self._method
class HTTPConflict(HTTPError):
pass
class HTTPNotFound(HTTPError):
pass
async def query(method, path, body=None, **kwargs):
global session
if body:
kwargs["data"] = json.dumps(body)
async with session.request(method, "http://" + HOST + "/v2" + path, **kwargs) as response:
if response.status == 409:
raise HTTPConflict(method, path, response)
elif response.status == 404:
raise HTTPNotFound(method, path, response)
elif response.status >= 300:
raise HTTPError(method, path, response)
log.info("%s %s %d", method, path, response.status)
if response.headers["content-type"] == "application/json":
return await response.json()
else:
return "{}"
async def post(path, **kwargs):
return await query("POST", path, **kwargs)
async def get(path, **kwargs):
return await query("GET", path, **kwargs)
async def delete(path, **kwargs):
return await query("DELETE", path, **kwargs)
async def create_project():
# Delete project if already exists
response = await get("/projects")
project_exists = False
for project in response:
if project["name"] == "random" and project["project_id"] != PROJECT_ID:
await delete("/projects/" + project["project_id"])
elif project["project_id"] == PROJECT_ID:
project_exists = True
tasks = []
for node in await get("/projects/" + PROJECT_ID + "/nodes"):
tasks.append(delete_node(project, node))
await asyncio.gather(*tasks)
if project_exists:
response = await post("/projects/" + PROJECT_ID + "/open")
else:
response = await post("/projects", body={"name": "random", "project_id": PROJECT_ID, "auto_close": False})
return response
async def create_node(project):
global node_i
r = random.randint(0, 1)
if r == 0:
node_type = "ethernet_switch"
symbol = ":/symbols/ethernet_switch.svg"
elif r == 1:
node_type = "vpcs"
symbol = ":/symbols/vpcs_guest.svg"
response = await post("/projects/{}/nodes".format(project["project_id"]), body={
"node_type": node_type,
"compute_id": "local",
"symbol": symbol,
"name": "Node{}".format(node_i),
"x": (math.floor((node_i - 1) % 12.0) * 100) - 500,
"y": (math.ceil((node_i) / 12.0) * 100) - 300
})
node_i += 1
return response
async def delete_node(project, node):
await delete("/projects/{}/nodes/{}".format(project["project_id"], node["node_id"]))
async def create_link(project, nodes):
"""
Create all possible link of a node
"""
node1 = random.choice(list(nodes.values()))
for port in range(0, 8):
node2 = random.choice(list(nodes.values()))
if node1 == node2:
continue
data = {"nodes":
[
{
"adapter_number": 0,
"node_id": node1["node_id"],
"port_number": port
},
{
"adapter_number": 0,
"node_id": node2["node_id"],
"port_number": port
}
]
}
try:
await post("/projects/{}/links".format(project["project_id"]), body=data)
except (HTTPConflict, HTTPNotFound):
pass
async def build_topology():
global node_i
nodes = {}
project = await create_project()
while True:
rand = random.randint(0, 1000)
if rand < 500: # chance to create a new node
if len(nodes.keys()) < 255: # Limit of VPCS:
node = await create_node(project)
nodes[node["node_id"]] = node
elif rand < 600: # start all nodes
await post("/projects/{}/nodes/start".format(project["project_id"]))
elif rand < 700: # stop all nodes
await post("/projects/{}/nodes/stop".format(project["project_id"]))
elif rand < 950: # create a link
if len(nodes.keys()) >= 2:
await create_link(project, nodes)
elif rand < 999: # chance to delete a node
continue
if len(nodes.keys()) > 0:
node = random.choice(list(nodes.values()))
await delete_node(project, node)
del nodes[node["node_id"]]
elif len(nodes.keys()) > 0: # % chance to delete all nodes
continue
node_i = 1
tasks = []
for node in nodes.values():
tasks.append(delete_node(project, node))
await asyncio.gather(*tasks)
nodes = {}
await asyncio.sleep(0.2)
async def main(loop):
global session
async with aiohttp.ClientSession() as session:
try:
await build_topology()
except HTTPError as error:
try:
j = await error.response.json()
die("%s %s invalid status %d:\n%s", error.method, error.path, error.response.status, json.dumps(j, indent=4))
except (ValueError, aiohttp.ServerDisconnectedError):
die("%s %s invalid status %d", error.method, error.path, error.response.status)
loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))
if session:
session.close()
+31 -53
View File
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (C) 2024 GNS3 Technologies Inc.
# Copyright (C) 2025 GNS3 Technologies Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@ function help {
echo "--with-i386-repository: Add the i386 repositories required by IOU i386 images. This is not needed for recent x86_64 IOU images." >&2
echo "--with-welcome: Install GNS3-VM welcome.py script" >&2
echo "--without-kvm: Disable KVM, required if system do not support it (limitation in some hypervisors and cloud providers). Warning: only disable KVM if strictly necessary as this will degrade performance" >&2
echo "--without-system-upgrade: Do not upgrade the system" >&2
echo "--unstable: Use the GNS3 unstable repository" >&2
echo "--custom-repository <repository>: Use a custom repository" >&2
echo "--help: This help" >&2
@@ -38,6 +39,13 @@ function log {
}
lsb_release -d | grep "LTS" > /dev/null
if [ "$EUID" -ne 0 ]
then
echo "This script must be run as root"
exit 1
fi
if [ $? != 0 ]
then
echo "This script can only be run on a Linux Ubuntu LTS release"
@@ -52,6 +60,7 @@ USE_VPN=0
USE_IOU=0
I386_REPO=0
DISABLE_KVM=0
NO_SYSTEM_UPGRADE=0
WELCOME_SETUP=0
TEMP=`getopt -o h --long with-openvpn,with-iou,with-i386-repository,with-welcome,without-kvm,unstable,custom-repository:,help -n 'gns3-remote-install.sh' -- "$@"`
@@ -85,6 +94,10 @@ while true ; do
DISABLE_KVM=1
shift
;;
--without-system-upgrade)
NO_SYSTEM_UPGRADE=1
shift
;;
--unstable)
REPOSITORY="unstable"
shift
@@ -102,68 +115,33 @@ while true ; do
esac
done
if [ "$REPOSITORY" == "ppa-v3" ]
then
if ! python3 -c 'import sys; assert sys.version_info >= (3,9)' > /dev/null 2>&1; then
echo "GNS3 version >= 3.0 requires Python 3.9 or later"
exit 1
fi
fi
# Exit in case of error
set -e
export DEBIAN_FRONTEND="noninteractive"
UBUNTU_CODENAME=`lsb_release -c -s`
log "Add GNS3 repository"
log "Updating system packages, installing curl and software-properties-common"
apt update
apt install -y curl software-properties-common
if [ ! -f "/etc/apt/sources.list.d/ubuntu.sources" ]
if [ $NO_SYSTEM_UPGRADE == 0 ]
then
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B83AAABFFBD82D21B543C8EA86C22C2EC6A24D7F
cat <<EOFLIST > /etc/apt/sources.list.d/gns3.list
deb http://ppa.launchpad.net/gns3/ppa/ubuntu $UBUNTU_CODENAME main
deb-src http://ppa.launchpad.net/gns3/ppa/ubuntu $UBUNTU_CODENAME main
EOFLIST
else
cat <<EOFLIST > /etc/apt/sources.list.d/gns3-ppa.sources
Types: deb
URIs: https://ppa.launchpadcontent.net/gns3/$REPOSITORY/ubuntu/
Suites: $UBUNTU_CODENAME
Components: main
Signed-By:
-----BEGIN PGP PUBLIC KEY BLOCK-----
.
mQINBGY0jSYBEADMH5CvX8ZVX4XzAxdQ2CmF7t86IjFnQgtI18Q19nVnpKEGNyB5
pgotDMzkhGnxuhvz2zE9PZhd8VgkodB81V607d/Dy8FfI7t1BVQhLvJDx0H/q6RE
n2y9WxiuBzTHitoQTCTY3hjcr7AUNFFI64gUqwbkQmYbCWWsYOlDpRSkWKg8P8WK
08RetwTI0Iwoz8j+BkbPlubuImiVfh1TeH23FBuGIwL1r1Cps0wel6JAi+jaU9WG
j8MX3mQYFTAtk7f1lRubqWosB/A4xIu609pF1e1tAkWAGltYAeoFhDn+PfA9KgmV
fvxfVR7zmxp31imTJgXgUFCz+H0Xb3vpve8XsrsHZUP6StJ3+6cFXjNBV6PuO1FT
JWp86a+AYHg7+sUWcoJRZPCTbb/pOcCa0q1ch5qcLkiYEOGK+pYhbPptq6y8IsJW
N6EDNCVvVqVyTJy14FZWoOqxcpUiDOQ+su28j8++V+PMo+FO3SQqwEZwJXk7LF/4
wUipDCUh/WNjDqqgmYLoO+ttiiJPbEw3jtbO+zopbzYpyEC1f06Nz7uz1daOIN3J
etFPzSqWCE7Eq+hoVmAAm8gVmQir3rFJbIGBAvAaOLQEOkUlOlS7AezqUhdyhGER
Zrvc3eNqxY7G61SEHipEJ7/hpcDq0RRWCXHsoQqyHaPje826n2pGkJYt4QARAQAB
tBZMYXVuY2hwYWQgUFBBIGZvciBHTlMziQJOBBMBCgA4FiEEuDqqv/vYLSG1Q8jq
hsIsLsaiTX8FAmY0jSYCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQhsIs
LsaiTX9z9xAAq1uHmRgfYmELS0cr2YEnTWHPVE6s95Qx+0cr5zzNeWfmoAS9uSyl
z8bCm+Q2ZapzU/nOtkozU+RGjgcRRTKMVTyS0PjFX22965xHCRWnw79fPyrYouUw
H2cAT8WSGYEeVAbqhJSns0RnDpXuaxmWE1wT+iitY/QAjeXo22Z2mjv2bFTitKbY
hZbE5Eu8Olc5YHCVI0ofq84/Ii921iMibU6EDMmm/iOnMK2uHGbC59t0YG8Rm7mK
uk6+TpxOULjFeCWSkF2Dr33m8JQmtYZuFUnmqWPuSdBo3J0O1b0qTg+EP9FbDAtj
CoEKT/V1ccMBd3r77o23CGsvpV7bzEU60A+NsU8vb/AkOmouYiF+qaYDFGZDfWhK
p1HFmd1kt7YdgxsmoKoFJkbt1bBdcFJLV0Jcad5sfArg2aFDYf2giMxAw4iQ+9jc
MCuwWxiqWicPqJ5erNTzVfayBkjuZqBDVTO9wmG3DL4QmNosIBS7kq+NGrT8Ql22
FqYfdIZJDlKVtJKHK8eKJSB0dbFawV2h5p/CvQlIm6nthg5FzOyjvCkPkvxvveq+
SuNxFEscumFCgo7j7RMWHW9HWK3TUvMmYLMVjxL8kXyCwknp9GklBQHA/IPxRa/2
eFqqkmVbmNAoMzzw5wqa/BPcFEbgn+E+TFyZqbzp0F4QzPJZFkz16SA=
=xnj5
-----END PGP PUBLIC KEY BLOCK-----
EOFLIST
log "Upgrading system packages"
apt upgrade --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
fi
log "Updating system packages and installing curl"
apt update
apt install -y curl
log "Upgrading packages"
apt upgrade --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
log "Adding GNS3 repository ppa:gns3/$REPOSITORY"
# use sudo -E to preserve proxy config
sudo -E apt-add-repository -y "ppa:gns3/$REPOSITORY"
log "Installing the GNS3 server and its dependencies"
apt install -y gns3-server
+9 -10
View File
@@ -173,15 +173,15 @@ class TestImageRoutes:
assert response.status_code == status.HTTP_200_OK
assert response.json()["filename"] == image_name
async def test_same_image_is_uploaded(self, app: FastAPI, client: AsyncClient, qcow2_image: str) -> None:
image_name = os.path.basename(qcow2_image)
with open(qcow2_image, "rb") as f:
image_data = f.read()
response = await client.post(
app.url_path_for("upload_image", image_path=image_name),
content=image_data)
assert response.status_code == status.HTTP_201_CREATED
# async def test_same_image_is_uploaded(self, app: FastAPI, client: AsyncClient, qcow2_image: str) -> None:
#
# image_name = os.path.basename(qcow2_image)
# with open(qcow2_image, "rb") as f:
# image_data = f.read()
# response = await client.post(
# app.url_path_for("upload_image", image_path=image_name),
# content=image_data)
# assert response.status_code == status.HTTP_201_CREATED
async def test_image_delete(self, app: FastAPI, client: AsyncClient, qcow2_image: str) -> None:
@@ -212,7 +212,6 @@ class TestImageRoutes:
@pytest.mark.parametrize(
"subdir, expected_result",
(
("subdir", status.HTTP_201_CREATED),
("subdir", status.HTTP_201_CREATED),
("subdir2", status.HTTP_201_CREATED),
),
+82
View File
@@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import pytest
import uuid
import pytest_asyncio
from typing import Tuple
@@ -423,3 +424,84 @@ class TestLinkRoutes:
assert mock.called
assert response.status_code == status.HTTP_200_OK
assert response.json() == FILTERS
async def test_get_udp_interface(self, app: FastAPI, client: AsyncClient, project: Project) -> None:
"""
Test getting UDP tunnel interface information from a link.
"""
link = Link(project)
project._links = {link.id: link}
cloud_node = MagicMock()
cloud_node.node_type = "cloud"
cloud_node.id = str(uuid.uuid4())
cloud_node.name = "Cloud1"
compute = MagicMock()
response = MagicMock()
response.json = {
"ports_mapping": [
{
"port_number": 1,
"type": "udp",
"lport": 20000,
"rhost": "127.0.0.1",
"rport": 30000,
"name": "UDP tunnel 1"
}
]
}
compute.get = AsyncioMagicMock(return_value=response)
cloud_node.compute = compute
link._nodes = [{"node": cloud_node, "port_number": 1}]
response = await client.get(app.url_path_for("get_iface", project_id=project.id, link_id=link.id))
assert response.status_code == status.HTTP_200_OK
result = response.json()
assert result["node_id"] == cloud_node.id
assert result["lport"] == 20000
assert result["rhost"] == "127.0.0.1"
assert result["rport"] == 30000
assert result["type"] == "udp"
async def test_get_ethernet_interface(self, app: FastAPI, client: AsyncClient, project: Project) -> None:
"""
Test getting ethernet interface information from a link.
"""
link = Link(project)
project._links = {link.id: link}
cloud_node = MagicMock()
cloud_node.node_type = "cloud"
cloud_node.id = str(uuid.uuid4())
cloud_node.name = "Cloud1"
compute = MagicMock()
response = MagicMock()
response.json = {
"ports_mapping": [
{
"port_number": 1,
"type": "ethernet",
"interface": "eth0",
"name": "Ethernet 1"
}
]
}
compute.get = AsyncioMagicMock(return_value=response)
cloud_node.compute = compute
link._nodes = [{"node": cloud_node, "port_number": 1}]
response = await client.get(app.url_path_for("get_iface", project_id=project.id, link_id=link.id))
assert response.status_code == status.HTTP_200_OK
result = response.json()
assert result["node_id"] == cloud_node.id
assert result["interface"] == "eth0"
assert result["type"] == "ethernet"
+3 -5
View File
@@ -303,7 +303,7 @@ class TestControllerProjectRoutes:
params={"include_images": "yes"})
assert response.status_code == status.HTTP_200_OK
assert response.headers['CONTENT-TYPE'] == 'application/gns3project'
assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name)
assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{name}.gns3project"; filename*=UTF-8\'\'{name}.gns3project'.format(name=project.name)
with open(str(tmpdir / 'project.zip'), 'wb+') as f:
f.write(response.content)
@@ -346,8 +346,7 @@ class TestControllerProjectRoutes:
params={"include_images": "0"})
assert response.status_code == status.HTTP_200_OK
assert response.headers['CONTENT-TYPE'] == 'application/gns3project'
assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name)
assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{name}.gns3project"; filename*=UTF-8\'\'{name}.gns3project'.format(name=project.name)
with open(str(tmpdir / 'project.zip'), 'wb+') as f:
f.write(response.content)
@@ -412,8 +411,7 @@ class TestControllerProjectRoutes:
if response.status_code == status.HTTP_200_OK:
assert response.headers['CONTENT-TYPE'] == 'application/gns3project'
assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name)
assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{name}.gns3project"; filename*=UTF-8\'\'{name}.gns3project'.format(name=project.name)
with open(str(tmpdir / 'project.zip'), 'wb+') as f:
f.write(response.content)
+1 -1
View File
@@ -183,7 +183,7 @@ class TestAuthTokens:
jwt_secret = config.settings.Controller.jwt_secret_key
token = auth_service.create_access_token(test_user.username)
with pytest.raises(ValueError):
jwt.decode(token, jwt_secret, algorithms=["ES256"])
jwt.decode(token, jwt_secret, algorithms=["HS256"])
async def test_can_retrieve_username_from_token(
self,
+24 -5
View File
@@ -49,7 +49,7 @@ async def test_query_success(vm):
vm._session.request = AsyncioMagicMock(return_value=response)
data = await vm.query("POST", "test", data={"a": True}, params={"b": 1})
vm._session.request.assert_called_with('POST',
'http://docker/v1.25/test',
'http://docker/v{}/test'.format(DOCKER_MINIMUM_API_VERSION),
data='{"a": true}',
headers={'content-type': 'application/json'},
params={'b': 1},
@@ -72,7 +72,7 @@ async def test_query_error(vm):
with pytest.raises(DockerError):
await vm.query("POST", "test", data={"a": True}, params={"b": 1})
vm._session.request.assert_called_with('POST',
'http://docker/v1.25/test',
'http://docker/v{}/test'.format(DOCKER_MINIMUM_API_VERSION),
data='{"a": true}',
headers={'content-type': 'application/json'},
params={'b': 1},
@@ -93,7 +93,7 @@ async def test_query_error_json(vm):
with pytest.raises(DockerError):
await vm.query("POST", "test", data={"a": True}, params={"b": 1})
vm._session.request.assert_called_with('POST',
'http://docker/v1.25/test',
'http://docker/v{}/test'.format(DOCKER_MINIMUM_API_VERSION),
data='{"a": true}',
headers={'content-type': 'application/json'},
params={'b': 1},
@@ -188,7 +188,9 @@ async def test_docker_check_connection_docker_minimum_version(vm):
async def test_docker_check_connection_docker_preferred_version_against_newer(vm):
response = {
'ApiVersion': '1.31'
'ApiVersion': '1.52',
'Version': '29.0.1',
}
with patch("gns3server.compute.docker.Docker.connector"), \
@@ -202,7 +204,9 @@ async def test_docker_check_connection_docker_preferred_version_against_newer(vm
async def test_docker_check_connection_docker_preferred_version_against_older(vm):
response = {
'ApiVersion': '1.27',
'ApiVersion': '1.43',
'Version': '24.0.2',
'MinAPIVersion': '1.40'
}
with patch("gns3server.compute.docker.Docker.connector"), \
@@ -212,6 +216,21 @@ async def test_docker_check_connection_docker_preferred_version_against_older(vm
assert vm._api_version == DOCKER_MINIMUM_API_VERSION
@pytest.mark.asyncio
async def test_docker_check_connection_docker_unsupported_version(vm):
response = {
'ApiVersion': '1.25',
'Version': '1.13.1',
}
with patch("gns3server.compute.docker.Docker.connector"), \
asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response):
vm._connected = False
with pytest.raises(DockerError) as e:
await vm._check_connection()
@pytest.mark.asyncio
async def test_install_busybox():
+18 -18
View File
@@ -99,7 +99,7 @@ async def test_create(compute_project, manager):
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest")
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -150,7 +150,7 @@ async def test_create_with_tag(compute_project, manager):
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:16.04")
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -204,7 +204,7 @@ async def test_create_vnc(compute_project, manager):
vm._start_vnc = MagicMock()
vm._display = 42
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -356,7 +356,7 @@ async def test_create_start_cmd(compute_project, manager):
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest")
vm._start_command = "/bin/ls"
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -469,7 +469,7 @@ async def test_create_image_not_available(compute_project, manager):
with asyncio_patch("gns3server.compute.docker.DockerVM.pull_image", return_value=True) as mock_pull:
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -524,7 +524,7 @@ async def test_create_with_user(compute_project, manager):
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest")
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -624,7 +624,7 @@ async def test_create_with_extra_volumes_duplicate_1_image(compute_project, mana
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", extra_volumes=["/vol/1"])
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -680,7 +680,7 @@ async def test_create_with_extra_volumes_duplicate_2_user(compute_project, manag
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", extra_volumes=["/vol/1", "/vol/1"])
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -736,7 +736,7 @@ async def test_create_with_extra_volumes_duplicate_3_subdir(compute_project, man
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", extra_volumes=["/vol/1/", "/vol"])
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -792,7 +792,7 @@ async def test_create_with_extra_volumes_duplicate_4_backslash(compute_project,
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", extra_volumes=["/vol//", "/vol"])
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -848,7 +848,7 @@ async def test_create_with_extra_volumes_duplicate_5_subdir_issue_1595(compute_p
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", extra_volumes=["/etc"])
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -899,7 +899,7 @@ async def test_create_with_extra_volumes_duplicate_6_subdir_issue_1595(compute_p
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", extra_volumes=["/etc/test", "/etc"])
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -956,7 +956,7 @@ async def test_create_with_extra_volumes(compute_project, manager):
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", extra_volumes=["/vol/2"])
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -1243,7 +1243,7 @@ async def test_update(vm):
await vm.update()
mock_query.assert_any_call("DELETE", "containers/e90e34656842", params={"force": 1, "v": 1})
mock_query.assert_any_call("POST", "containers/create", data={
mock_query.assert_any_call("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -1325,7 +1325,7 @@ async def test_update_running(vm):
await vm.update()
mock_query.assert_any_call("DELETE", "containers/e90e34656842", params={"force": 1, "v": 1})
mock_query.assert_any_call("POST", "containers/create", data={
mock_query.assert_any_call("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -1685,7 +1685,7 @@ async def test_start_vnc(vm):
with asyncio_patch("asyncio.create_subprocess_exec") as mock_exec:
await vm._start_vnc()
assert vm._display is not None
assert mock_exec.call_args[0] == ("/bin/Xtigervnc", "-extension", "MIT-SHM", "-geometry", vm.console_resolution, "-depth", "16", "-interface", "127.0.0.1", "-rfbport", str(vm.console), "-AlwaysShared", "-SecurityTypes", "None", ":{}".format(vm._display))
assert mock_exec.call_args[0] == ("/bin/Xtigervnc", "-extension", "MIT-SHM", "-geometry", vm.console_resolution, "-depth", "16", "-interface", "127.0.0.1", "-rfbport", str(vm.console), "-AlwaysShared", "-SecurityTypes", "None", "-desktop", "test", ":{}".format(vm._display))
mock_wait.assert_called_with("/tmp/.X11-unix/X{}".format(vm._display))
@@ -1791,7 +1791,7 @@ async def test_cpus(compute_project, manager):
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", cpus=0.5)
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
@@ -1842,7 +1842,7 @@ async def test_memory(compute_project, manager):
with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock:
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", memory=32)
await vm.create()
mock.assert_called_with("POST", "containers/create", data={
mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={
"Tty": True,
"OpenStdin": True,
"StdinOnce": False,
+39 -55
View File
@@ -401,16 +401,20 @@ async def test_uefi_boot_mode_option(vm, tmpdir, images_dir, fake_qemu_img_binar
vm._uefi = True
# create fake OVMF files
ovmf_code_path = os.path.join(images_dir, "OVMF_CODE.fd")
with open(ovmf_code_path, "w+") as f:
f.write('1')
ovmf_vars_path = os.path.join(images_dir, "OVMF_VARS.fd")
system_ovmf_firmware_path = "/usr/share/OVMF/OVMF_CODE_4M.fd"
if os.path.exists(system_ovmf_firmware_path):
ovmf_code_path = system_ovmf_firmware_path
else:
ovmf_code_path = os.path.join(images_dir, "OVMF_CODE_4M.fd")
with open(ovmf_code_path, "w+") as f:
f.write('1')
ovmf_vars_path = os.path.join(images_dir, "OVMF_VARS_4M.fd")
with open(ovmf_vars_path, "w+") as f:
f.write('1')
options = await vm._build_command()
assert ' '.join(["-drive", "if=pflash,format=raw,readonly,file={}".format(ovmf_code_path)]) in ' '.join(options)
assert ' '.join(["-drive", "if=pflash,format=raw,file={}".format(os.path.join(vm.working_dir, "OVMF_VARS.fd"))]) in ' '.join(options)
assert ' '.join(["-drive", "if=pflash,format=raw,file={}".format(os.path.join(vm.working_dir, "OVMF_VARS_4M.fd"))]) in ' '.join(options)
@pytest.mark.asyncio
@@ -566,7 +570,11 @@ async def test_build_command(vm, fake_qemu_binary):
"-net",
"none",
"-device",
"e1000,mac={},netdev=gns3-0".format(vm._mac_address),
"i82801b11-bridge,id=dmi_pci_bridge1",
"-device",
"pci-bridge,id=pci-bridge1,bus=dmi_pci_bridge1,chassis_nr=0x1,addr=0x1,shpc=off",
"-device",
"e1000,mac={},bus=pci-bridge1,addr=0x00,netdev=gns3-0".format(vm._mac_address),
"-netdev",
"socket,id=gns3-0,udp=127.0.0.1:{},localaddr=127.0.0.1:{}".format(nio.rport, nio.lport),
"-display",
@@ -589,40 +597,16 @@ async def test_build_command_manual_uuid(vm):
@pytest.mark.asyncio
async def test_build_command_kvm(linux_platform, vm, fake_qemu_binary):
async def test_build_command_kvm_below_2_4(linux_platform, vm, fake_qemu_binary):
"""
Qemu 2.4 introduce an issue with KVM
"""
vm.manager.get_qemu_version = AsyncioMagicMock(return_value="2.3.2")
os.environ["DISPLAY"] = "0:0"
with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM._run_with_hardware_acceleration", return_value=True):
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()) as process:
cmd = await vm._build_command()
nio = vm._local_udp_tunnels[0][0]
assert cmd == [
fake_qemu_binary,
"-name",
"test",
"-m",
"256M",
"-smp",
"cpus=1,maxcpus=1,sockets=1",
"-enable-kvm",
"-boot",
"order=c",
"-uuid",
vm.id,
"-serial",
"telnet:127.0.0.1:{},server,nowait".format(vm._internal_console_port),
"-net",
"none",
"-device",
"e1000,mac={},netdev=gns3-0".format(vm._mac_address),
"-netdev",
"socket,id=gns3-0,udp=127.0.0.1:{},localaddr=127.0.0.1:{}".format(nio.rport, nio.lport),
"-nographic"
]
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()):
with pytest.raises(QemuError):
await vm._build_command()
@pytest.mark.asyncio
@@ -657,7 +641,11 @@ async def test_build_command_kvm_2_4(linux_platform, vm, fake_qemu_binary):
"-net",
"none",
"-device",
"e1000,mac={},netdev=gns3-0".format(vm._mac_address),
"i82801b11-bridge,id=dmi_pci_bridge1",
"-device",
"pci-bridge,id=pci-bridge1,bus=dmi_pci_bridge1,chassis_nr=0x1,addr=0x1,shpc=off",
"-device",
"e1000,mac={},bus=pci-bridge1,addr=0x00,netdev=gns3-0".format(vm._mac_address),
"-netdev",
"socket,id=gns3-0,udp=127.0.0.1:{},localaddr=127.0.0.1:{}".format(nio.rport, nio.lport),
"-nographic"
@@ -701,11 +689,15 @@ async def test_build_command_two_adapters(vm, fake_qemu_binary):
"-net",
"none",
"-device",
"e1000,mac={},netdev=gns3-0".format(vm._mac_address),
"i82801b11-bridge,id=dmi_pci_bridge1",
"-device",
"pci-bridge,id=pci-bridge1,bus=dmi_pci_bridge1,chassis_nr=0x1,addr=0x1,shpc=off",
"-device",
"e1000,mac={},bus=pci-bridge1,addr=0x00,netdev=gns3-0".format(vm._mac_address),
"-netdev",
"socket,id=gns3-0,udp=127.0.0.1:{},localaddr=127.0.0.1:{}".format(nio1.rport, nio1.lport),
"-device",
"e1000,mac={},netdev=gns3-1".format(int_to_macaddress(macaddress_to_int(vm._mac_address) + 1)),
"e1000,mac={},bus=pci-bridge1,addr=0x01,netdev=gns3-1".format(int_to_macaddress(macaddress_to_int(vm._mac_address) + 1)),
"-netdev",
"socket,id=gns3-1,udp=127.0.0.1:{},localaddr=127.0.0.1:{}".format(nio2.rport, nio2.lport),
"-nographic"
@@ -725,8 +717,8 @@ async def test_build_command_two_adapters_mac_address(vm):
assert mac_0[:8] == "00:00:ab"
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()):
cmd = await vm._build_command()
assert "e1000,mac={},netdev=gns3-0".format(mac_0) in cmd
assert "e1000,mac={},netdev=gns3-1".format(mac_1) in cmd
assert "e1000,mac={},bus=pci-bridge1,addr=0x00,netdev=gns3-0".format(mac_0) in cmd
assert "e1000,mac={},bus=pci-bridge1,addr=0x01,netdev=gns3-1".format(mac_1) in cmd
vm.mac_address = "00:42:ab:0e:0f:0a"
mac_0 = vm._mac_address
@@ -735,8 +727,8 @@ async def test_build_command_two_adapters_mac_address(vm):
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()):
cmd = await vm._build_command()
assert "e1000,mac={},netdev=gns3-0".format(mac_0) in cmd
assert "e1000,mac={},netdev=gns3-1".format(mac_1) in cmd
assert "e1000,mac={},bus=pci-bridge1,addr=0x00,netdev=gns3-0".format(mac_0) in cmd
assert "e1000,mac={},bus=pci-bridge1,addr=0x01,netdev=gns3-1".format(mac_1) in cmd
@pytest.mark.asyncio
@@ -758,28 +750,20 @@ async def test_build_command_large_number_of_adapters(vm):
assert len([l for l in cmd if "e1000" in l ]) == 100
assert len(vm._ethernet_adapters) == 100
assert "e1000,mac={},netdev=gns3-0".format(mac_0) in cmd
assert "e1000,mac={},netdev=gns3-1".format(mac_1) in cmd
assert "e1000,mac={},bus=pci-bridge1,addr=0x00,netdev=gns3-0".format(mac_0) in cmd
assert "e1000,mac={},bus=pci-bridge1,addr=0x01,netdev=gns3-1".format(mac_1) in cmd
assert "pci-bridge,id=pci-bridge0,bus=dmi_pci_bridge0,chassis_nr=0x1,addr=0x0,shpc=off" not in cmd
assert "pci-bridge,id=pci-bridge1,bus=dmi_pci_bridge1,chassis_nr=0x1,addr=0x1,shpc=off" in cmd
assert "pci-bridge,id=pci-bridge2,bus=dmi_pci_bridge2,chassis_nr=0x1,addr=0x2,shpc=off" in cmd
assert "i82801b11-bridge,id=dmi_pci_bridge1" in cmd
mac_29 = int_to_macaddress(macaddress_to_int(vm._mac_address) + 29)
assert "e1000,mac={},bus=pci-bridge1,addr=0x04,netdev=gns3-29".format(mac_29) in cmd
assert "e1000,mac={},bus=pci-bridge1,addr=0x1d,netdev=gns3-29".format(mac_29) in cmd
mac_30 = int_to_macaddress(macaddress_to_int(vm._mac_address) + 30)
assert "e1000,mac={},bus=pci-bridge1,addr=0x05,netdev=gns3-30".format(mac_30) in cmd
assert "e1000,mac={},bus=pci-bridge1,addr=0x1e,netdev=gns3-30".format(mac_30) in cmd
mac_74 = int_to_macaddress(macaddress_to_int(vm._mac_address) + 74)
assert "e1000,mac={},bus=pci-bridge2,addr=0x11,netdev=gns3-74".format(mac_74) in cmd
assert "e1000,mac={},bus=pci-bridge3,addr=0x0a,netdev=gns3-74".format(mac_74) in cmd
# Qemu < 2.4 doesn't support large number of adapters
vm.manager.get_qemu_version = AsyncioMagicMock(return_value="2.0.0")
with pytest.raises(QemuError):
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()):
await vm._build_command()
vm.adapters = 5
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()):
await vm._build_command()
@pytest.mark.asyncio
async def test_build_command_with_virtio_net_pci_adapter(vm):
@@ -792,7 +776,7 @@ async def test_build_command_with_virtio_net_pci_adapter(vm):
vm._adapter_type = "virtio-net-pci"
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()):
cmd = await vm._build_command()
assert "virtio-net-pci,mac=00:00:ab:0e:0f:09,speed=10000,duplex=full,netdev=gns3-0" in cmd
assert "virtio-net-pci,mac=00:00:ab:0e:0f:09,speed=10000,duplex=full,bus=pci-bridge1,addr=0x00,netdev=gns3-0" in cmd
@pytest.mark.asyncio
+2 -4
View File
@@ -18,11 +18,9 @@
import asyncio
import pytest
import sys
from unittest.mock import MagicMock
from gns3server.utils.asyncio import wait_run_in_executor, subprocess_check_output, wait_for_process_termination, locking
from tests.utils import AsyncioMagicMock
from gns3server.utils.asyncio import wait_run_in_executor, subprocess_check_output, locking
@pytest.mark.asyncio
+1 -1
View File
@@ -1,4 +1,4 @@
-r requirements.txt
pywin32==306
pywin32==311
wmi==1.5.1