*** UPDATE 12/18/14 ***
Instead of this blog, I strongly suggest you use and follow the
Configuring VMware vCenter SSO High Availability for VMware vRealize Automation Technical Whitepaper. It is somewhat more comprehensive and authoritative. For VMware documentation, it’s really good.
*** UPDATE ***
I love the simplicity of the vCenter Server Appliance and the VMware Identity Appliance for vCAC, but neither offer a high availability option better than vSphere HA. There are use cases where you’d need your SSO service to offer better uptime and resilience. In addition, there is some SSL certificates to be configured and for that, we’ll follow the instructions in KB2034833, KB2061934 and KB2034181.
Notes, caveats, warnings
AFAIK, this will only work with vSphere 5.5. v5.1 handles SSO differently. I’m only using two nodes, if you have more, there will be extra steps. I do not have intermediate CAs, if you do, consult the KBs for the additional steps. I’m going to use a vCloud Networking and Security Edge Gateway as my load-balancer. It does not offer SSL offload like some other load-balancers do, so you may have to take extra steps to configure SSL offload.

Prerequisites
Reserve the IP addresses for your actual SSO servers, plus the Virtual IP address.
Add A or CNAME records to your DNS for the SSO servers and the virtual IP.
The DNS name of the virtual IP is what the SSL certificate must match (vcsso in my case)
You should have an edge gateway already configured with an interface in the same networks as your virtual IP and actual SSO servers.
First SSO Server
I’m starting with two freshly deployed Windows Server 2008 R2 VMs, joined to the domain and named vcsso1 and vcsso2. On vcsso1, install the Single Sign-on service. Be sure the prerequisites are all ok.
On the deployment mode step, choose “vCenter Single Sign-On for your first vCenter Server”
Next,next,finish your way through the installation. You’ve set up an SSO server, YAY!
Second SSO Server
On the second server, vcsso, also install the SSO service. We’re going to make a few different selections than we did on vcsso1 though. On the deployment mode step, here we’re going to select “vCenter Single Sign-On for an additional vCenter Server in an existing site”.
Next, we’re prompted for information about the first, or partner, SSO server.
We have to confirm that the information obtained from the first SSO server is correct, so click Continue.
Then we select the site name configured on the first SSO server. I named mine “Lab”, but you can leave yours as “Default-First-Site” or whatever makes sense for your environment.
From here, you’ll Next,Next,Finish your way to completion.
Generating the Cert
Prerequisites: Either the VMware ssl-certificate-updater-tool or OpenSSL Win32 v0.9.8
- Log on to the first SSO server (vcsso1), extract the VMware SSL certificate updater tool to C:\ssltool or similar. Create folders named “C:\certs\sso“. Open notepad and paste the following:
[ req ]
default_bits = 2048
default_keyfile = rui.key
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS:ServerShortName, IP:ServerIPAddress, DNS:server.domain.com, DNS:ServerIPAddress
[ req_distinguished_name ]
countryName = Country
stateOrProvinceName = State
localityName = City
0.organizationName = Company Name
organizationalUnitName = vCenterSSO
commonName = server.domain.com - Replace the values in red with those appropriate for your environment. Be sure to specify the server name and IP address as the Virtual IP and its associated DNS record. Save the file as c:\certs\sso\sso.cfg
- At a command prompt, navigate to the folder containing openssl.exe (eg: C:\ssltool\tools\openssl). Run this command to create the key and certificate site request (CSR):
openssl req -new -nodes -out c:\certs\sso\rui.csr -keyout c:\certs\sso\rui-orig.key -config c:\certs\sso\sso.cfg
- In the same command prompt, run this to change the key to the necessary type.
openssl rsa -in c:\certs\sso\rui-orig.key -out c:\certs\sso\rui.key - Follow the steps in KB2062108 to create the appropriate certificate template in you Active Directory Certificate Authority.
- Log into the Microsoft CA certificate authority Web interface. By default, it is http://servername/CertSrv/.
- Click the Request a certificate link.Click advanced certificate request.
- Click the Submit a certificate request by using a base-64-encoded CMC or PKCS #10 file, or submit a renewal request by using a base-64-encoded PKCS #7 file link.
- Open the certificate request (rui.csr) in notepad. Copy the content between —–BEGIN CERTIFICATE REQUEST—– and —–END CERTIFICATE REQUEST—–
- Paste the copied content into the “Base-64-encoded certificate request” textarea. Select VMware Certificate as the Certificate Template. See KB2062108 if you don’t have the “VMware Certificate” template
- Click Submit to submit the request.
- Click Base 64 encoded on the Certificate issued screen. Click the Download Certificate Chain link.
- Save the package as C:\certs\certnew.p7b.
- Double-click the p7b to open it in certmgr. Navigate to Certificates – Current User\C:\Certs\Certnew.p7b\Certificates.
- You’ll see two certificates here (unless you have intermediate certificates, then you’ll have more).
- Right-click the one for the SSO server, choose All Tasks|Export. Save the file as Base-64 encoded X.509 (.CER) to c:\certs\sso\rui.crt
- Right-click the one for root CA server, choose All Tasks|Export. Save the file as Base-64 encoded X.509 (.CER) to c:\certs\root.cer .. Close certmgr.
- Generate the pfx by running this command:
openssl pkcs12 -export -in c:\certs\sso\rui.crt -inkey c:\certs\sso\rui.key -certfile c:\certs\Root64.cer -name "ssoserver" -passout pass:changeme -out c:\certs\sso\ssoserver.p12
Note: The certificate store password must be changeme and the key alias must be ssoserver. Do not change these parameters.
Install and Configure the Certificate
- While logged on to the first SSO server (vcsso1) as an administrator, make sure this folder exists: C:\Program Files\Common Files\VMware vCenter Server – Java Components If it doesn’t, you’ll need to check your SSO installation
- Open an elevated command prompt (as administrator) and enter the following
SET JAVA_HOME=C:\Program Files\Common Files\VMware vCenter Server - Java Components
SET PATH=%PATH%;C:\Program Files\VMware\Infrastructure\VMware\CIS\vmware-sso;%JAVA_HOME%\bin - In the command prompt, cd to the folder containing openssl.exe (eg: C:\ssltool\tools\openssl)
- Generate a subject hash from the certificate using this command:
openssl x509 -subject_hash -noout -in c:\certs\root.cer
This will return an 8-character hash. Record it, we’ll need it later
- On both SSO servers, create the folder C:\ProgramData\VMware\SSL
- On both SSO servers, copy c:\certs\root.cer to C:\ProgramData\VMware\SSL renaming it to ca_certificates.crt
- On both SSO servers, copy c:\certs\root.cer to C:\ProgramData\VMware\SSL again, this time renaming it to <subjecthash>.0 (replacing <subjecthash> with your hash value from above and appending dot zero)
- Just on the first SSO server, paste the following into a text file named c:\certs\gc.properties. Replace the red text with appropriate values.
[service]
friendlyName=The group check interface of the SSO server
version=1.5
ownerId=
productId=product:sso
type=urn:sso:groupcheck
description=The group check interface of the SSO server
[endpoint0]
uri=https://SSOserver.domain.com:7444/sso-adminserver/sdk/vsphere.local
ssl=c:\certs\Root64.cer
protocol=vmomi - Paste the following into a text file named c:\certs\admin.properties. Replace the red text with appropriate values.
[service]
friendlyName=The administrative interface of the SSO server
version=1.5
ownerId=
productId=product:sso
type=urn:sso:admin
description=The administrative interface of the SSO server
[endpoint0]
uri=https://SSOserver.domain.com:7444/sso-adminserver/sdk/vsphere.local
ssl=c:\certs\Root64.cer
protocol=vmomi - Paste the following into a text file named c:\certs\sts.properties. Replace the red text with appropriate values.
[service]
friendlyName=STS for Single Sign On
version=1.5
ownerId=
productId=product:sso
type=urn:sso:sts
description=The Security Token Service of the Single Sign On server.
[endpoint0]
uri=https://SSOserver.domain.com:7444/sts/STSService/vsphere.local
ssl=c:\certs\Root64.cer
protocol=wsTrust - Next, we need the service ID for each of the three services SSO uses. To get these, run the following command, replacing the red text with the FQDN to your first SSO server:
ssolscli.cmd listServices https://vcsso1.domain.local:7444/lookupservice/sdk
- The service ID for each service should be saved to a file. Use quickedit to copy the service id for each and echo it to a file:
- Update the Group Check service:
ssolscli updateService -d https://ssoserver.domain.com:7444/lookupservice/sdk -u SSO_administrator -p password -si c:\certs\gc_id -ip c:\certs\gc.properties
- Update the Admin service:
ssolscli updateService -d https://ssoserver.domain.com:7444/lookupservice/sdk -u SSO_administrator -p password -si c:\certs\admin_id -ip c:\certs\admin.properties
- Update the STS service:
ssolscli updateService -d https://ssoserver.domain.com:7444/lookupservice/sdk -u SSO_administrator -p password -si c:\certs\sts_id -ip c:\certs\sts.properties
- Copy the new SSL files to C:\ProgramData\VMware\CIS\runtime\VMwareSTS\conf on both/all SSO servers:
copy C:\certs\SSO\ssoserver.p12 C:\ProgramData\VMware\CIS\runtime\VMwareSTS\conf\ssoserver.p12
copy C:\certs\Root.cer C:\ProgramData\VMware\CIS\runtime\VMwareSTS\conf\ssoserver.crt
copy C:\certs\SSO\rui.key C:\ProgramData\VMware\CIS\runtime\VMwareSTS\conf\ssoserver.key
- Stop and restart the VMware Secure Token Service on both servers
Preparing to load-balance
- Navigate to http://firstssoserver.domain.local:7444/sts/STSService/vsphere.local notice that the certificate gives an error, but look at the cert. The certificate should return the “common” name (in my case, “vcsso” instead of “vcsso1”. Repeat this for the second and subsequent SSO servers, verifying that they provide the same certificate
- Using vCNS Manager, locate the appropriate edge gateway, click Actions|Manage to open it for editing
- On the Configure Tab, edit the interface that will listen on the virtual IP
- Edit the Subnet and add the Virtual IP. It’s probably not the primary IP. Save and publish those changes
- On the Load Balancer tab, on the Pools page, click “Enable”, then “Publish Changes”
- Click the green plus to add a load-balancing pool
- Enter a recognizable Name and Description, click “Next”
- On the Services step, check HTTPS, set Balancing Method to “ROUND_ROBIN” and the Port to 7444. Clck “Next”
- On the Health Check step, set it as shown. Click “Next” when done.
- On the members step, click the green plus to add the IP address of you SSO servers to the pool. I suggest keeping the weifght for each at 1, unless you have a reason to send more requests to specific nodes. Keep the HTTPS port and Monitor Port at 7444 for each. Click “Next” once all you members are added.
- Review the Ready to complete step and click “Finish” if it all correct
- Click the Publish Changes Button before proceeding
- Click the “Virtual Servers” link, then the green plus to add a Virtual Server
- Enter a meaningful name and description, provide the Virtual IP adddress that you added to the edge earlier, select the Pool created in the steps above and Enable HTTPS on port 7444. Set the Persistence Method to SSL_SESSION_ID and make the “Enabled” box is checked. Click “Add” then “Publish Changes”
- Test by navigating to https://ssovirtual.domain.local:7444/lookupservice/sdk and https://ssovirtual.domain.local:7444/sts/STSService/vpshere.local verifying that the certificates match.
- YAY, load-balanced SSO with matching SSL certs!
One more thing….
Using your favorite web browser, navigate to http://ssovirtual.domain.local:7444/websso/SAML2/Metadata/vsphere.local
you’ll be prompted to download and save an XML file named vsphere.download. Now open the XML file in notepad or Notepad++. First, make sure you received a readable XML file. Second, noticed that the EntitiesDescriptor/EntityDescriptor entityID property is server-specific. We’ll need both servers to respond with the same information.
<EntitiesDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:vmes="http://vmware.com/schemas/attr-names/2012/04/Extensions" Name="vsphere.local" validUntil="2014-08-12T23:54:04Z">
<Extensions>
<vmes:ExportedOn>2014-08-11T23:54:04Z</vmes:ExportedOn>
<vmes:ExportedBy>Exported by VMware Identity Server (c) 2012</vmes:ExportedBy>
</Extensions>
<EntityDescriptor entityID="https://VCSSO1.domain.local:7444/websso/SAML2/Metadata/vsphere.local">
<IDPSSODescriptor WantAuthnRequestsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<KeyDescriptor xmlns:ds="http://www.w3.org/2000/09/xmldsig#" use="signing">
<ds:KeyInfo>
<snip...>
Warning This is not in a VMware KB, and may not be best way to do it. Having the value in the EntitiesDescriptor/EntityDescriptor entityID property match the FQDN is going to be very important in the near future. Trust me.
- On each server, open C:\ProgramData\VMware\CIS\cfg\vmware-sso\hostname.txt. It only contains the resolved hostname, so update it to the virtual hostname (vcsso.ragaazzi.lab in my case) save the file
- Retrieve the XML file from http://ssovirtual.domain.local:7444/websso/SAML2/Metadata/vsphere.local again open it and confirm that it contains the virtual hostname
Conclusion
This was such a lengthy post, I considered breaking it up, but there was no good break-point. Thanks for sticking with it. This is mostly for my own benefit, hopefully you’ll find it helpful too.