VMware Cloud Community
mr_rob
Contributor
Contributor

Auto power on/off a VM

Hello, I would ideally like to be able to auto power off a VM guest at a particular time of evening and then power on in the morning

How might this be possible?

I am using ESXi 6.5 and the guest system in Ubuntu server

thanks

0 Kudos
3 Replies
daphnissov
Immortal
Immortal

Are you using vCenter?

0 Kudos
mr_rob
Contributor
Contributor

no, just the free stuff 🙂

tight home user experiments budget here

0 Kudos
TheBobkin
Champion
Champion

Hello mr_rob,

Without vCenter, your only feasible options are to use PowerCLI or Crontab - an example of Crontab to set this would call 'vim-cmd vmsvc/power.on <VM-ID>' written to a .sh file at whatever time interval you want, could even do a for loop against 'vim-cmd vmsvc/getallvms' to run this against all registered VMs, of course a second line with power.off will be needed.

Do note that if just doing it for one VM then the VM-ID would have to remain static which means either don't un-register/re-register the VM in inventory (or change the ID in the script if you do).

Bob

0 Kudos