PowerCLI: Configure iSCSI one-liner

While migrating a small environment to vSphere today I ran into my nemesis Host Profiles again. When are they going to Fix these things? The fact that they are incapable of even rudimentary iSCSI configuration is embarrassing. I’m sure vmware will fix it, but until then I wrote a simple one-liner that will configure iSCSI on a new host.

~Glenn

1 thought on “PowerCLI: Configure iSCSI one-liner”

  1. Hi Glenn,

    Do you know it this still works with powercli 4.1? It looks like get-VMhostStorage is not working like it is supposed to in that version…

    Get-VMHostStorage : 8/12/2010 9:13:21 AM Get-VMHostStorage Object reference not set to an instance of an object.
    At line:1 char:35
    + $VMHostStorage = Get-VMHostStorage <<<< -VMHost "pbnvm16.petrobakken.pvt" | Set-VMHostStorage -SoftwareIScsiEnabled $True
    + CategoryInfo : NotSpecified: (:) [Get-VMHostStorage], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVMHostStorage

    Thanks,

    Dan

Leave a Reply