Created
January 4, 2012 15:20
-
-
Save erikbuild/1560502 to your computer and use it in GitHub Desktop.
VMware / PowerCLI 5 trying to play with iSCSI settings on a ESXi 5 Host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Launch PowerCLI and login when prompted | |
| Connect-VIServer myserver.com | |
| # PowerCLI now shows "connected to myserver.com as root" at top. | |
| Get-VMHostStorage | |
| # Get-VMHostStorage : 1/4/2012 10:18:20 AM Get-VMHostStorage Object reference not set to an instance of an object. | |
| # At line:1 char:18 | |
| # + Get-VMHostStorage <<<< | |
| # + CategoryInfo : NotSpecified: (:) [Get-VMHostStorage], VimException | |
| # + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVMHostStorage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Prompt for the ESXi host | |
| $hostname = Read-Host "Enter the ESXi hostname" | |
| # Connect to the server (user will see a popup for credentials) | |
| $server = Connect-VIServer $hostname | |
| # Get the VMHost | |
| $myHost = Get-VMHost $server | |
| # Enable Software iSCSI on the host. | |
| Get-VMHostStorage $myHost | |
| # Disconnect cleanly | |
| Disconnect-VIServer -Confirm:$false | |
| # Same error message as above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-VMHostStorage -VMHost myserver.com | |
| # Same error message :( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment