Start/stop VMs on schedule


Recommended Posts

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

Link to comment
  • 1 year later...
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? 

Link to comment
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.

 

 

Screen Shot 2018-12-10 at 10.35.11 pm.png

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.