danielocdh Posted December 18, 2020 Share Posted December 18, 2020 (edited) I have a windows VM on my ssd cache drive, I want to have it paused most of the time, but when it is paused and I shutdown/reboot unraid the windows install inside the VM gets powered incorrectly(instead of hibernated/shutdown correctly). If I hibernate the VM manually it usually takes around 10 seconds for the ssd to stop showing reads/writes, I increased the "VM shutdown time-out" to 90 but problem persists. The VM doesn't have any extra hardware attached to it. Is this normal unraid behavior? any way to workaround it? thanks Edit: Unraid(6.8.3) isn't considering/handling correctly paused VMs (/etc/rc.d/rc.libvirt -> stop_running_machines) If you have a paused VM you'll run into forced VMs shutdown when shutting down/rebooting Unraid and also issues when trying to stop Unraid array I made a solution for this (see below) I tested the solution on versions: 6.8.3, 6.9.1, 6.9.2 Update: It seems the issue is a bit worst on 6.9.1 as it seems to force a parity check after an unclean shutdown caused by the bug. Luckily the solution still works for 6.9.1 Last Update: The issue seems fixed and it is marked as fixed on the changelog since unraid Version 6.10.0 2022-05-07 You can still use the solution on older unraid versions Edited June 15, 2022 by danielocdh issue fixed on 6.10.0 Quote Link to comment
Squid Posted December 18, 2020 Share Posted December 18, 2020 5 minutes ago, danielocdh said: Is this normal unraid behavior? Yes, because you haven't set it in VM Settings And you will also have to install on the VM the Virtio Guest Tools (which is in the virtio iso) Quote Link to comment
danielocdh Posted December 18, 2020 Author Share Posted December 18, 2020 11 hours ago, Squid said: Yes, because you haven't set it in VM Settings And you will also have to install on the VM the Virtio Guest Tools (which is in the virtio iso) there are only 2 "upon host shutdown" settings, which one would would I have to set to avoid an incorrect shutdown? I guess I didn't fully explained myself, I tried with "upon host shutdown" on both shutdown or hibernate, the VM still gets powered off incorrectly. virtio tools are installed, manual hibernate and stop from unraid work correctly(windows is hibernated/shutdown correctly) Quote Link to comment
Solution danielocdh Posted January 4, 2021 Author Solution Share Posted January 4, 2021 (edited) The issue is fixed since unraid Version 6.10.0 2022-05-07, so you only need to use the script on older versions. So the fix I'm using now (tested on Unraid 6.8.3, 6.9.1, 6.9.2) is to edit /etc/rc.d/rc.libvirt ->stop_running_machines to correctly handle paused VMs on shutdown/reboot or array stop. Basically I just added commands so stop_running_machines tries to resume the paused VMs, after that they will be hibernated/shutdown as usual. rc.libvirt is not persistent so I created a php script to edit it as needed, I'm running the script with CA User Scripts with the scheduling set as "At First Array Start Only" (need to run the script once after creating it). php script file attached script Edited June 15, 2022 by danielocdh fixed on 6.10.0 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.