Tuesday, September 18, 2012

Deploy a VMware vCloud Director (vCD) 5.1 using RHEL 6.2

This is a down and dirty guide for deploying vCloud in a LAB environment, these settings are not the most secure or performant, but this should get you up and running with vCloud 5.1 so you can test and learn it. The easiest way is with the appliance, but if your like me and want to roll your own, this is the guide.
I am using RHEL 6.2 (Red Hat Enterprise Linux 6 64 bit, Update 2)  because it is the latest version supported by vCloud 5.1, and it already includes java 1.6, which is needed for the certificate generation later (assuming your using self-signed, again this is only for LAB use)

  1. I am assuming you already have:
    1. One ESXi Host with the following VM’s on it.
      1. Windows with MS SQL DB (I’m using MS SQL 2008 R2)
      2. vShield manager
      3. Enough Room to create a vCloud VM
      4. Enough Room to create a vCenter VM (required later, not in this article)
    2. A management machine with SSH (putty) and SCP (WinSCP)
    3. VCP or equivalent level of knowledge
  2. Create a vCD VM, It requires 1GB memory, I like to give it 2GB if possible. 
    1. add two nics (one for http, one for consoleproxy)
    2. Thin provision the default 16GB hard drive
  3. Install RHEL 6.2
    1. Choose standard install options
  4. Post Installation
    1. Create a location to drop files
      1. mkdir /install
    2. Make sure SSH is enabled for ease of management (this is on by default)
    3. Install VMware Tools
      1. Use the KB article
      2. If that doesn’t work (it didn’t for me)
        1. To create a mount point, run:
          1. mkdir /mnt/cdrom
        2. To mount the CDROM, run:
          1. mount /dev/cdrom /mnt/cdrom
        3. go into install directory:
          1. cd /install
          2. find out the VMwareTools Filename ls /mnt/cdrom/VMwareTools* (or just use tab to autocomplete in next step)
        4. Unpack the Tools Tar
          1. tar -xzvf /mnt/cdrom/VMwareTools-9.0.0-782409.tar.gz
          2. after it expands, go into the directory it created cd /vmware-tools-distrib
          3. install tools by taking defaults ./vmware-install.pl
          4. unmount CDrom
            1. umount /mnt/cdrom
          5. Reboot
    4. Setup your IP’s (static IP’s are your friend for this install)
      1. Run “setup” and put them in, sometimes after you configure the IP’s the nics won’t auto start, if so Edit /etc/sysconfig/network-scripts/ifcfg-eth0 and make sure it says
        the line: ONBOOT=yes
      2. Turn off local firewall (again in setup)
      3. Install libXdmcp (doesn’t come with standard install, but is necessary for vCD)
        1. libXdmcp-1.0.3-1.el6.x86_64.rpm
        2. once downloaded, WinSCP it to your vCD VM into /install
        3. On that VM,
          1. cd /install
          2. chmod 555 libXdmcp-1.0.3-1.el6.x86_64.rpm
          3. rpm –i libXdmcp-1.0.3-1.el6.x86_64.rpm
          4. It should now be installed
        4. Download vmware-vcloud-director-5.1.0-810718.bin from VMware’s site, WinSCP it to your vCD VM, put it into /install
        5. on your vCD VM chmod 555 vmware-vcloud-director-5.1.0-810718.bin
        6. Check your Java version
          1. java –version
          2. It should respond with 1.6.0_22 or higher, if it doesn’t, I’ll make a blog post on how to upgrade it (comingsoon)
          3. You need version 1.6 if you are making your own self signed certs on the vCD VM
  5. Prepare your Certificates
    1. Good Article here
    2. keytool -keystore /install/certificates.ks -storetype JCEKS -storepass password -validity 9999 -genkey -keyalg RSA -alias http
    3. Magic Decoder Ring:
      1. keytool –keystore is the command your running, if its not there vCD will install the keytool command into /opt/vmware/vcloud-director/jre/bin/keytool after you run the executable (later in section 7)
      2. /install/certificates.ks is where we are putting the certificates file and what we are naming it
      3. -storepass is the password for the store, you’ll need this at install/configure time
      4. validity is 9999 days, if you don’t specify this, your vCloud certs will only be valid 120 days.
      5. alias is either http or consoleproxy, this specifies which IP / Portbind you are tying the Cert to.
  6. Prepare your Database
    1. Again, I am assuming you have MS SQL 2008R2 installed, without a local firewall, or ports opened.
    2. Login to Microsoft SQL Management Studio
    3. This is a great article, follow it, I will paste the highlights from it below, you can copy/paste these commands into SQL Query analyzer!!
    1)    Configure the database server.
    A database server configured with 16GB of memory, 100GB storage, and 4 CPUs should be adequate for most vCloud Director clusters.
    2)    Specify Mixed Mode authentication during SQL Server setup.
    Windows Authentication is not supported when using SQL Server with vCloud Director.
    3)    Create the database instance.
    The following script creates the database and log files, specifying the proper collation sequence.
    USE [master]
    GO
    CREATE DATABASE [vcloud] ON PRIMARY
    (NAME = N'vcloud', FILENAME = N'C:\vcloud.mdf', SIZE = 100MB, FILEGROWTH = 10% )
    LOG ON
    (NAME = N'vcdb_log', FILENAME = N'C:\vcloud.ldf', SIZE = 1MB, FILEGROWTH = 10%)
    COLLATE Latin1_General_CS_AS
    GO
    The values shown for SIZE are suggestions. You might need to use larger values.
    4)    Set the transaction isolation level.
    The following script sets the database isolation level to READ_COMMITTED_SNAPSHOT.
    USE [vcloud]
    GO
    ALTER DATABASE [vcloud] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
    ALTER DATABASE [vcloud] SET ALLOW_SNAPSHOT_ISOLATION ON;
    ALTER DATABASE [vcloud] SET READ_COMMITTED_SNAPSHOT ON WITH NO_WAIT;
    ALTER DATABASE [vcloud] SET MULTI_USER;
    GO
    For more about transaction isolation, see http://msdn.microsoft.com/en-us/library/ms173763.aspx.
    5)    Create the vCloud Director database user account.
    The following script creates database user name vcloud with password vcloudpass.
    USE [vcloud]
    GO
    CREATE LOGIN [vcloud] WITH PASSWORD = 'vcloudpass', DEFAULT_DATABASE =[vcloud],
       DEFAULT_LANGUAGE =[us_english], CHECK_POLICY=OFF
    GO
    CREATE USER [vcloud] for LOGIN [vcloud]
    GO
    6)    Assign permissions to the vCloud Director database user account.
    The following script assigns the db_owner role to the database user created in Step 5.
    USE [vcloud]
    GO
    sp_addrolemember [db_owner], [vcloud]
    GO
  7. Install vCD software on the vCD VM
    1. Run the executable
      1. ./install/vmware-vcloud-director-5.1.0-810718.bin
      2. It will ask you about which IP you want for http & for consoleproxy, http will be your web front end.
      3. It will ask you about the location of your certificates file(s)
        1. /install/certificates.ks
        2. and the password you specified when creating the certs back in Section 5
      4. It will ask you what your vShield Manager IP & Login info is (default is admin/default)
      5. It will ask your what type of DB your using, choose (2) MS SQL
      6. Fill in the IP address of your MS SQL server
      7. Default port is 1433 unless you changed it
      8. database name is vcloud
      9. database instance should also be default (unless using a shared DB server)
      10. Enter the DB user & password we specified back in section 6.
      11. It should finish the install and ask if you want to start the service, you do.
      12. Service can take a few minutes to start, be patient, then go to http://ipaddressofhttp/ and fill out the starting information.
      13. Default login will be administrator/yourpassword
