vCenter Plugins, SSL certificates, ExtensionManager and Powershell – what more could you want for Christmas?

I was recently working in a lab environment trying to register the vCenter Operations 5.6 virtual appliance into a vCenter Virtual Appliance environment. As a standard practice I like to issue CA signed certificates to everything — even in a lab environment — so I’ll know what to expect in production.

Even after replacing the SSL certificate (here are some instructions on that process: http://www.bussink.ch/?p=458) you’ll still get an SSL warning because the plugin is registered by IP address instead of DNS name. There is another great article here: http://www.vstable.com/2012/04/02/vcenter-operations-5-x-vcenter-plugin-uses-ip-instead-of-dns-hostname/ that includes a two step process to resolve the warnings.

Step 1 is easy and very straight forward…you use vi or some other text editor to update a file on the UI virtual appliance. The second step is a little more challenging because I’m working with the vCenter Virtual Appliance and the embedded database, making the required database changes a bit tougher. Since the article described where to find this value in the Managed Object Browser, I figured I could find and update it from PowerCLI.

[cc lang=”Powershell”]
$exMgr = Get-View ExtensionManager
$vcops = $exMgr.ExtensionList | ?{$_.key -eq ‘com.vmware.vcops’}
$vcops.Server[0].Url = “https://vcops-ui/vcops-vsphere/viClientConfig.xml”
$exMgr.UpdateExtension($vcops)
[/cc]

This code is fairly straightforward.
Line 1: Use Get-View to connect to the ExtensionManager where vSphere plugins are registered.
Line 2: Find the vCOps plugin and make a copy of all the properties to a variable called $vcops.
Line 3: Update only the Server URL to use a name instead of an IP address
Line 4: Use the ExtensionManager connection from line 1 to write the updated $vcops extension back to vCenter

A refresh of the MOB shows that this updated value is immediately available — even without a restart of the vCenter Service.

This entry was posted in Scripting, Virtualization. Bookmark the permalink.

4 Responses to vCenter Plugins, SSL certificates, ExtensionManager and Powershell – what more could you want for Christmas?

  1. Alexander says:

    Hello,

    Did you try this script at vSphere 6?

    $exMgr = Get-View ExtensionManager
    $rbd = $exMgr.ExtensionList | ?{$_.key -eq ‘com.vmware.rbd’}
    $exMgr.UpdateExtension($rbd)

    UpdateExtension” with “1” argument: “A specified parameter was not correct: extension.extendedProductInfo.companyUrl”
    C:\temp\url.ps1:17
    + $exMgr.UpdateExtension($rbd)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : VimException

  2. virvar says:

    hi,
    may try to initialise two child/sub objects …
    Older versions of the API haven’t seen them as mandatory ..
    $ExtExtendedProductInfo = New-Object VMware.Vim.ExtExtendedProductInfo
    $ExtSolutionManagerInfo = New-Object VMware.Vim.ExtSolutionManagerInfo
    $rbd.ExtendedProductInfo = $ExtExtendedProductInfo
    $rbd.SolutionManagerInfo = $ExtSolutionManagerInf
    … they will parsed by the method

  3. AK says:

    Alexander and Vivar are correct. with vSphere 6.0 you need to add Vivars options. Here’s a ‘consolidated’ version of the script that works with vSphere 6.0 and the latest vROPs 6.1

    You just need to change ‘vrops-fqdn’ to the fqdn of your vROPS server.

    $extMgr = Get-View ExtensionManager
    $vRops = $extMgr.ExtensionList | ?{$_.key -eq ‘com.vmware.vcops’}
    $vRops.Server[0].Url = “https://vrops-fqdn/vcops-ngc.zip”
    $ExtExtendedProductInfo = New-Object VMware.Vim.ExtExtendedProductInfo
    $ExtSolutionManagerInfo = New-Object VMware.Vim.ExtSolutionManagerInfo
    $vRops.ExtendedProductInfo = $ExtExtendedProductInfo
    $vRops.SolutionManagerInfo = $ExtSolutionManagerInfo
    $extMgr.UpdateExtension($vRops)

    AK

  4. Sukey says:

    This has made my day. I wish all poingtss were this good.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.