Hi,
Is it possible to configure the iSCSI initiator NIC binding with PowerCLI? Usually you would use the "esxcli swiscsi" command to bind the initiator to the required vmkernel ports but I can't find any reference to a way of achieving this through PowerCLI.
Thanks!
The "esxcli" APIs are not exposed, you'll need to use vCLI's esxcli which can be called from a PowerCLI script if you have installed on a Windows system.
=========================================================================
William Lam
VMware vExpert 2009,2010
VMware scripts and resources at:
Getting Started with the vMA (tips/tricks)
Getting Started with the vSphere SDK for Perl
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
Hi William,
How would you call the vCLI's esxcli command from a PowerCLI script?
I'm not a Powershell guy ... will leave that to the guru's to answer but you should be able to just call the vCLI's esxcli on the same system that has PowerCLI installed, this is similar to SSHing into an ESX host using plink which you can probably do a search to find an example. You would just pass in the credentials to esxcli along with the commands to bind VMkernel interface to iSCSI adapter.
=========================================================================
William Lam
VMware vExpert 2009,2010
VMware scripts and resources at:
Getting Started with the vMA (tips/tricks)
Getting Started with the vSphere SDK for Perl
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
You can run a console command from PowerCLI using plink.exe:
$User = <account> $Pswd = <password> $Computer = <esx-hostname> $plink = "<PuTTY-directory>\plink.exe" $plinkoptions = " -v -batch -pw $Pswd" $cmd1 = 'esxcli swiscsi' $remoteCommand = '"' + $cmd1 + '"' $command = $plink + " " + $plinkoptions + " " + $User + "@" + $computer + " " + $remoteCommand Invoke-Expression -command $command
Most of this code is borrowed from LucD.
Regards, Robert