Automation

 View Only
  • 1.  FT-enable a VM.

    Posted Aug 14, 2009 04:07 PM

    To enable FT for a VM:

    Get-VM X | Get-View | % { $_.CreateSecondaryVM($null) }
    

    This will choose a host, if you want to specify a specific host, pass the host's MOR in place of $null.

    To disable, run:

    Get-VM X | Select -First 1 | Get-View | % { $_.TurnOffFaultToleranceForVM() }
    

    Note that in PowerCLI 4.0 Get-VM will return a fault tolerant VM twice, so we select the first one.



  • 2.  RE: FT-enable a VM.

    Posted Sep 10, 2009 02:44 PM

    Carter,

    I am I right in saying there's no method to enable FT logging on a vmkernel port in the SDK.

    I remember asking this before but I can't remember the answer...

    If it is possible - can you point me to the right location in the SDK online?

    Regards

    Mike Laverick

    RTFM Education

    http://www.rtfm-ed.co.uk

    Author of the SRM Book: http://www.lulu.com/content/4343147



  • 3.  RE: FT-enable a VM.

    Broadcom Employee
    Posted Sep 11, 2009 03:22 AM

    Mike,

    Take a look at ftCLI2.pl to configure FT logging for a given set of ESX(i) hosts for a given FT portgroup, I'm sure this can be accomplished in PowerCLI as well since this just uses the vSphere APIs

    =========================================================================

    William Lam

    VMware vExpert 2009

    VMware ESX/ESXi scripts and resources at:

    VMware Code Central - Scripts/Sample code for Developers and Administrators

    VMware Developer Comuunity

    Twitter: @lamw

    If you find this information useful, please award points for "correct" or "helpful".



  • 4.  RE: FT-enable a VM.

    Posted Sep 12, 2009 01:26 AM

    Try this.

    # Enable or disable FT logging.
    $esxHost = "192.168.1.11"
    $vmKernel = "vmk0" # You can get these out of Get-VMHostNetwork
    $enable = $true
    $hView = Get-VMHost $esxHost | Get-View -Property configManager
    $nicManager = Get-View $hView.configManager.virtualNicManager
    if ($enable -eq $true) {
    	$nicManager.SelectVnicForNicType("faultToleranceLogging", $vmKernel)
    } else {
    	$nicManager.DeselectVnicForNicType("faultToleranceLogging", $vmKernel)
    }
    

    =====

    Carter Shanklin

    Read the PowerCLI Blog

    Follow me on Twitter