vCenter

 View Only
  • 1.  Shutdown or Suspend VMs - Preferred?

    Posted Oct 05, 2011 02:53 AM

    Hey Guys,

    Am in the process of using PowerCLI to try and create a script to shutdown my vm infrastructure in the event of a power failure.  I have 3 ESXi 4.1 hosts managed by a vCenter VM.  To shut them down I have written a PowerCLI script which runs on one of my physical management servers which has a UPS agent installed, so when a power failure occurs the UPS agent kicks its script off which calls the Powershell script to shutdown the VMs.

    I have to shutdown the VMs in a specific order as there is a mix of database vms, build vms etc.

    Problem is my UPS only gives me about 20mins of battery power, and if I set all my VMs to shutdown with a 10 second delay between each it'll take about 18mins to shutdown everything.  Even the 10 second delay isn't quick enough for some VMs to shutdown, but if I set them to suspend they do this much quicker (my test ones anyway).

    So, question is, whats the preference for suspending VMs which run databases such as Oracle, and apps such as JBOSS?  What effect would it have on these and is it even advised?

    Thanks,

    Andy

    Message was edited by: AndyR8939 - title spelling



  • 2.  RE: Shutdown or Suspend VMs - Preferred?

    Posted Oct 05, 2011 02:59 AM

    I'd strongly recommend against suspending for anything thats time sensitive (like oracle).  An app server, sure, thats fine.  But I wouldn't do DBs.

    If not all the VMs rely on each other, why not run some of the shutdowns asyncronously as external jobs (see the start-job , get-job, receive-job powershell functions).  Then you could do a few (like all the app servers) together, and link the rest...



  • 3.  RE: Shutdown or Suspend VMs - Preferred?

    Posted Oct 06, 2011 02:10 AM

    Thanks this sounds like what I could do with.

    Tried it just but looks like jobs are a little different than calling additional scripts which run in the background as I'm totally new to Powershell.  Any tips on how to kick off a Vm shutdown via a job?

    I guess I dont need to pass the credentials back through as the vcenter credentials should follow as its based in the same session?