VMware

This Question is Answered

1 "helpful" answer available (6 pts)
3 Replies Last post: Nov 12, 2008 12:52 PM by alanrenouf  

Shutdown \ Startup script for Windows Guest VMs that can be compiled and run via Windows Scheduler posted: Nov 10, 2008 11:05 AM

Click to view Mpell's profile Novice 3 posts since
Nov 10, 2008

Hello all,

I am new to ESXi and the VI toolkit and would appreciate some help.

I have installed the VI toolkit and using the PowerShell interface am I able to successfuly login to my esxi server and shutdown and start VMs. My question is how to I convert these commands into scripts that I can run on a nightly basis to shutdown\startup the guest VMs? I have an external proccess that copies the vmdk files to another esxi server but as you know the VMs need to be cold to successfuly copy over. Is there any way I coud generate scripts that can be run by Windows scheduler (on a sepertae VM that never gets shutdown) to shutdown before the copy process happens?

I have seacrhed these forums but after much reading I am unclear on how to go about it and am hoping someone can explain it to me in simple terms.

I appreciate the effort in advance :)

Thanks!

MP.


Click to view alanrenouf's profile Master 582 posts since
Feb 28, 2006

MP,

Welcome to the VI Toolkit and Powershell, you have taken the first leap now http://communities.vmware.com/images/emoticons/grin.gif

Ok, so to start off, all the commands you are typing in the shell can be added to a file, its basically a text file with a PS1 extension, there are multiple editors out there that can help you with this, my favorite (mainly because its free and good) is the Script editor part of PowerGui.

Once you start adding the commands into the PS1 file you can then save it and use it in a scheduled task much like you would a batch file, a pretty good guide is here

Good luck

Alan

http://teckinfo.blogspot.com/

Click to view alanrenouf's profile Master 582 posts since
Feb 28, 2006
Glad you got it working, there will be no stopping you now !

If you found this information useful, please consider awarding points for Correct or Helpful.

Alan Renouf
VMware, Citrix, Microsoft Consultant
UK

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities