Skip to main content
Question

Script to add VMs to Subclient

  • February 10, 2023
  • 4 replies
  • 165 views

Forum|alt.badge.img+2

Hello everyone,

I am looking for a script to add Vmware VMs to subclient.  I have been poking around Powershell SDK/Commands but i am not successful so far with the latest Powershell v32 SDK

 

Eventually i need to feed VM Names from csv file and loop through but for now just testing with a single VM. 

Add-CVVirtualMachine -ClientName myVCenter -SubclientName z_Subclient_0400PM -EntityType VM -Entity my-vmname

 

Getting following error: 

“Get-CVVirtualMachine : A parameter cannot be found that matches parameter name 'Name'.
At C:\Program Files\WindowsPowerShell\Modules\CommvaultPowerShell\0.2.11\custom\oldsdk\Add-CVVirtualMachine.ps1:166 char:61
+ ...                         $vmProps = Get-CVVirtualMachine -Name $entity ...
+                                                             ~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-CVVirtualMachine], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Get-CVVirtualMachine 

 

Thanks,

 

4 replies

Forum|alt.badge.img
  • Vaulter
  • February 10, 2023

Thank you for reporting this error.

We will fix this soon.

This cmdlet is available in the old SDK : https://github.com/Commvault/CVPowershellSDK as well.

You can uninstall the existing version and install through this github which will work for your requirement for now.  


Forum|alt.badge.img+2
  • Author
  • Byte
  • February 10, 2023

thank you! problem is that, the old sdk works for a single VM but fails to add multiple VM in the list well. 

 

Add-CVVirtualMachine -ClientName myVCenter -SubclientName z_Subclient_0400PM -EntityType VM -Entity my-vmname, my_vmname2, my_vmname3

 

Any ETA when will get it fixed? 

 

Thank you!


Forum|alt.badge.img+2
  • Author
  • Byte
  • February 14, 2023

@JnaneshD do you know if this is fixed in 0.2.13 ? 


Forum|alt.badge.img
  • Vaulter
  • February 15, 2023

Hi @Just Learning , 

It is not been fixed yet. We will work on this and update.

Thanks