mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-18 15:28:11 +00:00
Initialize chassis when creating an IOS router. Fixes #107.
This commit is contained in:
@ -58,7 +58,8 @@ class DynamipsVMHandler:
|
|||||||
request.json.get("dynamips_id"),
|
request.json.get("dynamips_id"),
|
||||||
request.json.pop("platform"),
|
request.json.pop("platform"),
|
||||||
console=request.json.get("console"),
|
console=request.json.get("console"),
|
||||||
aux=request.json.get("aux"))
|
aux=request.json.get("aux"),
|
||||||
|
chassis=request.json.pop("chassis", None))
|
||||||
|
|
||||||
yield from dynamips_manager.update_vm_settings(vm, request.json)
|
yield from dynamips_manager.update_vm_settings(vm, request.json)
|
||||||
yield from dynamips_manager.ghost_ios_support(vm)
|
yield from dynamips_manager.ghost_ios_support(vm)
|
||||||
|
@ -23,6 +23,7 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L387
|
|||||||
import asyncio
|
import asyncio
|
||||||
from .router import Router
|
from .router import Router
|
||||||
from ..adapters.gt96100_fe import GT96100_FE
|
from ..adapters.gt96100_fe import GT96100_FE
|
||||||
|
from ..dynamips_error import DynamipsError
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -42,7 +43,7 @@ class C2691(Router):
|
|||||||
:param aux: auxiliary console port
|
:param aux: auxiliary console port
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None):
|
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, chassis=None):
|
||||||
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c2691")
|
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c2691")
|
||||||
|
|
||||||
# Set default values for this platform (must be the same as Dynamips)
|
# Set default values for this platform (must be the same as Dynamips)
|
||||||
@ -56,6 +57,9 @@ class C2691(Router):
|
|||||||
self._create_slots(2)
|
self._create_slots(2)
|
||||||
self._slots[0] = GT96100_FE()
|
self._slots[0] = GT96100_FE()
|
||||||
|
|
||||||
|
if chassis is not None:
|
||||||
|
raise DynamipsError("c2691 routers do not have chassis")
|
||||||
|
|
||||||
def __json__(self):
|
def __json__(self):
|
||||||
|
|
||||||
c2691_router_info = {"iomem": self._iomem}
|
c2691_router_info = {"iomem": self._iomem}
|
||||||
|
@ -23,6 +23,7 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L346
|
|||||||
import asyncio
|
import asyncio
|
||||||
from .router import Router
|
from .router import Router
|
||||||
from ..adapters.gt96100_fe import GT96100_FE
|
from ..adapters.gt96100_fe import GT96100_FE
|
||||||
|
from ..dynamips_error import DynamipsError
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -42,7 +43,7 @@ class C3725(Router):
|
|||||||
:param aux: auxiliary console port
|
:param aux: auxiliary console port
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None):
|
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, chassis=None):
|
||||||
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c3725")
|
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c3725")
|
||||||
|
|
||||||
# Set default values for this platform (must be the same as Dynamips)
|
# Set default values for this platform (must be the same as Dynamips)
|
||||||
@ -56,6 +57,9 @@ class C3725(Router):
|
|||||||
self._create_slots(3)
|
self._create_slots(3)
|
||||||
self._slots[0] = GT96100_FE()
|
self._slots[0] = GT96100_FE()
|
||||||
|
|
||||||
|
if chassis is not None:
|
||||||
|
raise DynamipsError("c3725 routers do not have chassis")
|
||||||
|
|
||||||
def __json__(self):
|
def __json__(self):
|
||||||
|
|
||||||
c3725_router_info = {"iomem": self._iomem}
|
c3725_router_info = {"iomem": self._iomem}
|
||||||
|
@ -23,6 +23,7 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L326
|
|||||||
import asyncio
|
import asyncio
|
||||||
from .router import Router
|
from .router import Router
|
||||||
from ..adapters.gt96100_fe import GT96100_FE
|
from ..adapters.gt96100_fe import GT96100_FE
|
||||||
|
from ..dynamips_error import DynamipsError
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -42,7 +43,7 @@ class C3745(Router):
|
|||||||
:param aux: auxiliary console port
|
:param aux: auxiliary console port
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None):
|
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, chassis=None):
|
||||||
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c3745")
|
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c3745")
|
||||||
|
|
||||||
# Set default values for this platform (must be the same as Dynamips)
|
# Set default values for this platform (must be the same as Dynamips)
|
||||||
@ -56,6 +57,9 @@ class C3745(Router):
|
|||||||
self._create_slots(5)
|
self._create_slots(5)
|
||||||
self._slots[0] = GT96100_FE()
|
self._slots[0] = GT96100_FE()
|
||||||
|
|
||||||
|
if chassis is not None:
|
||||||
|
raise DynamipsError("c3745 routers do not have chassis")
|
||||||
|
|
||||||
def __json__(self):
|
def __json__(self):
|
||||||
|
|
||||||
c3745_router_info = {"iomem": self._iomem}
|
c3745_router_info = {"iomem": self._iomem}
|
||||||
|
@ -22,10 +22,10 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L294
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from ..dynamips_error import DynamipsError
|
|
||||||
from .router import Router
|
from .router import Router
|
||||||
from ..adapters.c7200_io_fe import C7200_IO_FE
|
from ..adapters.c7200_io_fe import C7200_IO_FE
|
||||||
from ..adapters.c7200_io_ge_e import C7200_IO_GE_E
|
from ..adapters.c7200_io_ge_e import C7200_IO_GE_E
|
||||||
|
from ..dynamips_error import DynamipsError
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -46,7 +46,7 @@ class C7200(Router):
|
|||||||
:param npe: Default NPE
|
:param npe: Default NPE
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, npe="npe-400"):
|
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, npe="npe-400", chassis=None):
|
||||||
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c7200")
|
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c7200")
|
||||||
|
|
||||||
# Set default values for this platform (must be the same as Dynamips)
|
# Set default values for this platform (must be the same as Dynamips)
|
||||||
@ -71,6 +71,9 @@ class C7200(Router):
|
|||||||
|
|
||||||
self._create_slots(7)
|
self._create_slots(7)
|
||||||
|
|
||||||
|
if chassis is not None:
|
||||||
|
raise DynamipsError("c7200 routers do not have chassis")
|
||||||
|
|
||||||
def __json__(self):
|
def __json__(self):
|
||||||
|
|
||||||
c7200_router_info = {"npe": self._npe,
|
c7200_router_info = {"npe": self._npe,
|
||||||
|
Reference in New Issue
Block a user