mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 15:21:13 +02:00
Idle-PC proposals for Dynamips.
This commit is contained in:
1 parent
b393948b67
commit
90f71e7581
3 files changed
+32
-8
No files matched your search
@@ -409,6 +409,10 @@ class Dynamips(BaseManager):
|
||||
if not vm.mmap:
|
||||
raise DynamipsError("mmap support is required to enable ghost IOS support")
|
||||
|
||||
if vm.platform == "c7200" and vm.npe == "npe-g2":
|
||||
log.warning("Ghost IOS is not support for c7200 with NPE-G2")
|
||||
return
|
||||
|
||||
ghost_file = vm.formatted_ghost_file()
|
||||
ghost_file_path = os.path.join(vm.hypervisor.working_dir, ghost_file)
|
||||
if ghost_file_path not in self._ghost_files:
|
||||
@@ -418,9 +422,6 @@ class Dynamips(BaseManager):
|
||||
try:
|
||||
yield from ghost.create()
|
||||
yield from ghost.set_image(vm.image)
|
||||
# for 7200s, the NPE must be set when using an NPE-G2.
|
||||
if vm.platform == "c7200":
|
||||
yield from ghost.set_npe(vm.npe)
|
||||
yield from ghost.set_ghost_status(1)
|
||||
yield from ghost.set_ghost_file(ghost_file)
|
||||
yield from ghost.set_ram(vm.ram)
|
||||
@@ -463,7 +464,8 @@ class Dynamips(BaseManager):
|
||||
adapter = ADAPTER_MATRIX[adapter_name]()
|
||||
if vm.slots[slot_id] and type(vm.slots[slot_id]) != type(adapter):
|
||||
yield from vm.slot_remove_binding(slot_id)
|
||||
yield from vm.slot_add_binding(slot_id, adapter)
|
||||
if type(vm.slots[slot_id]) != type(adapter):
|
||||
yield from vm.slot_add_binding(slot_id, adapter)
|
||||
elif name.startswith("slot") and value is None:
|
||||
slot_id = int(name[-1])
|
||||
if vm.slots[slot_id]:
|
||||
@@ -474,7 +476,8 @@ class Dynamips(BaseManager):
|
||||
wic = WIC_MATRIX[wic_name]()
|
||||
if vm.slots[0].wics[wic_slot_id] and type(vm.slots[0].wics[wic_slot_id]) != type(wic):
|
||||
yield from vm.uninstall_wic(wic_slot_id)
|
||||
yield from vm.install_wic(wic_slot_id, wic)
|
||||
if type(vm.slots[0].wics[wic_slot_id]) != type(wic):
|
||||
yield from vm.install_wic(wic_slot_id, wic)
|
||||
elif name.startswith("wic") and value is None:
|
||||
wic_slot_id = int(name[-1])
|
||||
if vm.slots[0].wics and vm.slots[0].wics[wic_slot_id]:
|
||||
|
||||
@@ -305,6 +305,9 @@ class Router(BaseVM):
|
||||
# router is already closed
|
||||
return
|
||||
|
||||
if self._dynamips_id in self._dynamips_ids[self._project.id]:
|
||||
self._dynamips_ids[self._project.id].remove(self._dynamips_id)
|
||||
|
||||
self._hypervisor.devices.remove(self)
|
||||
if self._hypervisor and not self._hypervisor.devices:
|
||||
try:
|
||||
@@ -323,9 +326,6 @@ class Router(BaseVM):
|
||||
self._manager.port_manager.release_console_port(self._aux)
|
||||
self._aux = None
|
||||
|
||||
if self._dynamips_id in self._dynamips_ids[self._project.id]:
|
||||
self._dynamips_ids[self._project.id].remove(self._dynamips_id)
|
||||
|
||||
self._closed = True
|
||||
|
||||
@property
|
||||
|
||||
Reference in new issue
Block a user