superloopy1 Posted March 20, 2018 Share Posted March 20, 2018 Well now ... I've managed to set up my first Win10 vm and quite successfully it appears. My unraid server has a UPS atached but what happens to my vm in the event that it is triggered? I see that i have the option of passing through my UPS to the vm but dont understand whether this is of any use or not. When i tried this, a change now undone, i lost access intermittently to my ups while it 'negotiated'. Just wondering how to handle the ups across any vm? Sent from my LG-D855 using Tapatalk Quote Link to comment
itimpi Posted March 20, 2018 Share Posted March 20, 2018 If your VMs shutdown tidily when unRAID stops the array does then you do not need to do anything, just make unRAID manage the UPS and run through a normal unRAID shutdown if the UPS triggers it. Quote Link to comment
JonathanM Posted March 20, 2018 Share Posted March 20, 2018 If you wish to shut down the VM pro-actively during a power event instead of relying on unraid to stop the VM on its own, you can install the apcupsd software in the VM in network client mode. I do that on all my VM's, and when a power outage is signalled, the VM will shut down on its own before unraid starts its own shutdown sequence. I stagger the shutdowns based on outage time, so the VM's start shutting down after 1 minute on battery, and unraid doesn't start shutting down until 3 minutes on battery. 1 Quote Link to comment
pwm Posted March 20, 2018 Share Posted March 20, 2018 2 hours ago, jonathanm said: If you wish to shut down the VM pro-actively during a power event instead of relying on unraid to stop the VM on its own, you can install the apcupsd software in the VM in network client mode. I do that on all my VM's, and when a power outage is signalled, the VM will shut down on its own before unraid starts its own shutdown sequence. I stagger the shutdowns based on outage time, so the VM's start shutting down after 1 minute on battery, and unraid doesn't start shutting down until 3 minutes on battery. This is generally the best route. If any specific VM needs lots of disk accesses to HDD media during the shutdown, then it's also possible to stagger the individual shutdown sequences. Quote Link to comment
superloopy1 Posted March 21, 2018 Author Share Posted March 21, 2018 This is generally the best route. If any specific VM needs lots of disk accesses to HDD media during the shutdown, then it's also possible to stagger the individual shutdown sequences.Thanks to all. Just so i understand it ... i DO tick the box to passthru my UPS to each vm i build. I then need to install APC software within each vm?Sent from my LG-D855 using Tapatalk Quote Link to comment
pwm Posted March 21, 2018 Share Posted March 21, 2018 No, you don't need to passthru the UPS - the USB-based interface is only designed for one machine to connect with the UPS. If you use apcupsd, then it can run as either master or as slave (client). So one machine (such as your unRAID machine) can "own" the UPS and connect to the UPS using USB or whatever interface your UPS is supporting. And additional machines (physical or VM) can then have their own apcupsd running in client mode and using networking to talk with the master apcupsd. This means lots of VM or physical machines can have their individual policies when to turn off based on the state reported by the UPS. http://www.apcupsd.org/manual/manual.html Quote Link to comment
DGB Posted February 8, 2020 Share Posted February 8, 2020 Help Please I have an APC UPS connected via USB to unraid and configured to shut down unraid in the event of a power cut but the problem i'm having is getting the W10 VM to shut down before unraid shuts it down I have downloaded and installed Apcupsd but when i try to run the program it just quickly flashes on the screen and disappears, I can go to the program folder and run the Apctray then using the unraid ip get the ups status What am I doing wrong as I can not see anywhere to configure the shutdown time for the VM? Should there be a GUI like this? Thanks Quote Link to comment
JonathanM Posted February 8, 2020 Share Posted February 8, 2020 33 minutes ago, DGB said: What am I doing wrong as I can not see anywhere to configure the shutdown time for the VM? In the Apcupsd start menu folder there should be an item "Edit configuration file" Quote Link to comment
DGB Posted February 8, 2020 Share Posted February 8, 2020 48 minutes ago, jonathanm said: In the Apcupsd start menu folder there should be an item "Edit configuration file" ah ok yes found the file, will I get a gui after I edit the config file or does it just run in the background? Quote Link to comment
JonathanM Posted February 8, 2020 Share Posted February 8, 2020 Just now, DGB said: ah ok yes found the file, will I get a gui after I edit the config file or does it just run in the background? It just runs in the background, you use the status icon in the taskbar to see what it's doing. Quote Link to comment
DGB Posted February 8, 2020 Share Posted February 8, 2020 2 minutes ago, jonathanm said: It just runs in the background, you use the status icon in the taskbar to see what it's doing. OK thanks for your help, i'll give it a go. Quote Link to comment
DGB Posted February 8, 2020 Share Posted February 8, 2020 1 hour ago, DGB said: OK thanks for your help, i'll give it a go. Right i've edited the config file and restarted, at first i was getting 2 icons in the task bar but I seam to have gotten that sorted but unfortunately it dusen't shutdown the VM, I first tried setting the batt% to 95 and running the UPS below this and then adding TIMEOUT to 10 but both ways it still doesn't shut down I will attach the config file if someone had time to have a look and see if is setup correctly. apcupsd.conf Quote Link to comment
JonathanM Posted February 8, 2020 Share Posted February 8, 2020 6 minutes ago, DGB said: I will attach the config file if someone had time to have a look and see if is setup correctly. Nope. UPSTYPE net DEVICE 192.168.1.87:3551 Quote Link to comment
DGB Posted February 8, 2020 Share Posted February 8, 2020 29 minutes ago, jonathanm said: Nope. UPSTYPE net DEVICE 192.168.1.87:3551 Changed the CONFIG and it shut down after 10secs so that worked well but now when I start the VM in unraid it boots up with no display, unraid says its running but the monitor just goes to sleep. 😬 Quote Link to comment
DGB Posted February 9, 2020 Share Posted February 9, 2020 2 hours ago, DGB said: Changed the CONFIG and it shut down after 10secs so that worked well but now when I start the VM in unraid it boots up with no display, unraid says its running but the monitor just goes to sleep. 😬 Right, I've tried replacing the VM image with an older backup, still does not boot, after several retries it sometimes boots to the windows recovery screen but is unable to repair the startup but the funny thing is i can change the GFX to VNC and it boots up ok, I then passed the sam GFX card through to a different VM, it boots fine and displies on the monitor 😣 so i'm assuming the GFX card is ok? don't know if there any connection but this only happened after if was shut down via apcupsd, I can't understand it as I thought replacing the img file to an older one it would undo any changes I might have made. I have been using this VM10 as my daily driver for about a year and it's been rock solid, can I start a new vm with the original GFX card and use the old img file so I don't have to start from scratch or does anyone have any suggestions how to repair the broken VM? Quote Link to comment
DGB Posted February 9, 2020 Share Posted February 9, 2020 OK i've got the VM running again but had to use a backup image, restarting unraid is not enough, the server needs to be shutdown and have the power removed only then will it work with the backup, just replacing the image and restarting the server is not enough, I tried apcupsd again but this time installed not as a service so i could start it manually, but again after apcupsd shut down the VM it lost the GFX and was unable. Hope this helps anybody else trying the same thing (make a backup first) I can't spend anymore time on this and will just let unraid shutdown the vm as it goes off. Quote Link to comment
Squid Posted February 9, 2020 Share Posted February 9, 2020 Wouldn't the simple solution have been to within VM Settings, set unRaid to hibernate the host upon host shutdown and then install the Virtio Client tools within the VM that are on the virtiso disk? Quote Link to comment
DGB Posted February 9, 2020 Share Posted February 9, 2020 16 minutes ago, Squid said: Wouldn't the simple solution have been to within VM Settings, set unRaid to hibernate the host upon host shutdown and then install the Virtio Client tools within the VM that are on the virtiso disk? Hi thanks taking the time to reply I've done quite a lot with unraid and love it but I am still very much learning and unless I can find a tutorial or the likes sometimes struggle, I'm sure I read somewhere someone suggested that it wasn't a good idea to have them hibernate and after finding apsupsd thought it was the ideal solution, but unfortunately for me for whatever reason it a causes a major problem after auto shutdown. I'm still recovering the VM and will look at your suggestion in the future. Quote Link to comment
Squid Posted February 9, 2020 Share Posted February 9, 2020 IMO, the problem with Windows shutdown, whether initiated by the user directly or via any program is that there's tons of reasons why Windows won't shutdown (Open Dialog Boxes, etc) and just sit there waiting for user input. Hibernation has no such problems, and is faster than a shutdown. 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.