I am trying to power CLI and apply a VMware storage policy with replicationgroup, following a couple known blogs for Pure storage so my steps should be to a T however when I get to this command it fails with the following error.
$vm = get-vm server
$hd = $vm | Get-HardDisk
$vmconfig = $vm, $hd | Get-SpbmEntityConfiguration
$policy = Get-SpbmStoragePolicy -Name "FlashArray Daily Snap"
$repgroups = $policy | Get-SpbmReplicationGroup
$repGroups[3]
$vmconfig | Set-SpbmEntityConfiguration -StoragePolicy $policy -ReplicationGroup $repGroups[3]
Set-SpbmEntityConfiguration : 1/7/2020 11:52:08 AM Set-SpbmEntityConfiguration A general system error occurred: PBM error occurred during PreReconfigureCallback: Fault cause: vmodl.fault.SystemError
Even If I run just a basic command without the $hd it still gives me the same error.
Set-SpbmEntityConfiguration -Configuration (Get-SpbmEntityConfiguration $vm) -StoragePolicy $policy -ReplicationGroup $repGroups[3]
I'm not sure that this is a PowerCLI version.
Btw, which vSphere and PowerCLI version are you using?
Have you looked at A general system error occurred: PBM error occurred during PreMigrateCheckCallback: vmodl.fault.S... ?
Something else to try, Rescan and Sync the Storage Provider in vCenter - Configure - Storage Provider
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I have restarted the vcenter and did a rescan\resync and the issue still occurs
And which PowerCLI version are you using?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Version
-------
5.1.17134.858
Are you sure that is not the PowerShell version?
Do a
Get-Module -Name VMware* -ListAvailable
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
applogies,
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 6.5.2.7... VMware.DeployAutomation {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...}
Script 6.5.2.7... VMware.ImageBuilder {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImageProfile...}
Manifest 10.0.0.... VMware.PowerCLI
Script 10.0.0.... VMware.VimAutomation.Cis.Core {Connect-CisServer, Disconnect-CisServer, Get-CisService}
Script 10.0.0.... VMware.VimAutomation.Cloud {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}
Script 10.0.0.... VMware.VimAutomation.Common
Script 10.0.0.... VMware.VimAutomation.Core {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtpServer...}
Script 6.5.4.7... VMware.VimAutomation.HA Get-DrmInfo
Script 7.1.0.7... VMware.VimAutomation.HorizonView {Connect-HVServer, Disconnect-HVServer}
Script 10.0.0.... VMware.VimAutomation.License Get-LicenseDataManager
Script 10.0.0.... VMware.VimAutomation.Nsxt {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtService}
Script 10.0.0.... VMware.VimAutomation.PCloud {Connect-PIServer, Disconnect-PIServer, Get-PIComputeInstance, Get-PIDatacenter}
Script 10.0.0.... VMware.VimAutomation.Sdk {Get-PSVersion, Get-InstallPath}
Script 10.0.0.... VMware.VimAutomation.Srm {Connect-SrmServer, Disconnect-SrmServer}
Script 10.0.0.... VMware.VimAutomation.Storage {Add-KeyManagementServer, Copy-VDisk, Export-SpbmStoragePolicy, Get-KeyManagementServer...}
Script 1.2.0.0 VMware.VimAutomation.StorageUtility Update-VmfsDatastore
Script 10.0.0.... VMware.VimAutomation.Vds {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDSwitch...}
Script 10.0.0.... VMware.VimAutomation.Vmc {Connect-Vmc, Disconnect-Vmc, Get-VmcService, Connect-VmcServer...}
Script 10.0.0.... VMware.VimAutomation.vROps {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...}
Script 6.5.1.7... VMware.VumAutomation {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}
LucD
double reply sorry
ModuleType Version Name
---------- ------- ----
Script 6.5.2.7812840 VMware.DeployAutomation
Script 6.5.2.7812840 VMware.ImageBuilder
Manifest 10.0.0.7895300 VMware.PowerCLI
Script 10.0.0.7893915 VMware.VimAutomation.Cis.Core
Script 10.0.0.7893901 VMware.VimAutomation.Cloud
Script 10.0.0.7893906 VMware.VimAutomation.Common
Script 10.0.0.7893909 VMware.VimAutomation.Core
Script 6.5.4.7567193 VMware.VimAutomation.HA
Script 7.1.0.7547311 VMware.VimAutomation.HorizonView
Script 10.0.0.7893904 VMware.VimAutomation.License
Script 10.0.0.7893913 VMware.VimAutomation.Nsxt
Script 10.0.0.7893924 VMware.VimAutomation.PCloud
Script 10.0.0.7893910 VMware.VimAutomation.Sdk
Script 10.0.0.7893900 VMware.VimAutomation.Srm
Script 10.0.0.7894167 VMware.VimAutomation.Storage
Script 1.2.0.0 VMware.VimAutomation.StorageUtility
Script 10.0.0.7893903 VMware.VimAutomation.Vds
Script 10.0.0.7893902 VMware.VimAutomation.Vmc
Script 10.0.0.7893921 VMware.VimAutomation.vROps
Script 6.5.1.7862888 VMware.VumAutomation
That is a rather old version, I would suggest upgrading to the latest version.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD
I ran Get-Module -Name VMware* -ListAvailable | update-module and now have the below versions but still getting the same failure, which module specifically is out of date thats failing on me here?
Version Name
------- ----
6.7.0.11233116 VMware.DeployAutomation
6.7.0.11233116 VMware.ImageBuilder
11.5.0.14912921 VMware.PowerCLI
6.7.0.14898114 VMware.Vim
11.5.0.14898113 VMware.VimAutomation.Cis.Core
11.0.0.10379994 VMware.VimAutomation.Cloud
11.5.0.14898112 VMware.VimAutomation.Common
11.5.0.14899560 VMware.VimAutomation.Core
11.5.0.14900247 VMware.VimAutomation.Hcx
7.10.0.14653756 VMware.VimAutomation.HorizonView
11.3.0.13990093 VMware.VimAutomation.License
11.5.0.14900141 VMware.VimAutomation.Nsxt
11.5.0.14898111 VMware.VimAutomation.Sdk
11.0.0.10380515 VMware.VimAutomation.Security
11.5.0.14899557 VMware.VimAutomation.Srm
11.5.0.14901686 VMware.VimAutomation.Storage
1.3.0.0 VMware.VimAutomation.StorageUtility
11.2.0.12483615 VMware.VimAutomation.Vds
11.5.0.14912923 VMware.VimAutomation.Vmc
10.0.0.7893921 VMware.VimAutomation.vROps
6.5.1.7862888 VMware.VumAutomation
You are on the last version, you should be ok (regarding the PowerCLI version).
Since you mentioned Pure Storage, are you using that type of storage?
In that case, did you check the Pure Storage KB already?
There is also KB53707 which mentions the vpxd.log.
Did you check that log for any more clues?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I can make this change manually in the html 5 just fine with the Edit Policies > Edit Vm Storage policies and then single handed pick the storage policy and replication group but I cant powercli it.
get the storage policies, I store the policy I want in a variable. I get the replication policies store that in a variable, and then attempt to set it on the VM the same way shown on some of the pure blogs its nothing fancy. Ive even tried to just use the default built in storage policies from vmware and those still fail.
nd its not "PBM error occurred during PreCreateCheckCallback: Connection refused" its "A general system error occurred: PBM error occurred during PreReconfigureCallback: Fault cause: vmodl.fault.SystemError" my vcenter is not using any of the VMware vSphere Profile-Driven Storage service, Im simply just trying to script the changing of storage policies on a VM from one to another.
LucD
this is what Im following
https://blog.purestorage.com/powercli-and-vvols-part-i-assigning-a-spbm-policy/
I realise it is not the same error, I was just mentioning that KB since it said to look for additional clues in the vpxd.log.
But if it works from the Web Client it seems indeed to point to a possible PowerCLI issue.
Since I don't have access to that type of storage I suggested asking on the vendor's forum.
You can also open an SR with GSS.
When they tell you that you need Developer Support for PowerCLI issues, refer to PowerCLI Support Breakdown
Errors in cmdlet are supported, errors in your scripts are not.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference