Greetings All,
i am facing a rather bizarre error
When i run the Get-VDSwitch I get below errors |
---|
Get-VDSwitch : 25/05/2018 2:34:25 p.m. Get-VDSwitch Method not found: 'VMware.VimAutomation.ViCore.Interop.V1.VIAutomation VMware.VimAutomation.ViCore.Interop.V1.VIObjectCoreInterop.get_Client()'. At line:40 char:18 + get-datacenter | Get-VDSwitch + ~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-VDSwitch], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Vds.Commands.GetVDSwitch |
When i run Add-VDSwitchPhysicalNetworkAdapter i get below errors |
---|
Add-VDSwitchPhysicalNetworkAdapter : 25/05/2018 2:40:36 p.m. Add-VDSwitchPhysicalNetworkAdapter Method not found: 'VMware.VimAutomation.ViCore.Interop.V1.VIAutomation VMware.VimAutomation.ViCore.Interop.V1.VIObjectCoreInterop.get_Client()'. At I:\rm scripts\Migrate-vmnci3TovDSNetwork.ps1:86 char:10 + Add-VDSwitchPhysicalNetworkAdapter -DistributedSwitch $vDSwi ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Add-VDSwitchPhysicalNetworkAdapter], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Vds.Commands.Cmdlets.AddVDSwitchPhysicalNetworkAdapter |
From what i gather, this error seems to tell me that vds module is not loaded and or used.
Here's the setup;
Server: Windows Server 2008 R2
dotnet: 4.6.2
powershell v5.1.b14409
PowerCli Modules: 6.5.4
Saved in Directory: C:\Users\rm\Documents\WindowsPowerShell\Modules\
$Env:PSModulePath
C:\Users\rmDocuments\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
I have the below modules and are imported in my profile
Get-Module –ListAvailable VM* | Import-Module |
---|
Directory: C:\Users\rm\Documents\WindowsPowerShell\Modules ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 6.7.0.8... VMware.DeployAutomation {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...} Script 6.7.0.8... VMware.ImageBuilder {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImageProfile...} Manifest 6.5.4.7... VMware.PowerCLI Script 6.7.0.8... VMware.Vim Script 10.1.0.... VMware.VimAutomation.Cis.Core {Connect-CisServer, Disconnect-CisServer, Get-CisService} Binary 6.5.1.5... VMware.VimAutomation.Cloud {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...} Script 10.1.0.... VMware.VimAutomation.Common Script 10.1.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} Binary 6.5.1.5... VMware.VimAutomation.License Get-LicenseDataManager Binary 2.0.0.6... VMware.VimAutomation.Nsxt {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtService} Binary 6.5.1.5... VMware.VimAutomation.PCloud {Connect-PIServer, Disconnect-PIServer, Get-PIComputeInstance, Get-PIDatacenter} Script 10.1.0.... VMware.VimAutomation.Sdk {Get-PSVersion, Get-InstallPath} Binary 6.5.1.5... VMware.VimAutomation.Srm {Connect-SrmServer, Disconnect-SrmServer} Binary 6.5.4.7... VMware.VimAutomation.Storage {Add-KeyManagementServer, Copy-VDisk, Export-SpbmStoragePolicy, Get-KeyManagementServer...} Script 1.2.0.0 VMware.VimAutomation.StorageUtility Update-VmfsDatastore Binary 6.5.1.5... VMware.VimAutomation.Vds {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDSwitch...} Binary 6.5.4.7... VMware.VimAutomation.Vmc {Connect-Vmc, Disconnect-Vmc, Get-VmcService, Connect-VmcServer...} Binary 6.5.1.5... 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...} |
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
So i check the below
Get-VICommand *switch |
---|
CommandType Name Version Source ----------- ---- ------- ------ Cmdlet Export-VDSwitch 6.5.1.5... VMware.VimAutomation.Vds Cmdlet Get-VDSwitch 6.5.1.5... VMware.VimAutomation.Vds Cmdlet Get-VirtualSwitch 10.1.0.... VMware.VimAutomation.Core Cmdlet New-VDSwitch 6.5.1.5... VMware.VimAutomation.Vds Cmdlet New-VirtualSwitch 10.1.0.... VMware.VimAutomation.Core Cmdlet Remove-VDSwitch 6.5.1.5... VMware.VimAutomation.Vds Cmdlet Remove-VirtualSwitch 10.1.0.... VMware.VimAutomation.Core Cmdlet Set-VDSwitch 6.5.1.5... VMware.VimAutomation.Vds Cmdlet Set-VirtualSwitch 10.1.0.... VMware.VimAutomation.Core |
I'm lost, as to what's happening here.
I am trying to migrate physical nics from Standard Switch to Distributed Switch, but this error messages are beyond me.LucD Any assistance will be appreciated.
Your PowerCLI installation seems to be mixed up, there are 6.5.4 and 10.1.0 modules in your folder.
On a clean 0.1.0 installation you should see.
Name Version
---- -------
VMware.DeployAutomation 6.7.0.8250345
VMware.ImageBuilder 6.7.0.8250345
VMware.PowerCLI 10.1.0.8403314
VMware.Vim 6.7.0.8343295
VMware.VimAutomation.Cis.Core 10.1.0.8377811
VMware.VimAutomation.Cloud 10.0.0.7893901
VMware.VimAutomation.Common 10.1.0.8342134
VMware.VimAutomation.Core 10.1.0.8344055
VMware.VimAutomation.HA 6.5.4.7567193
VMware.VimAutomation.HorizonView 7.1.0.7547311
VMware.VimAutomation.License 10.0.0.7893904
VMware.VimAutomation.Nsxt 10.1.0.8346947
VMware.VimAutomation.PCloud 10.0.0.7893924
VMware.VimAutomation.Sdk 10.1.0.8342078
VMware.VimAutomation.Srm 10.0.0.7893900
VMware.VimAutomation.Storage 10.1.0.8313015
VMware.VimAutomation.StorageUtility 1.2.0.0
VMware.VimAutomation.Vds 10.1.0.8344219
VMware.VimAutomation.Vmc 10.0.0.7893902
VMware.VimAutomation.vROps 10.0.0.7893921
VMware.VumAutomation 6.5.1.7862888
I would suggest to remove PowerCLI completely (just delete the folders), and then reinstall from scratch.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Your PowerCLI installation seems to be mixed up, there are 6.5.4 and 10.1.0 modules in your folder.
On a clean 0.1.0 installation you should see.
Name Version
---- -------
VMware.DeployAutomation 6.7.0.8250345
VMware.ImageBuilder 6.7.0.8250345
VMware.PowerCLI 10.1.0.8403314
VMware.Vim 6.7.0.8343295
VMware.VimAutomation.Cis.Core 10.1.0.8377811
VMware.VimAutomation.Cloud 10.0.0.7893901
VMware.VimAutomation.Common 10.1.0.8342134
VMware.VimAutomation.Core 10.1.0.8344055
VMware.VimAutomation.HA 6.5.4.7567193
VMware.VimAutomation.HorizonView 7.1.0.7547311
VMware.VimAutomation.License 10.0.0.7893904
VMware.VimAutomation.Nsxt 10.1.0.8346947
VMware.VimAutomation.PCloud 10.0.0.7893924
VMware.VimAutomation.Sdk 10.1.0.8342078
VMware.VimAutomation.Srm 10.0.0.7893900
VMware.VimAutomation.Storage 10.1.0.8313015
VMware.VimAutomation.StorageUtility 1.2.0.0
VMware.VimAutomation.Vds 10.1.0.8344219
VMware.VimAutomation.Vmc 10.0.0.7893902
VMware.VimAutomation.vROps 10.0.0.7893921
VMware.VumAutomation 6.5.1.7862888
I would suggest to remove PowerCLI completely (just delete the folders), and then reinstall from scratch.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I had initially run the below code;
Save-Module -Name VMware.PowerCLI -Path <path> -RequiredVersion 6.5.4.7155375 as per PowerShell Gallery | VMware.PowerCLI 6.5.4.7155375
But it appears it also downloads some modules with v10.* due to inter-dependencies.
I ran Save-Module -Name VMware.PowerCLI -Path I:\PowerCLI to get the latest and can confirm I have modules as you have advised above.
Since then, my VDS commands are working fine.
Many thanks
also if it could be of help to someone...
after an update that will fix/synch the PowerCLI environment, it is possible to have inside a module folder both the old and new module subfolders. Just delete the old one and that will fix it