mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
IOUCON start when vm start
This commit is contained in:
1 parent
986c63f344
commit
faa7472670
4 files changed
+17
-9
No files matched your search
@@ -46,10 +46,10 @@ class IOUHandler:
|
||||
|
||||
iou = IOU.instance()
|
||||
vm = yield from iou.create_vm(request.json["name"],
|
||||
request.match_info["project_id"],
|
||||
request.json.get("vm_id"),
|
||||
console=request.json.get("console"),
|
||||
)
|
||||
request.match_info["project_id"],
|
||||
request.json.get("vm_id"),
|
||||
console=request.json.get("console"),
|
||||
)
|
||||
vm.iou_path = request.json.get("iou_path", vm.iou_path)
|
||||
vm.iourc_path = request.json.get("iourc_path", vm.iourc_path)
|
||||
response.set_status(201)
|
||||
|
||||
@@ -27,12 +27,15 @@ import signal
|
||||
import re
|
||||
import asyncio
|
||||
import shutil
|
||||
import argparse
|
||||
import threading
|
||||
|
||||
from pkg_resources import parse_version
|
||||
from .iou_error import IOUError
|
||||
from ..adapters.ethernet_adapter import EthernetAdapter
|
||||
from ..adapters.serial_adapter import SerialAdapter
|
||||
from ..base_vm import BaseVM
|
||||
from .ioucon import start_ioucon
|
||||
|
||||
|
||||
import logging
|
||||
@@ -50,9 +53,12 @@ class IOUVM(BaseVM):
|
||||
:param project: Project instance
|
||||
:param manager: parent VM Manager
|
||||
:param console: TCP console port
|
||||
:params console_host: TCP console host IP
|
||||
"""
|
||||
|
||||
def __init__(self, name, vm_id, project, manager, console=None):
|
||||
def __init__(self, name, vm_id, project, manager,
|
||||
console=None,
|
||||
console_host="0.0.0.0"):
|
||||
|
||||
super().__init__(name, vm_id, project, manager)
|
||||
|
||||
@@ -65,6 +71,7 @@ class IOUVM(BaseVM):
|
||||
self._iou_path = None
|
||||
self._iourc_path = None
|
||||
self._ioucon_thread = None
|
||||
self._console_host = console_host
|
||||
|
||||
# IOU settings
|
||||
self._ethernet_adapters = [EthernetAdapter(), EthernetAdapter()] # one adapter = 4 interfaces
|
||||
@@ -292,7 +299,7 @@ class IOUVM(BaseVM):
|
||||
raise IOUError("could not start IOU {}: {}\n{}".format(self._iou_path, e, iou_stdout))
|
||||
|
||||
# start console support
|
||||
# self._start_ioucon()
|
||||
self._start_ioucon()
|
||||
# connections support
|
||||
# self._start_iouyap()
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ EXIT_ABORT = 2
|
||||
|
||||
# Mostly from:
|
||||
# https://code.google.com/p/miniboa/source/browse/trunk/miniboa/telnet.py
|
||||
#--[ Telnet Commands ]---------------------------------------------------------
|
||||
# --[ Telnet Commands ]---------------------------------------------------------
|
||||
SE = 240 # End of sub-negotiation parameters
|
||||
NOP = 241 # No operation
|
||||
DATMK = 242 # Data stream portion of a sync.
|
||||
@@ -74,7 +74,7 @@ DONT = 254 # Don't = Demand or confirm option halt
|
||||
IAC = 255 # Interpret as Command
|
||||
SEND = 1 # Sub-process negotiation SEND command
|
||||
IS = 0 # Sub-process negotiation IS command
|
||||
#--[ Telnet Options ]----------------------------------------------------------
|
||||
# --[ Telnet Options ]----------------------------------------------------------
|
||||
BINARY = 0 # Transmit Binary
|
||||
ECHO = 1 # Echo characters back to sender
|
||||
RECON = 2 # Reconnection
|
||||
Reference in new issue
Block a user