Wednesday, 15 August 2012

Configuring vCloud Director 1.5 and MS SQL 2008 R2 to Use a Named Instance

Configuring vCloud Director 1.5 and MS SQL 2008 R2 to Use a Named Instance

A really well written blog on how to configure VMware vCloud Director and MS SQL 2008 R2 Server to use a Named Instance by Clearpath Solutions.

This isn’t a subject that comes up everyday, but I’ve seen it enough times that I thought it warranted a quick write up, so here we go. The biggest problem is that typically when you see a named instance of MS SQL installed, it’s alongside the default (MSSQLSERVER). For most applications, this isn’t an issue. You connect up to the named instance by giving the application or ODBC connection syntax similar to ‘SERVER\INSTANCE’, and it works just fine; however, with vCloud Director, which uses Java Database Connectivity (JDBC) to connect to MS SQL, this doesn’t quite work. JDBC doesn’t seem to be able to handle dynamic ports, at least with MS SQL 2008 R2 and vCloud Director 1.51, so we either have to add a secondary network interface or give your named instance a different TCP port. In this article, we’ll take the second approach.

By default, your MSSQLSERVER instance is going to be using TCP 1433, so we’re going to have to choose something else. MS SQL Monitor uses TCP (and UDP) 1434, so we’ll go with TCP 1435. My instructions here are going to be specific to MS SQL 2008 R2 and MS Windows Server 2008 R2, but they should translate pretty easily for earlier and future versions of both MS SQL and MS Windows Server.

1. Before we begin, a quick ‘netstat –a’ to show what ports SQL is listening to.

08 13 2012 1

2. Launch the SQL Server Configuration Manager.

08 13 2012 2

3. In the SQL Server Configuration Manager, under SQL Server Network Configuration, click ‘Protocols for INSTANCE’, then double-click TCP/IP.

4. On the TCP/IP Properties window, as below, you should observe each interface as having a ‘0’ in TCP Dynamic Ports.

08 13 2012 3

5. If you look at the TCP/IP Properties for the MSSQLSERVER instance, you should see something similar to the screenshot below. Note that TCP Port 1433, the default, is in use on each interface.

08 13 2012 4

6. Now, back on TCP/IP Properties for your named instance, remove the ‘0’ from TCP Dynamic Ports for each instance, and type in ‘1435’ for TCP Port on each instance.

08 13 2012 5   08 13 2012 6

7. Hit OK. You should see a prompt to letting you know changes are saved, but that they won’t take effect until your named instance service is restarted.

08 13 2012 7

8. To make the changes take effect, we’ll have to restart the SQL service for your named instance. This is a right-click SQL Server in Microsoft SQL Server Management Studio > Restart OR right-click SQL Server (INSTANCE) in Services > Restart

08 13 2012 8 

08 13 2012 9
9. Now, if you do a ‘netstat –a’, you’ll see that SQL is now listening on TCP 1433 and 1435.

08 13 2012 10

10. Now, to configure vCloud Director. This isn’t going to include the entire setup for vCloud Director; you can find that in the Install and Configure Guide from VMware, linked at the end of the article. This is only going to show the database connection configuration, as in the screenshot below.

  1. Type in 2 for Microsoft SQL Server.
  2. Type in the IP address or fully-qualified domain name (FQDN) of your MS SQL Server.
  3. Type in 1435 for the database port, as that’s what we defined within MS SQL.
  4. Type in the database name.
  5. Type in the instance name.
  6. Type in the username and password.
08 13 2012 11

11. Once that’s done, the JDBC connection will be created, and the database will be populated. You’ll know you’ve been successful if you see a prompt similar to the one below.  Type’y’ and hit enter to start the vmware-vcd service.
08 13 2012 12 
12. You’re done!

You can read the original blog post by Clearpath Solutions HERE

No comments :

Post a Comment

Note: only a member of this blog may post a comment.