VMware Cloud Community
sujeetkp
Contributor
Contributor
Jump to solution

Unable Deploy VM with PowerCLI 6.5.4

I have installed PowerCLI 6.5.4 using the below link

https://www.powershellgallery.com/packages/VMware.PowerCLI/6.5.4.7155375

Install-Module -Name VMware.PowerCLI -RequiredVersion 6.5.4.7155375

I can see it is installing "VMware PowerCLI 11.0.0 build 10380590" even if I am asking it to install 6.5.4.7155375 version.

Also I can see it is downloading the updated version of each dependent module.

When I create a new vm using the below command. It is failing with the error. 

Please help.

$New_VM = New-VM -VMHost $VMHost -Name $Name -Datastore $Datastore -Template $Template

Error

[Main] ERR[1-01-000-0004] : [New-VM|832] Failed to Provision VM. |Reason: 2/19/2019 5:05:07 PM  New-VM  Could not obtain the result of task '/VIServer=vsphere.local\xxxx@xx.xx.xx.xx:xx/Task=Task-task-938/'. Task name is'CloneVM_Task'. The following error occured: Method not found: 'VMware.VimAutomation.ViCore.Interop.V1.VIAutomation VMware.VimAutomation.ViCore.Interop.V1.VIObjectCoreInterop.get_Client()'.

--------------------------------------------------------------------------------------------------------------------------------

PS C:\Users\Administrator.SA> Get-PowerCLIVersion

WARNING: The cmdlet "Get-PowerCLIVersion" is deprecated. Please use the 'Get-Module' cmdlet instead.

 

PowerCLI Version

----------------

   VMware PowerCLI 11.0.0 build 10380590

---------------

Component Versions

---------------

   VMware Cis Core PowerCLI Component PowerCLI Component 11.0 build 10335701

   VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 11.0 build 10336080

   VMware Vds PowerCLI Component 6.5 build 5374428

   VMware Cloud PowerCLI Component 6.5 build 5375799

   VMware PCloud PowerCLI Component 6.5 build 5376282

   VMware Storage PowerCLI Component 6.5 build 7154886

   VMware HorizonView PowerCLI Component 7.1.0 build 10230451

   VMware High Availability PowerCLI Component 6.0 build 000000

   VMware vROps PowerCLI Component 6.5 build 5375723

   VMware vSphere Update Manager PowerCLI 6.5 build 7862888

   VMWare ImageBuilder PowerCLI Component 6.7 build 8250345

   VMWare AutoDeploy PowerCLI Component 6.7 build 8250345

 

   VMware Licensing PowerCLI Component 6.5 build 5375648

--------------------------------------------------------------------------------------------------------------

PS C:\Users\Administrator.SA> Get-module -ListAvailable

    Directory: C:\Program Files\WindowsPowerShell\Modules

 

 

ModuleType Version    Name                                ExportedCommands                                             

---------- -------    ----                                ----------------                                             

Binary     1.0.0.1    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider, Get-Packa...

Script     1.0.0.1    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...} 

Script     6.7.0.8... VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-D...

Script     6.7.0.8... VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-Esx...

Manifest   6.5.4.7... VMware.PowerCLI                                                                                  

Script     6.7.0.1... VMware.Vim                                                                                       

Script     11.0.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, G...

Script     11.0.0.... VMware.VimAutomation.Common                                                                      

Script     11.0.0.... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAd...

Script     6.5.4.7... VMware.VimAutomation.HA             Get-DrmInfo                                                  

Script     7.6.0.1... 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-PIComputeInsta...

Script     11.0.0.... VMware.VimAutomation.Sdk            {Get-ErrorReport, Get-InstallPath, Get-PSVersion}            

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-SpbmStoragePo...

Script     1.3.0.0    VMware.VimAutomation.StorageUtility Update-VmfsDatastore                                         

Binary     6.5.1.5... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, E...

