02 Dec 2020 by Simon Greaves
Replacing certificates in VCD is a fairly straight forward process and can be made significantly easier if you deviate from the procedure outlined in the official VMware documentation and instead use a simple load balancer and install the same certificate and key pairs on each node within the VCD cluster. Let me explain.
As a service designed for external public consumption, VCD uses two internet facing IP addresses for providing the key VCD services:
As the names suggest, http (port 443) is for web traffic such logging into the web portal and the console proxy (port 8443) is for providing the console sessions to the underlying virtual machines for things such as OS installation. Historically these services required different IP addresses, however with the VCD appliances these two services run on the same network adapter, eth0, leaving eth1 for other network traffic types. By running on two different ports the same network adapter can provide both services.
Note It is possible to change the port for the console proxy to say 443 however this is beyond the scope of this guide.
To make these two service http and console proxy available across multiple VCD instances in a group, or cells, a load balancer is required.
The VMware documentation has always recommended using L7 application load balancing with SSL offload on a load balancer for the http service and L4 SSL passthrough for the console proxy service. Whilst this can work well I think this is an unnecessarily complex design for most deployments and would strongly recommend configuring just a single L4 load balancer for the backend cells which can service both traffic types.
Using the historic method of load balancing with SSL offload, you do gain the ability to configure load balancing rules such as creating an “administrative zone” for internal VCD requests to present an internal CA-signed certificate for internal users such as VCD admins and another “public zone” load-balancing rule for customer connections to present a public CA-signed certificate to users who do not have awareness of the internal admin zone domain. However this sort of configuration is complex.
A simpler way to achieve this two-zone configuration would be to install the public CA-signed certificate on every cell and configure internal DNS with an A record for the public internet address so that both public users and internal users send requests to the same public FQDN.
Both these approaches present the same public CA signed certificate. See the diagram below.
In both these scenarios the public CA-Signed certificate is installed on the backend servers, as mentioned in the box next to the servers. Each cell requires three key items.
For guidance on how to do these pre-install steps, check out the various Openssl guides out there such as this one at digicert. It’s a fairly straight forward process.
/tmp
directory on the cell using SCP or WinSCP./opt/vmware/vcloud-director/bin/cell-management-tool -u <USERNAME> cell --status
/opt/vmware/vcloud-director/bin/cell-management-tool -u <USERNAME> cell --quiesce true
/opt/vmware/vcloud-director/bin/cell-management-tool -u <USERNAME> cell --status
/opt/vmware/vcloud-director/bin/cell-management-tool -u <USERNAME> cell --shutdown
/opt/vmware/vcloud-director/bin/cell-management-tool -u <USERNAME> cell --status
service vmware-vcd stop
openssl pkcs12 -export -out /tmp/public_fqdn_address.pfx -inkey /tmp/public_fqdn_address.key -in /tmp/public_fqdn_address.crt
/opt/vmware/vcloud-director/jre/bin/keytool -keystore /tmp/certificates.ks -storepass 'ComplexPassPhrase' -keypass 'ComplexPassPhrase' -storetype JCEKS -importkeystore -srckeystore /tmp/public_fqdn_address.pfx -srcstorepass 'ComplexPassPhrase'
'ComplexPassPhrase'
with a suitably complex passphrase and store it somewhere safe for later use!!/opt/vmware/vcloud-director/jre/bin/keytool -keystore /tmp/certificates.ks -storetype JCEKS -changealias -alias 1 -destalias http -storepass 'ComplexPassPhrase'
/opt/vmware/vcloud-director/jre/bin/keytool -keystore /tmp/certificates.ks -storepass 'ComplexPassPhrase' -keypass 'ComplexPassPhrase' -storetype JCEKS -importkeystore -srckeystore /tmp/public_fqdn_address.pfx -srcstorepass 'ComplexPassPhrase'
/opt/vmware/vcloud-director/jre/bin/keytool -keystore /tmp/certificates.ks -storetype JCEKS -changealias -alias 1 -destalias consoleproxy -storepass 'ComplexPassPhrase'
/opt/vmware/vcloud-director/jre/bin/keytool -importcert -alias root -file /tmp/public_fqdn_address_ca.crt -storetype JCEKS -keystore /tmp/certificates.ks -storepass 'ComplexPassPhrase'
/opt/vmware/vcloud-director/jre/bin/keytool -list -keystore /tmp/certificates.ks -storetype JCEKS -storepass 'ComplexPassPhrase'
mv /opt/vmware/vcloud-director/certificates.ks /opt/vmware/vcloud-director/certificates.ks.old
cp /tmp/certificates.ks /opt/vmware/vcloud-director/
/opt/vmware/vcloud-director/jre/bin/keytool-list -keystore /opt/vmware/vcloud-director/certificates.ks -storetype JCEKS -storepass 'ComplexPassPhrase'
chown vcloud.vcloud /opt/vmware/vcloud-director/certificates.ks
/opt/vmware/vcloud-director/bin/configure
service vmware-vcd start
tail -f /opt/vmware/vcloud-director/logs/cell.log
Copy the certificates.ks file to the other cells and repeat steps 16-19 to finalize certificate installation.
Once complete VCD will now be using the new certificate, the only remaining step is to update the public URL within VCD provider portal to listen for connections on the public FQDN as shown in the diagram below.
Tagged with: VCD
Keep the conversation going on Twitter!
Reply with Twitter