planetwilson Posted May 1, 2017 Share Posted May 1, 2017 How can I set up my VMS so that I can have them all go to sleep at say 10pm at night and wake up at 8am? My disks could spin down then. I don't really want to shut down/start up again, a sleep would be fine. I am guessing some sort of libvirt command line on a schedule? Actually I wonder if the hard part is the scheduling not familiar with all the flavours of unix to know how to schedule scripts at specific times in unRAID... Quote Link to comment
Squid Posted May 2, 2017 Share Posted May 2, 2017 3 hours ago, planetwilson said: Actually I wonder if the hard part is the scheduling not familiar with all the flavours of unix to know how to schedule scripts at specific times in unRAID... Can't help you with the actual script though... Quote Link to comment
ToXIc Posted December 9, 2018 Share Posted December 9, 2018 On 5/1/2017 at 4:46 PM, planetwilson said: How can I set up my VMS so that I can have them all go to sleep at say 10pm at night and wake up at 8am? My disks could spin down then. I don't really want to shut down/start up again, a sleep would be fine. I am guessing some sort of libvirt command line on a schedule? Actually I wonder if the hard part is the scheduling not familiar with all the flavours of unix to know how to schedule scripts at specific times in unRAID... did you ever come up with a solution? or did you just use a CRON job? Quote Link to comment
planetwilson Posted December 9, 2018 Author Share Posted December 9, 2018 No I didn't but might have another go now you've reminded me. Ideally there would be something I could do for OSX but I think that would need to be a sleep from inside the VM with restore from outside Quote Link to comment
Jorgen Posted December 10, 2018 Share Posted December 10, 2018 15 hours ago, planetwilson said: No I didn't but might have another go now you've reminded me. Ideally there would be something I could do for OSX but I think that would need to be a sleep from inside the VM with restore from outside Yeah, you can't sleep a Mac VM from the unraid side. In fact, I don't think you can use the Mac OS sleep function from within the VM either, from memory I was never able to wake it up again when I played around with that. For my Mac VM I set a scheduled shutdown from the Mac System Preferences/Energy Saver/Schedule. Then I start it on-demand with the WOL plugin and a WOL app on my phone. But I'm sure you could also schedule a start via User Scripts. The built-in Mac scheduler has an option for scheduling starts as well, but I doubt it would work in a VM. Quote Link to comment
Jorgen Posted December 10, 2018 Share Posted December 10, 2018 Just realised I have a need to start the VM on a schedule too. This super simple script will do the trick, scheduled from the Users Scripts plugin with a custom cron. #!/bin/bash virsh start "<name-of-VM>" Replace <name-of-VM> with the VM name as shown in the unraid UI Quote Link to comment
planetwilson Posted December 10, 2018 Author Share Posted December 10, 2018 Yes I'll be doing similar but I think I'll do virsh stop and virsh resume to just have them sleep/wake up rather than go through a reboot cycle as I can't guarrantee clean shutdown depending on what is running 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.