I recently updated to PowerCLI 5.8 R1 and wanted to try out the new SPBM cmdlts, but however I go about it I seem to get below error regardless of which Get-SPBM* cmdlet I run:
Get-SpbmStoragePolicy : 2014-12-11 14:04:50 Get-SpbmStoragePolicy Therequest failed with HTTP status 400: Bad Request.
At line:1 char:1
+ Get-SpbmStoragePolicy
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-SpbmStoragePolicy], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Storage.Commands.Cmdlets.Spbm.GetStorageProfile
I tried connecting to the VC with the -Protocol HTTPS parameter but same error.
I figured that maybe the Storage snapin hadn't been imported but it seems to be there:
PowerCLI C:\> Get-PSSnapin | select name
Microsoft.PowerShell.Diagnostics
Microsoft.PowerShell.Core
Microsoft.PowerShell.Utility
Microsoft.PowerShell.Host
Microsoft.PowerShell.Management
Microsoft.PowerShell.Security
Microsoft.WSMan.Management
VMware.VimAutomation.Core
VMware.VimAutomation.Vds
VMware.VimAutomation.License
VMware.DeployAutomation
VMware.ImageBuilder
VMware.VimAutomation.Storage
I run PS4.0 with PCLI 5.8R1:
PowerCLI C:\> Get-VIToolkitVersion
PowerCLI Version
VMware vSphere PowerCLI 5.8 Release 1 build 2057893
---------------
Snapin Versions
VMWare AutoDeploy PowerCLI Component 5.5 build 1983942
VMWare ImageBuilder PowerCLI Component 5.5 build 1983942
VMware License PowerCLI Component 5.5 build 1265954
VMware Storage PowerCLI Component 5.8 build 2057894
VMware VDS PowerCLI Component 5.8 build 2031581
VMware vSphere PowerCLI Component 5.8 build 2031581
VMware vSphere Update Manager PowerCLI 5.5 build 1302474
PowerCLI C:\> $psversiontable
Name Value
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.18063
BuildVersion 6.3.9600.16406
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
I'm running PowerCLI on a Win2k8Ent Server, not locally on the vCenter.
Any ideas? Why should it use HTTP? 5.5 commands and older are working fine.
It looks like you are running vCenter 5.1, is that correct?
Please note that SPBM support for PowerShell is for vCenter 5.5 and above. Prior to 5.5, the SPBM API was not public.
Alex
Are all the services started on your vCenter correctly, can you access storage policies from the web client?
Thanks for the attention Alan.
All services looks to be running fine.
PS C:\> get-service -DisplayName "*VM*" | sort DisplayName | ft -auto
Status Name DisplayName
Running NVPF Virtual Storage Console for VMware vSphere Server
Running VMTools VMTools
Running vmwarelogbrowser VMware Log Browser
Stopped vmvss VMware Snapshot Provider
Running VMUSBArbService VMware USB Arbitration Service
Running vimQueryService VMware vCenter Inventory Service
Stopped vCOConfiguration VMware vCenter Orchestrator Configuration
Stopped VMwareOrchestrator VMware vCenter Orchestrator Server
Running vctomcat VMware VirtualCenter Management Webservices
Running vpxd VMware VirtualCenter Server
Running vimPBSM VMware vSphere Profile-Driven Storage Service
Running vmware-ufad-vci VMware vSphere Update Manager Service
Stopped vmware-vum-ufa VMware vSphere Update Manager UFA Service
Running vspherewebclientsvc VMware vSphere Web Client
Running ADAM_VMwareVCMSDS VMwareVCMSDS
I can manage for example the VM Storage Profiles from the vSphere Client but like you said I can't do that from the vSphere Web Client.
"Create a new VM Storage Profile (Not available)" is greyed out while I can press "Manage Storage Capabilities" but it gives me an error "An internal error has occurred - Error #1009".
We have 6 VM Storage Profiles visible in the legacy client and none visible in the web client.
We run ESXi 5.1.0, 2000251 and vCenter Server 5.1.0, 947673 in this environment.
I found in the release notes for 5.5 that it is an known issue that "Storage profiles not visible in the vSphere Web client after you install and uninstall vCenter Server". Don't know if this issue would exist in our 5.1 environment, but I don't think that we have reinstalled the vCenter.
Based on error 1009 I found some articles which describes that they got this for other plugins and clearing some files in C:\ProgramData\VMware\vSphere Web Client\ would help, but I didn't find the files/folders these articles pointed towards so I'm guessing that's not the issue.
I'd appreciate some advice.
Any pointers why this wouldn't work in the web client? Everything else seems to work.
I've also tried restarting the web services on the VC, but no luck.
I will try and pull in some folks who know more about SPBM as this looks like a general error and not a PowerCLI Error
Cheers, now in hindsight maybe this post should have been addressed to another forum. If you deem it so, you can move it.
It looks like you are running vCenter 5.1, is that correct?
Please note that SPBM support for PowerShell is for vCenter 5.5 and above. Prior to 5.5, the SPBM API was not public.
Alex
That is correct. Thank you Alex, I did not know that. I only checked the interoperability matrix with PCLI 5.8 and VC 5.1, and there it looked like it was supported.
At least I can be glad to be able to use it in one of our newer environments then
Apologies for the confusion. This was due to changes within SPBM, not due to PowerCLI.
ALex