Automation

 View Only
  • 1.  Slow Response - Tools Update Script

    Posted Oct 20, 2008 04:35 PM
      |   view attached

    I have been working on a scripts for updating the vmware tools on my guest servers. I have a requirement to do a specific set of servers at a specific time. This is based around our patching windows for each server as it was negociated with the clients. I have written the script below to push the tools update out but i am getting extreamly slow respose from the get-vm command it takes several minutes to complete as you can see from the measure-command output below. Does anyone have any idea why I am getting such slow response? It is almost faster to manually triger the updates. It looks like most of the time is consumed in the get-vm commandlet

    Details:

    I am running the script from a windows 2003 server fully patched in the same datacenter as my virtual center server and database server.

    Script:

    $VirtualCenter = "ap-vmvc-p01","ap-vmvc-p001"

    $InputFile = $args[0].split(",")

    Write-Host "Processing Input file"

    write-Host "$inputfile"

    write-host " "

    foreach ($VC in $virtualcenter)

    {

    write-host "Connecting to Virtual Center ($VC)"

    connect-viserver $vc

    Foreach ($In in $InputFile)

    {

    $Input= import-csv $In

    foreach ($Server in $Input.Name)

    {

    write-Host "Processing - $Server"

    Get-VM $Server | update-tools

    }

    }

    }

    Command Time: (executing against only one vm)

    Days : 0

    Hours : 0

    Minutes : 10

    Seconds : 23

    Milliseconds : 49

    Ticks : 6230490894

    TotalDays : 0.0072112163125

    TotalHours : 0.1730691915

    TotalMinutes : 10.38415149

    TotalSeconds : 623.0490894

    TotalMilliseconds : 623049.0894






    Truth is a three edged sword

    Attachment(s)

    ps1
    UpdateTools.ps1   479 B 1 version


  • 2.  RE: Slow Response - Tools Update Script

    Posted Oct 21, 2008 03:16 PM

    I'd love a faster way to do this as well. I was just coming here to post to see if there was any way to do these in parallel rather than serially. I am seeing similar performance as the script waits for each VM to install, reboot, and then come back up and report successful before progressing to the next VM. Right now it is faster for me to start 20 by hand rather than automate it and wait nearly 3.5 hours to ensure success, and how sad is that.



  • 3.  RE: Slow Response - Tools Update Script

    Posted Oct 21, 2008 03:18 PM

    I have identified a 10 minute delay in just doing the get-vm without even executing the tools upgrade






    Truth is a three edged sword



  • 4.  RE: Slow Response - Tools Update Script

    Posted Feb 02, 2009 11:36 PM

    I am getting the same delays. Help anyone?



  • 5.  RE: Slow Response - Tools Update Script

    Posted Feb 03, 2009 07:51 PM

    Get-Vm has been a real thorn. It is a known issue or pain if I may...there is a way to speed some of it up using get-view, but I think the Get-vm needs fixed badly...

    Glen