PowerCLI-Example-Scripts
PowerCLI-Example-Scripts copied to clipboard
HZN 7.8 vs. 7.11 Add VC
We have Did this functionality change in the 7.11 release?
The add vcenter that worked with 7.9 and 7.10 does not work with 7.11
Below is the error message. A customer next week is looking to roll-out 170+ horizon pods and automation will be required.
Exception calling "VirtualCenter_Create" with "2" argument(s): "ExceptionType : VMware.Hv.UnexpectedFault ErrorMessage : Failed to add vc instance: No enum constant com.vmware.vdi.commonutils.Thumbprint.Algorithm.SHA-1 CauseString : java.lang.IllegalArgumentException: No enum constant com.vmware.vdi.commonutils.Thumbprint.Algorithm.SHA-1 CauseStackTrace : System.String[]
This code snippet: worked prior to release 7.11
#fix for 7.8 and greater
$certificate_override.sslCertThumbprintAlgorithm = 'DER_BASE64_PEM' $certificate_override.sslCertThumbprint = $cert_data.certificate
$certificate_override.sslCertThumbprintAlgorithm = $cert_data.certificateEncoding
$vc_spec_helper.getDataObject().CertificateOverride = $certificate_override
$StorageAccelerator = New-Object VMware.Hv.VirtualCenterStorageAcceleratorData $StorageAccelerator.Enabled = $true $StorageAccelerator.DefaultCacheSizeMB = 2048
$vc_spec_helper.getDataObject().StorageAcceleratorData =$StorageAccelerator
Make service call
$vcId = $vc_service.VirtualCenter_Create($ViewAPI, $vc_spec_helper.getDataObject())