Binary     6.5.4.7... VMware.VimAutomation.Vmc            {Connect-Vmc, Disconnect-Vmc, Get-VmcService, Connect-VmcS...

Binary     6.5.1.5... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-O...

Script     6.5.1.7... VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Complia...

 
PS C:\Users\Administrator.SA> Get-PowerCLIVersion
WARNING: The cmdlet "Get-PowerCLIVersion" is deprecated. Please use the 'Get-Module' cmdlet instead.
 
PowerCLI Version
----------------
   VMware PowerCLI 11.0.0 build 10380590
---------------
Component Versions
---------------
   VMware Cis Core PowerCLI Component PowerCLI Component 11.0 build 10335701
   VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 11.0 build 10336080
   VMware Vds PowerCLI Component 6.5 build 5374428
   VMware Cloud PowerCLI Component 6.5 build 5375799
   VMware PCloud PowerCLI Component 6.5 build 5376282
   VMware Storage PowerCLI Component 6.5 build 7154886
   VMware HorizonView PowerCLI Component 7.1.0 build 10230451
   VMware High Availability PowerCLI Component 6.0 build 000000
   VMware vROps PowerCLI Component 6.5 build 5375723
   VMware vSphere Update Manager PowerCLI 6.5 build 7862888
   VMWare ImageBuilder PowerCLI Component 6.7 build 8250345
   VMWare AutoDeploy PowerCLI Component 6.7 build 8250345
   VMware Licensing PowerCLI Component 6.5 build 5375648
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

If you can, go for PS v5.1


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

Did you already try with

Find-Module -Name VMware.PowerCLI -MaximumVersion ([Version]'6.5.5') |

Install-Module


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
sujeetkp
Contributor
Contributor
Jump to solution

Yes I have tried this as well. However I dont see how this is different than Install-Module -Name VMware.PowerCLI -RequiredVersion 6.5.4.7155375

Note: I tried it on a fresh server.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Which PowerShell version are you using?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
sujeetkp
Contributor
Contributor
Jump to solution

PS C:\Users\Administrator.SA> $PSVersionTable

 

Name                           Value                                                          

----                           -----                                                          

PSVersion                      4.0                                                            

WSManStackVersion              3.0                                                            

SerializationVersion           1.1.0.1                                                        

CLRVersion                     4.0.30319.42000                                                

BuildVersion                   6.3.9600.17400                                                 

PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}                                           

PSRemotingProtocolVersion      2.2   

PS C:\Users\Administrator.SA> $PSVersionTable
 
Name                           Value                                                          
----                           -----                                                          
PSVersion                      4.0                                                            
WSManStackVersion              3.0                                                            
SerializationVersion           1.1.0.1                                                        
CLRVersion                     4.0.30319.42000                                                
BuildVersion                   6.3.9600.17400                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}                                           
PSRemotingProtocolVersion      2.2   PS C:\Users\Administrator.SA> $PSVersionTable
 
Name                           Value                                                          
----                           -----                                                          
PSVersion                      4.0                                                            
WSManStackVersion              3.0                                                            
SerializationVersion           1.1.0.1                                                        
CLRVersion                     4.0.30319.42000                                                
BuildVersion                   6.3.9600.17400                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}                                           
PSRemotingProtocolVersion      2.2   PS C:\Users\Administrator.SA> $PSVersionTable
 
Name                           Value                                                          
----                           -----                                                          
PSVersion                      4.0                                                            
WSManStackVersion              3.0                                                            
SerializationVersion           1.1.0.1                                                        
CLRVersion                     4.0.30319.42000                                                
BuildVersion                   6.3.9600.17400                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}                                           
PSRemotingProtocolVersion      2.2   
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Is there a reason you are on PS v4?
Can you upgrade to PS v5.1?

The module versioning with PS v4 had some flaws.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
sujeetkp
Contributor
Contributor
Jump to solution

Compatibility matrix says Powershell version supported is 3.0 and above.

https://vdc-download.vmware.com/vmwb-repository/dcr-public/20b4a203-8696-4585-84a5-7335e119c3d7/8086...

So I did not think that i will find an issue in PS4.

I will upgrade to PS5 and try it. Thanks

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

If you can, go for PS v5.1


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos