Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

UPS and vms?

Featured Replies

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
 
 


  • Community Expert

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.  

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. 

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.

  • Author
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

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

 

 

  • 1 year later...

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 

image.thumb.png.a9d40c15b9acf9842a64b7d8cd5f4a13.png

 

 

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?

 

image.thumb.png.0b075ee2a352cd82d4caf8c298087b95.png

 

Thanks 

 

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"

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?

 

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.

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.

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

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

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. 😬

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?

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.

 

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? 

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.  

 

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.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.