1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Default NVRAM and Idle-PC for some IOS images.

This commit is contained in:
Jeremy 2015-02-21 17:24:39 -07:00
parent 9a745ed3f4
commit 565a7b35a6
10 changed files with 18 additions and 17 deletions

View File

@ -106,6 +106,7 @@ class DynamipsVMHandler:
vm = dynamips_manager.get_vm(request.match_info["vm_id"], project_id=request.match_info["project_id"]) vm = dynamips_manager.get_vm(request.match_info["vm_id"], project_id=request.match_info["project_id"])
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)
response.json(vm) response.json(vm)
@classmethod @classmethod

View File

@ -410,7 +410,7 @@ class Dynamips(BaseManager):
raise DynamipsError("mmap support is required to enable ghost IOS support") raise DynamipsError("mmap support is required to enable ghost IOS support")
if vm.platform == "c7200" and vm.npe == "npe-g2": if vm.platform == "c7200" and vm.npe == "npe-g2":
log.warning("Ghost IOS is not support for c7200 with NPE-G2") log.warning("Ghost IOS is not supported for c7200 with NPE-G2")
return return
ghost_file = vm.formatted_ghost_file() ghost_file = vm.formatted_ghost_file()
@ -530,7 +530,6 @@ class Dynamips(BaseManager):
try: try:
with open(path, "w") as f: with open(path, "w") as f:
log.info("Creating config file {}".format(path))
f.write(content) f.write(content)
except OSError as e: except OSError as e:
raise DynamipsError("Could not create config file {}: {}".format(path, e)) raise DynamipsError("Could not create config file {}: {}".format(path, e))

View File

@ -47,8 +47,8 @@ class C1700(Router):
def __init__(self, name, vm_id, project, manager, dynamips_id, chassis="1720"): def __init__(self, name, vm_id, project, manager, dynamips_id, chassis="1720"):
Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c1700") Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c1700")
# Set default values for this platform # Set default values for this platform (must be the same as Dynamips)
self._ram = 128 self._ram = 64
self._nvram = 32 self._nvram = 32
self._disk0 = 0 self._disk0 = 0
self._disk1 = 0 self._disk1 = 0

View File

@ -62,8 +62,8 @@ class C2600(Router):
def __init__(self, name, vm_id, project, manager, dynamips_id, chassis="2610"): def __init__(self, name, vm_id, project, manager, dynamips_id, chassis="2610"):
Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c2600") Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c2600")
# Set default values for this platform # Set default values for this platform (must be the same as Dynamips)
self._ram = 128 self._ram = 64
self._nvram = 128 self._nvram = 128
self._disk0 = 0 self._disk0 = 0
self._disk1 = 0 self._disk1 = 0

View File

@ -43,8 +43,8 @@ class C2691(Router):
def __init__(self, name, vm_id, project, manager, dynamips_id): def __init__(self, name, vm_id, project, manager, dynamips_id):
Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c2691") Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c2691")
# Set default values for this platform # Set default values for this platform (must be the same as Dynamips)
self._ram = 192 self._ram = 128
self._nvram = 112 self._nvram = 112
self._disk0 = 16 self._disk0 = 16
self._disk1 = 0 self._disk1 = 0

View File

@ -45,8 +45,8 @@ class C3600(Router):
def __init__(self, name, vm_id, project, manager, dynamips_id, chassis="3640"): def __init__(self, name, vm_id, project, manager, dynamips_id, chassis="3640"):
Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c3600") Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c3600")
# Set default values for this platform # Set default values for this platform (must be the same as Dynamips)
self._ram = 192 self._ram = 128
self._nvram = 128 self._nvram = 128
self._disk0 = 0 self._disk0 = 0
self._disk1 = 0 self._disk1 = 0

View File

@ -43,7 +43,7 @@ class C3725(Router):
def __init__(self, name, vm_id, project, manager, dynamips_id): def __init__(self, name, vm_id, project, manager, dynamips_id):
Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c3725") Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c3725")
# Set default values for this platform # Set default values for this platform (must be the same as Dynamips)
self._ram = 128 self._ram = 128
self._nvram = 112 self._nvram = 112
self._disk0 = 16 self._disk0 = 16

View File

@ -43,8 +43,8 @@ class C3745(Router):
def __init__(self, name, vm_id, project, manager, dynamips_id): def __init__(self, name, vm_id, project, manager, dynamips_id):
Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c3745") Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c3745")
# Set default values for this platform # Set default values for this platform (must be the same as Dynamips)
self._ram = 256 self._ram = 128
self._nvram = 304 self._nvram = 304
self._disk0 = 16 self._disk0 = 16
self._disk1 = 0 self._disk1 = 0

View File

@ -47,8 +47,8 @@ class C7200(Router):
def __init__(self, name, vm_id, project, manager, dynamips_id, npe="npe-400"): def __init__(self, name, vm_id, project, manager, dynamips_id, npe="npe-400"):
Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c7200") Router.__init__(self, name, vm_id, project, manager, dynamips_id, platform="c7200")
# Set default values for this platform # Set default values for this platform (must be the same as Dynamips)
self._ram = 512 self._ram = 256
self._nvram = 128 self._nvram = 128
self._disk0 = 64 self._disk0 = 64
self._disk1 = 0 self._disk1 = 0

View File

@ -308,6 +308,7 @@ class Router(BaseVM):
if self._dynamips_id in self._dynamips_ids[self._project.id]: if self._dynamips_id in self._dynamips_ids[self._project.id]:
self._dynamips_ids[self._project.id].remove(self._dynamips_id) self._dynamips_ids[self._project.id].remove(self._dynamips_id)
if self in self._hypervisor.devices:
self._hypervisor.devices.remove(self) self._hypervisor.devices.remove(self)
if self._hypervisor and not self._hypervisor.devices: if self._hypervisor and not self._hypervisor.devices:
try: try:
@ -1478,7 +1479,7 @@ class Router(BaseVM):
""" """
try: try:
reply = yield from self._hypervisor.send("vm extract_config {}".format(self._name)) reply = yield from self._hypervisor.send('vm extract_config "{}"'.format(self._name))
except DynamipsError: except DynamipsError:
# for some reason Dynamips gets frozen when it does not find the magic number in the NVRAM file. # for some reason Dynamips gets frozen when it does not find the magic number in the NVRAM file.
return None, None return None, None