PowerCLI

 View Only
  • 1.  Get iSCSI WWN name

    Posted Jun 22, 2010 02:00 PM

    I have been looking for a while, but can someone help me with getting the iSCSI wwn into a variable. I am trying to pipe this into a command to add this to a netapp initiator group. My code is below: From this I can enable iSCSI and then configure my iSCSI target, but when I write-host the information the WWN does not appear so obviously I can not add the initiator to a netapp igroup as seen in the second section of code.

    $myhost = Get-VMHost -name 192.168.10.74

    Get-VMHostStorage $myhost | Set-VMHostStorage -SoftwareIScsiEnabled $true

    $iscsiHBA = Get-VMHostHBA -VMHost $myhost -Type iSCSI

    $iscsiHBA | New-IscsiHBATarget -Address $iscitarget -Type send

    Write-Host $iscsiHBA

    Connect-NaController $filer -Credential $Filercredentials

    $iscsiHBA | Add-NaIgroupInitiator -Igroup vmware -Initiator $iscsiHBA

    Any help on this would be great.



  • 2.  RE: Get iSCSI WWN name

    Posted Jun 22, 2010 03:58 PM

    Are you sure you need WWNs ?

    I thought iSCSI had IQNs.

    And then you could probably use

    $iqn = (Get-VMHost -Name 192.168.10.74 | GetVMHostHba -Type iSCSI).IScsiName
    

    for the initiator parameter.

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 3.  RE: Get iSCSI WWN name

    Posted Jun 22, 2010 04:01 PM

    You are correct, I am just used to the fibre channel verbage. Is there a reference document you used to come up with this. I was not aware that you could do .IScsiName...either way, thanks so much I really appreciate it.



  • 4.  RE: Get iSCSI WWN name

    Posted Jun 22, 2010 04:01 PM

    You are correct, I am just used to the fibre channel verbage. Is there a reference document you used to come up with this. I was not aware that you could do .IScsiName...either way, thanks so much I really appreciate it.



  • 5.  RE: Get iSCSI WWN name

    Posted Jun 22, 2010 04:34 PM

    With the Get-View cmdlet you can pass to the objects that are documented in the VMware vSphere API Reference Documentation. And from there you have access to all the methods and properties available with those objects.

    ____________

    Blog: LucD notes

    Twitter: lucd22