Creating a VM doesn't check for already used ports on the displays

Description

Created a new VM. But was met with the following. This makes me believe that the assignment of VNC port, doesn't check for what is actually used and/or already asigned to other VMs.

was previously reported in ticket .

This VM has been assigned port 5903. But when I look through the other VMs, none have that port assiged to them. Same with the web_port (5915).

Error: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor.py", line 172, in start
if self.domain.create() < 0:
File "/usr/lib/python3/dist-packages/libvirt.py", line 1353, in create
raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2023-09-29T11:22:49.897516Z qemu-system-x86_64: -vnc 192.168.80.10:3: Failed to find an available port: Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 204, in call_method
result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self)
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1344, in _call
return await methodobj(*prepared_call.args)
File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1378, in nf
return await func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1246, in nf
res = await f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_lifecycle.py", line 46, in start
await self.middleware.run_in_thread(self._start, vm['name'])
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1261, in run_in_thread
return await self.run_in_executor(self.thread_pool_executor, method, *args, **kwargs)
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1258, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_supervisor.py", line 68, in _start
self.vms[vm_name].start(vm_data=self._vm_from_name(vm_name))
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor.py", line 181, in start
raise CallError('\n'.join(errors))
middlewared.service_exception.CallError: [EFAULT] internal error: qemu unexpectedly closed the monitor: 2023-09-29T11:22:49.897516Z qemu-system-x86_64: -vnc 192.168.80.10:3: Failed to find an available port: Address already in use

Problem/Justification

None

Impact

None

Activity

Show:

Automation for Jira October 13, 2023 at 6:17 PM

This issue has now been closed. Comments made after this point may not be viewed by the TrueNAS Teams. Please open a new issue if you have found a problem or need to re-engage with the TrueNAS Engineering Teams.

Bug Clerk October 13, 2023 at 2:59 PM

JR October 7, 2023 at 7:34 AM

new debug attached too

JR October 7, 2023 at 7:30 AM

Using 22.12.4

Didn’t get errors when using clones from existing VMs.. However, I’ve pruned unused VM’s since the initial bug report.

But I tried creating a new one. And recieved the following.

William Gryzbowski October 6, 2023 at 4:52 PM

Would be interesting to know if this is still applicable in 22.12.4 or even 23.10-RC.1.

Complete
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Ready For Review?

True

Time remaining

0m

Components

Priority

Katalon Platform

Created September 29, 2023 at 11:34 AM
Updated October 13, 2023 at 7:38 PM
Resolved October 13, 2023 at 6:17 PM