<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gavin Adams Information Blog &#187; VMware</title>
	<atom:link href="http://www.gavinadams.org/blog/tag/vmware/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gavinadams.org/blog</link>
	<description>Musings on hobbies, technology and topics of interest</description>
	<lastBuildDate>Sat, 25 Jun 2011 14:22:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Replacing vCenter 4.1 SSL Certificate with Active Directory Issued One</title>
		<link>http://www.gavinadams.org/blog/2010/07/14/replacing-vcenter-4-1-ssl-certificate-with-active-directory-issued-one/</link>
		<comments>http://www.gavinadams.org/blog/2010/07/14/replacing-vcenter-4-1-ssl-certificate-with-active-directory-issued-one/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 18:02:36 +0000</pubDate>
		<dc:creator>me@gavinadams.org</dc:creator>
				<category><![CDATA[PKI / Certificates]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.gavinadams.org/blog/?p=170</guid>
		<description><![CDATA[<p>This is an update post to reflect the differences in vCenter 4.1 vs the older vCenter 25 install. The older post can be found here.</p> <p>Certain third party products such as XenDesktop respect the expiration date on the vCenter SSL certificate. The vSphere Client doesn&#8217;t mind so much, nor it appears do the vSphere (ESX/ESXi [...]]]></description>
			<content:encoded><![CDATA[<p>This is an update post to reflect the differences in vCenter 4.1 vs the older vCenter 25 install. The older post can be found <a href="http://www.gavinadams.org/blog/2010/04/16/replacing-vicenter-2-5-self-signed-certificate-with-active-directory-issued-one">here</a>.</p>
<p>Certain third party products such as XenDesktop respect the expiration date on the vCenter SSL certificate. The vSphere Client doesn&#8217;t mind so much, nor it appears do the vSphere (ESX/ESXi &#8212; err vSphere Hypervisor) hosts, but when your VDIs suddenly can&#8217;t be reached, it&#8217;s a bad thing. I&#8217;m sure other products may have the same issue.</p>
<p>By default, vCenter will create a self-signed certificate issued to &#8220;<em>VMware default certificate</em>&#8220;. Unlike previous vCenter installs, the certificate is valid for 10 years, but still can cause problems for third parties that want to see the proper common name (e.g., FQDN of the vCenter server).</p>
<p><a href="http://www.gavinadams.org/blog/wp-content/uploads/2010/07/vmware-def-cert.png"><img class="alignnone size-full wp-image-177" title="VMware Default Certificate" src="http://www.gavinadams.org/blog/wp-content/uploads/2010/07/vmware-def-cert.png" alt="" width="402" height="506" /></a></p>
<p>In our case, since we&#8217;re not publishing any SSL services to the public and already have a Microsoft Certificate Authority, we can create and sign our own vCenter certificate. And just like the newer version of vCenter, we&#8217;ll set it up for 10 years too.</p>
<p>This can be completed in just under 15 minutes if all the prerequisites are in place. Took me an hour (including this documentation).</p>
<p><span id="more-170"></span></p>
<h2>Environment Summary</h2>
<p>For this process to work, the following assumptions are made:</p>
<ul>
<li>Active Directory installed and Certificate Authority installed (in my case, it&#8217;s on a Windows 2008 Domain Controller with Certificate Authority and Certificate Authority Web Enrollment )</li>
<li>DNS used for vCenter and internal FQDN name</li>
<li>vCenter server part of the domain, Domain Admin access to it</li>
<li>vCenter installed with local database (SQL Server 2005 Express) and using SYSTEM account &#8211; People commented on my <a href="http://www.gavinadams.org/blog/2010/04/16/replacing-vicenter-2-5-self-signed-certificate-with-active-directory-issued-one">previous related post</a> about other steps required for database connectivity</li>
<li>Using the included web services that comes with vCenter (IIS users on your own for this one)</li>
</ul>
<p>To test, we&#8217;ll use a browser from a workstation and the XenDesktop DDC to validate connection (make sure the root CA certificate is added to the Trusted Roots for the Computer Account on each test and production server)</p>
<h2>Prep vCenter</h2>
<p>Since vCenter 4.1 now requires a 64-Bit Operating System (Server 2008 R2 Standard in my case), we&#8217;ll download the OpenSSL for Windows 64-Bit version.</p>
<p>Download <a href="http://www.slproweb.com/products/Win32OpenSSL.html">OpenSSL for Windows</a> (binary for the 64-bit version  v1.0.0a is <a href="http://www.slproweb.com/download/Win64OpenSSL-1_0_0a.exe">here</a>) You may have to install the Visual C++ 2008 redistributable package first.</p>
<p>Verify the private key exists in: <strong>C:\Users\All Users\VMware\VMware VirtualCenter\SSL\rui.key</strong> (you will need to change permissions to allow your user account to access this directory and files)</p>
<p>Copy  all the files in<strong> C:\Users\All Users\VMware\VMware VirtualCenter\SSL</strong> to a temporary location such as  <strong>c:\temp\vcenter\oldssl</strong> (create if needed)</p>
<p>Open a command shell and go to <strong>c:\temp\vcenter\newssl</strong> (create if needed)</p>
<p>Generate the new RSA private key (2048 bit) and the certificate request (most important is that the common name must be the FQDN of the server). For the CSR, I normally use the common name value.csr, but since we&#8217;re working with rui.*, we&#8217;ll use that here too:</p>
<pre>C:\temp\vcenter\newssl&gt;c:\OpenSSL-Win64\bin\openssl.exe req -newkey rsa:2048 -keyout rui.key -nodes -days 3650 -out rui.csr
Loading 'screen' into random state - done
Generating a 2048 bit RSA private key
.............................+++
......................................+++
writing new private key to 'rui.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:<strong>US</strong>
State or Province Name (full name) [Some-State]:<strong>Georgia</strong>
Locality Name (eg, city) []:<strong>Cumming</strong>
Organization Name (eg, company) [Internet Widgits Pty Ltd]:<strong>Gavin Adams</strong>
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:<strong>vcenter.peanuts.local</strong>
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

C:\temp\vcenter\newssl&gt;<strong>dir</strong>
Volume in drive C has no label.
Volume Serial Number is 204A-99B1
Directory of C:\temp\vcenter\newssl
04/16/2010  03:50 PM    &lt;DIR&gt;          .
04/16/2010  03:50 PM    &lt;DIR&gt;          ..
04/16/2010  03:50 PM             1,024 .rnd
04/16/2010  03:49 PM             1,675 privkey.pem
04/16/2010  03:50 PM             1,679 rui.key
04/16/2010  03:50 PM             1,005 rui.csr
</pre>
<p>From the vCenter system, browse to the certsrv URL for your Active Directory Certificate Authority (normally https://dcname/certsrv and probably will require a valid Active Directory user):</p>
<p><a href="http://www.gavinadams.org/blog/wp-content/uploads/2010/04/vcu-1.png"><img class="size-full wp-image-153 alignnone" title="vcu-1" src="http://www.gavinadams.org/blog/wp-content/uploads/2010/04/vcu-1.png" alt="" width="474" height="295" /></a></p>
<p>Select Request a certificate, advanced certificate request, and then <em>Submit a certificate using base-64&#8230;.</em> Past the entire contents of the <strong>rui.csr </strong>(open in Notepad, select all &#8212; it will be all on one line, but a CTRL-A CTRL-C will do fine) in the Saved Request box, select <em>Web Server </em>for Certificate template:</p>
<p><a href="http://www.gavinadams.org/blog/wp-content/uploads/2010/04/vcu-2.png"><img class="alignnone size-full wp-image-154" title="vcu-2" src="http://www.gavinadams.org/blog/wp-content/uploads/2010/04/vcu-2.png" alt="" width="487" height="515" /></a></p>
<p>At this point the certificate will be signed. On the next page select <em>Base 64 encoded</em> then  <em>Download certificate</em> and save as <strong>rui.crt</strong> in <strong>c:\temp\vcenter\newssl</strong></p>
<p>From the private key and certificate, create the PFX fie:</p>
<pre>C:\temp\vcenter\newssl&gt;c:\OpenSSL-Win64\bin\openssl pkcs12 -export -in rui.crt -inkey rui.key -name rui -passout pass:testpassword -out rui.pfx</pre>
<p>Stop the following services:</p>
<blockquote><p>VMware VirtualCenter Management Webservices<br />
VMware VirtualCenter Server</p></blockquote>
<p>Copy  all the files in the newssl directory to :<strong> </strong><strong>C:\Users\All Users\VMware\VMware VirtualCenter\SSL</strong><strong>\</strong> replacing the existing ones. Don&#8217;t worry, we backed these up.</p>
<p>Now restart the services in this order (unsure if it matters):</p>
<blockquote><p>VMware VirtualCenter Server<br />
VMware VirtualCenter Management Webservices</p></blockquote>
<p>Use browser and navigate to the URL of the vCenter (e.g.,  <em>https://vcenter.peanuts.local</em>) and verify the certificate is valid. Open the vSphere client and verify all looks okay. After restarting the services, you will need  to reconnect to the ESX / ESXi hosts and re-authenticate with root credentials on each server. This is because the SSL trust between the two has changed and a new trust relationship needs to be established. Another reason for a longer term certificate!</p>
<h2>Problems and Resolution</h2>
<p>I&#8217;ll update the post with corrections, but with different configurations, we may run into different issues.</p>
<table border="0">
<caption><strong>Observed Problems and Resolutions</strong></caption>
<tbody>
<tr>
<td style="text-align: center;">Problem</td>
<td style="text-align: center;">Resolution</td>
</tr>
<tr>
<td>Web Service won&#8217;t restart with error<br />
One thing after this the webservice won&#8217;t start.<br />
in the log I found following error:<br />
vmware RSA_padding_check_PKCS1_type_2:block type is not 02</td>
<td>See VMware KB article: <a rel="nofollow" href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=1003070">http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=1003070</a></p>
<p>May require account password for database (assuming db other than SQL Server express)</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.gavinadams.org/blog/2010/07/14/replacing-vcenter-4-1-ssl-certificate-with-active-directory-issued-one/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

