Remove Virtual Machines via CLI?

kazjim

Cadet
Joined
Mar 10, 2019
Messages
8
G'day team, crazy situation has occurred . . .

Yesterday I attempted to add a NVS300 GPU to my server, and pass it through to a VM to use for Docker.

Things didn't go well, and I tried to roll the changes out, but now, anytime I even try to EDIT the VM, the console hangs, and the CLI via Putty (SSH) becomes unresponsive. (Even NFS Shares hang)

So, I'd like to delete the VMs and rebuild what I need (Docker-compose, so no issues there.... )

So, is it possible to delete or edit the VMs from the CLI ?

Thanks!



Details : Homebuilt server 1151 i7 /64GB Ram / Dell H310 (IT Mode)/ 8 x 4tb drives.
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,471
If you are using SCALE you can run the "cli" app, and then use something like this:

1644595682728.png


Run "service vm query" first to get a list of the VMs and their ID's.
 

kazjim

Cadet
Joined
Mar 10, 2019
Messages
8
Thanks, have just tried that, and it also froze the system.

Oddly, an error did appear on the screen though.

Screen Shot 2022-02-12 at 9.33.46 am.png
 

kazjim

Cadet
Joined
Mar 10, 2019
Messages
8
Thanks, have just tried that, and it also froze the system. Oddly, an error did appear on the screen though. View attachment 53052

Edit - physically went to server and checked screen, and it was mentioning that boot-pool had uncorrectable errors.

I ended up hard-resetting the box and think i'll jsut have to rebuild from backup config.

Thanks
 

titust1

Explorer
Joined
May 10, 2022
Messages
66
If you are using SCALE you can run the "cli" app, and then use something like this:

View attachment 53041

Run "service vm query" first to get a list of the VMs and their ID's.
Hi,
I am trying the same thing to delete all traces of an old unused VM, but I can't. This VM had the drive on a Pool that does not exist anymore.
I get this
Code:
[diskstation]> service delete 1
Error: This system does not support virtualization.
Any idea?
If I want to delete it in the GUI, I get this:
Code:
Error: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 175, 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 1257, in _call
    return await methodobj(*prepared_call.args)
  File "/usr/lib/python3/dist-packages/middlewared/service.py", line 942, in delete
    rv = await self.middleware._call(
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1257, in _call
    return await methodobj(*prepared_call.args)
  File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1129, in nf
    res = await f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1261, in nf
    return await func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vms.py", line 391, in do_delete
    await self.middleware.run_in_thread(self._check_setup_connection)
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1172, 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 1169, 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/connection.py", line 64, in _check_setup_connection
    self._check_connection_alive()
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/connection.py", line 57, in _check_connection_alive
    self._system_supports_virtualization()
  File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/connection.py", line 54, in _system_supports_virtualization
    raise CallError('This system does not support virtualization.')
middlewared.service_exception.CallError: [EFAULT] This system does not support virtualization.
 
Top