Can't stop VM via GUI

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
Is there any possibility to stop VM via CLI in TrueNAS-12.0-RC1 because I can't do it via GUI?

When I try to stop VM - I've got an error

An error occurred, but the cause is unknown
remove_circle_outlineMore info...

Error: Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/middlewared/job.py", line 361, in run
await self.future
File "/usr/local/lib/python3.8/site-packages/middlewared/job.py", line 399, in __run_body
rv = await self.middleware.run_in_thread(self.method, *([self] + args))
File "/usr/local/lib/python3.8/site-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread
return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs))
File "/usr/local/lib/python3.8/site-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 977, in nf
return f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/vm.py", line 1563, in stop
vm.stop(vm_data['shutdown_timeout'])
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/vm.py", line 251, in stop
self.domain.shutdown()
File "/usr/local/lib/python3.8/site-packages/libvirt.py", line 2659, in shutdown
if ret == -1: raise libvirtError ('virDomainShutdown() failed', dom=self)
libvirt.libvirtError: An error occurred, but the cause is unknown


Force stop VM not working too and I can't connect to VM via VNC
 
Last edited:

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
Tried to stop VM via CLI
# virsh destroy "5_win"
# error: Failed to destroy domain 5_win
# error: internal error: Child process (/usr/sbin/bhyvectl --destroy --vm=5_win) unexpected exit status 1
 

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
Same. Did you get anywhere with this?
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32

0x766c6164

Cadet
Joined
Dec 9, 2020
Messages
1
Hello, I have just encountered this issue and think I found a quick (and ugly?) workaround.

First I tried the `virsh destroy` command that @m0t0rh3ad mentioned, to no avail. Afterwards I tried manually running `/usr/sbin/bhyvectl --destroy --vm=id_name` as well to check the output. Apparently bhyve says that the VM was not created, same goes for every other argument (--force-poweroff, --force-reset). Therefore, I ran `bhyvectl --vm=id_name --create` and after that I was able to clean reboot via GUI.

In the end I can VNC or ssh inside the VM without any issues.
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
Hello, I have just encountered this issue and think I found a quick (and ugly?) workaround.

First I tried the `virsh destroy` command that @m0t0rh3ad mentioned, to no avail. Afterwards I tried manually running `/usr/sbin/bhyvectl --destroy --vm=id_name` as well to check the output. Apparently bhyve says that the VM was not created, same goes for every other argument (--force-poweroff, --force-reset). Therefore, I ran `bhyvectl --vm=id_name --create` and after that I was able to clean reboot via GUI.

In the end I can VNC or ssh inside the VM without any issues.
This helps me. Thanks!
 

ctphillips

Dabbler
Joined
Apr 20, 2012
Messages
12
I just encountered this issue myself in TrueNAS-12.0-U7. 0x766c6164's command bhyvectl --vm=id_name --create unfortunately did not work. It just returned errno = 1 Thankfully I was able to simply "power off" the VM in the GUI. This worked and the VM rebooted properly. It wasn't a clean shut down, but it worked.
 
Top