I believe this is my longest blog post to date, so I will post this as-is, feel free to comment, I will clean it up over time as I continue to do more installs.
This post will become a series with how to configure vCD and a few other helpful setup items.

A few Helpful Links
Installing vCloud Director 5.1 best practices
VMware vCloud Director Installation and Upgrade Guide

vCloud Director 5.1 Release Notes

7 comments:

Erik Bussink said...

Nicely done Brian.

Unknown said...

Brian - the RHEL 6.2 isn't so straight forward that you can simply state accept the defaults.. could you add more detail, accepting the defaults would mean a GUI based installation and it doesn't work at all. I then tried text based install that that allowed me to move foward, but after accepting all defaults as you say I was left with a system with no GUI and no networking in place. Could you add some more detail for those that are linux challenged please.

Unknown said...

Brian,
Thanks for summarizing all the steps in one place.
I just finished installing a VCD environment. Just noticed this post today.
--RE: Unknown said
]# ./vmware-vcloud-director-5.1.1-868405.bin /opt/vmware/vcloud-director/etc/responses.properties
....
I installed text based and just choose the option number or default, both worked for me.
DJ

Unknown said...

If you plan to install mutliple VCD servers, then you may want to save the responses.properties file located at /opt/vmware/vcloud-director/etc/responses.properties.
This can be used to install additional VCD servers using the command:
installation-file -r path-to-response-file eg:
./vmware-vcloud-director-5.1.1-868405.bin /opt/vmware/vcloud-director/etc/responses.properties

Unknown said...

salut Brian,
dites, comment obtenir le fichier exécutable VMware vCloud Director 5.1.0 en mode évaluation pour l'essayer?

Swaroop said...

Thanks a lot :) this blog helped me to install vCD

Unknown said...

Your blog content is excellent. I like your blog, I sincerely hope that your blog is a fast-growing traffic density. we hope you blog updates and place can always be colorful.
VMware vCloud Director Training at Mindmajix