- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Autostart - Shutdown scheduling of vms
Hey there,
is there any possibility to schedule shutdown and start of vms automatically?
It would be great if someone of you have a good hint for me
best regards
jack
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi J0sh1 and welcome to the community ![]()
Yes there is - you can use Schedule Tasks to achieve this by having a task that changes the power state of VMs. Rather than try and explain take a look at this link: vSphere 6.0 Documentation Center
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a powershell script which i was able to get from the community several years ago and still use it to this day. I schedule a shutdown and startup every weekend.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ThompsGHi ThompsG
Thanks for your reply - but as i understand from the documentation - the webclient is only for licensed esxi hosts. Unfortunately im using the free esxi 6 host ![]()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That sounds intresting - where does the script run and could you provide me your script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Shutdown using...
# This Script will PowerOff VM's listed in c:\vmlist.txt
add-PSSnapin VMware.VimAutomation.Core | Out-Null
Connect-VIServer vcenter-server -User domain\adm -Pass 123456
# Get VM's from c:\vmlist.txt then ShutDown each one.
Get-Content C:\Scripts\vmlist.txt | % { Get-VM $_ | Shutdown-VMGuest -Confirm:$false }
# Get VM's from c:\vmlist.txt then Restart each one.
# Get-Content C:\vmlist.txt | % { Get-VM $_ | Restart-VMGuest -Confirm:$false }
# Email log file
send-mailmessage -SmtpServer "smtp.domain.com" `
-from "VM-ShutDown <machine@domain.com>" `
-to "Admin@domain.com>" `
-subject "ShutDown_$((get-date).toString('MM-dd-yyyy_hh:mmtt'))" `
-body "VM ShutDown Script has been sent"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply.
But you always need a Windows Client to run this script or im wrong?
Actually I need a possibility to manage the scheduled task just from the bare ESXi instance - is there any way to do that?
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assume that if we have SCCM auto reboot can be enabled ,there is any pros by doing this in Vcenter level?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can achieve this by:
1. Creating a scheduled task in vCenter: Home > Scheduled Tasks > New
2. Writing a powershell script and creating a scheduled task in a Windows server to trigger the script.