Safest way to halt the system

114 views
Skip to first unread message

linode...@tuta.io

unread,
Sep 15, 2017, 11:30:07 AM9/15/17
to qubes...@googlegroups.com
Hi,

I'm coding a qubes service (On Qubes 3.2) that will allow some vms to issue a halt command that should shutdown the system as quick as posible (p.e if sys-usb detects an unknown peripheral) but hopefully without corrupting its state.

Currently running just "poweroff" on dom0 takes around 2 minutes to shutdown because of some slow systemd units. I was wondering if there's a safe way to halt the system letting the VMs minimal time to flush caches and such...

Thanks you.

Chris Laprise

unread,
Sep 15, 2017, 5:38:03 PM9/15/17
to linode...@tuta.io, qubes...@googlegroups.com
My understanding of the process is that the VMs already shutdown in a
virtualization-aware way, but there is still this question of what
properly preserving state means. To some people, immediate termination
of apps+services would be OK as long as storage is unmounted cleanly.
Others would want orderly shutdown of all userspace programs first (and
this is what normal shutdown does). Still others would prefer an
immediate 'qvm-kill'.

If you find yourself forcing shutdown in some way, I'd suggest placing a
priority on dom0 storage integrity perhaps switching away from Ext4 (I
use Btrfs myself) and doing periodic snapshots for example.

--

Chris Laprise, tas...@posteo.net
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886

yura...@gmail.com

unread,
Sep 21, 2017, 7:18:47 AM9/21/17
to qubes-devel
In my experience the slow-down is usually related to PCI-Passthrough, for example of the Network device in Sys-Net, or other VM's that have PCI-Passthrough or variouus kinds. It's not always slow to shutdown with PCI-Passthrough, and also not always caused by PCI-Passthrough either.

Perhaps some code to easier let go of the PCI-devcies or some kind like that would speed things up? I.e. if you shutdown Qubes and have 3-4 different VM's with PCI-Passthrough, it can takes ages to shutdown.

Of course not all slowdowns are caused by PCI-Passthrough, but in my anecdotal experience, most of them are.
Also this is possibly different or maybe even fixed in Qubes 4 with the HVM PCI-Passthrough? (I'm still on 3.2 atm). Also HVM isn't the last stop either as far as I understand it, so any such code would probably have to be either temporarily fix or forward looking to be moved between virtualization states?

I'm not a programmer though, but this is what I observed thus far using Qubes for a year abouts.
Reply all
Reply to author
Forward
0 new messages