Upgrading to PowerCLI 4.0 Update 1

Well, now I have upgrade to vSphere 4 U1, I’m just doing an upgrade of the PowerCLI (VMware’s addition of some 200+ cmdlets together with access to the VMware SDK too). I’m avid fan and believe in the powers of PowerCLI. Although I wouldn’t claim to be the warrior monk status of Hal, Luc or Al… :-)

PowerCLI has been overhauled with a whole new raft of cmdlets which will go a long way to shortening my PS1 scripts. That said I don’t when I’m gonna get the time replace my lengthy referrences to much short cmdlets.

If you want to download and install the latest PowerCLI you will find it here:

http://communities.vmware.com/community/vmtn/vsphere/automationtools/windows_toolkit

I’ve been looking at the new cmdlets and trying to make a hit list one’s I should look at first. So what my personal favourites/highlights by looking at the release notes:

  • Managing the failover and load-balancing policies of VirtualSwitch and VirtualPortGroup objects with Get-NicTeamingPolicy and Set-NicTeamingPolicy. Previously, these setting were only accessible by navigating the complicated SDK environment
  • Working with host storages and iSCSI HBA devices with Get-VMHostHba, Set-VMHostHba, Get-iScsiHbaTarget, New-iScsiHbaTarget, Remove-iScsiHbaTarget, Set-iScsiHbaTarget, and Set-VMHostStorage. Previously, these setting were only accessible by navigating the complicated SDK environment
  • Upgrading hosts with Install-VMHostPatch
  • Running BAT (Windows) and BASH (Linux) scripts with Invoke-VMScript. I think these cmdlets maybe very useful in the SRM environment.
  • Uploading firmware packages with Set-VMHostFirmware.
  • Extending, cloning, inflating, and reallocating virtual hard disks with Copy-HardDisk, New-HardDisk, and Set-HardDisk. I’m hoping these cmdlets will able tell me if my virtual disk is eagerzeroedthick – the format valid for VMware Fault Tolerance. The conversion process can take sometime – so it will be helpful to know because it factors into your maintenance windows.

One Response to “Upgrading to PowerCLI 4.0 Update 1”

  1. Carter Shanklin Says:

    The Eager bit is not exposed via Get-HardDisk and can’t be controlled via Set-HardDisk or New-HardDisk in 4.0 U1.

    You can get the Eager status as follows:
    function Is-Eager {
    param ($hd)

    $vm = Get-VM -id $hd.ParentId
    $vmView = $vm | get-view -property Config
    Write-Output (
    $vmView.config.Hardware.Device |
    Where { $_.Backing.FileName -eq $hd.FileName }
    ).Backing.EagerlyScrub
    }

    And LucD has code to convert a disk to eager: http://lucd.info/?p=918

Leave a Reply

 


Podcast

LinkedIn

If you want to add Mike Laverick on LinkedIn, click on this button:

Mike Laverick

Categories

My Pages

Archives

Other VMware Bloggers