Backport auxiliary console support for Qemu, Docker and Dynamips nodes

This commit is contained in:
grossmj
2024-09-22 18:29:04 +07:00
parent 1f09a3e6bc
commit c41c11eb34
26 changed files with 374 additions and 155 deletions

View File

@ -60,8 +60,9 @@ class DockerVM(BaseNode):
:param manager: Manager instance
:param image: Docker image
:param console: TCP console port
:param console_type: Console type
:param console_type: console type
:param aux: TCP aux console port
:param aux_type: auxiliary console type
:param console_resolution: Resolution of the VNC display
:param console_http_port: Port to redirect HTTP queries
:param console_http_path: Url part with the path of the web interface
@ -70,10 +71,10 @@ class DockerVM(BaseNode):
"""
def __init__(self, name, node_id, project, manager, image, console=None, aux=None, start_command=None,
adapters=None, environment=None, console_type="telnet", console_resolution="1024x768",
adapters=None, environment=None, console_type="telnet", aux_type="none", console_resolution="1024x768",
console_http_port=80, console_http_path="/", extra_hosts=None, extra_volumes=[]):
super().__init__(name, node_id, project, manager, console=console, aux=aux, allocate_aux=True, console_type=console_type)
super().__init__(name, node_id, project, manager, console=console, console_type=console_type, aux=aux, aux_type=aux_type)
# force the latest image if no version is specified
if ":" not in image:
@ -129,6 +130,7 @@ class DockerVM(BaseNode):
"console_http_port": self.console_http_port,
"console_http_path": self.console_http_path,
"aux": self.aux,
"aux_type": self.aux_type,
"start_command": self.start_command,
"status": self.status,
"environment": self.environment,
@ -546,7 +548,7 @@ class DockerVM(BaseNode):
elif self.console_type == "http" or self.console_type == "https":
await self._start_http()
if self.allocate_aux:
if self.aux_type != "none":
await self._start_aux()
self._permissions_fixed = False