Search This Blog

Thursday, November 4, 2010

Powercli one liner for finding Fault Tolerance Detection

Here's the fancy script  using the last the last article's oneliner:

#create array for table
$table = @()

#get-view of VM's and filter on FaultToleranceState
$ft = Get-View -ViewType VirtualMachine -filter @{"Runtime.FaultToleranceState"="enabled|ing"  }

#post message
write-host "Found FT on "  ($ft.count/2) "VM(s)..."

#assign results array
$ft | % {    
    $row = "" | select Name, FaultToleranceState, RecordReplayState
    $row.Name = $_.Name
    $row.FaultToleranceState = $_.Runtime.FaultToleranceState
    $row.RecordReplayState = $_.Runtime.RecordReplayState
    $row.RecordReplayState = $_.Runtime.RecordReplayState
    $table +=  $row
}
write-host ($ft.count )  "FT instances found."
$table


Output:


[vSphere PowerCLI] C:\powercli> .\Get-FT.ps1

 Found FT on  2 VM(s)...

 

Name                 FaultToleranceState         RecordReplayState

----                 -------------------         -----------------

testvm2              running                     recording 

testvm2              running                     replaying

 

keywords: Vmware vSphere powershell 2 powercli FT

23 comments:

  1. This is excellent posts. Hadoop Training in ChennaiThanks a lot..i hope to really undersatand for this information...

    ReplyDelete
  2. There are lots of information about latest technology and how to get trained in them, like Big Data Training have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies(Big Data Course in Chennai). By the way you are running a great blog. Thanks for sharing this.

    ReplyDelete
  3. • Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
    ios training in chennai

    ReplyDelete

  4. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharng this information,this is useful to me...
    Android training in chennai
    Ios training in chennai

    ReplyDelete
  5. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.
    Selenium Training in Chennai
    Selenium Automation Testing Training Institutes in Chennai

    ReplyDelete
  6. I must appreciate you for providing such a valuable content for us. This is one amazing piece of article. Helped a lot in increasing my knowledge.SAS Training in Bangalore

    ReplyDelete