Having no idea how well received my vSphere 5.1 build guide was, I’ve now decided to put out the vCloud Suite build guide. Again, like the vSphere guide, it is entirely my efforts in figuring this out. I reckon there are probably some easier means but hell, I’m not at that level of skill
Enough jive, let’s get busy.
- Deploy the OVA of vShield Manager to the cluster that will be used for all the elements of cloud management. This cluster will not be a part of resources available to the cloud
- Once deployed, power on vShield Manager and open a console. Eventually a login prompt will appear. The credentials are (admin:default). Similar to a Cisco switch, there is an enable mode. Type “enable” and then use the same password (default). There will be a # to indicate you are in enable mode
- Type “setup” to launch the initial configuration wizard. Provide the IP address, subnet mask, gateway, primary and secondary DNS, and search domain (domain name). Commit the changes with a “y” and then logout using exit. Give VSM about 10 minutes to get settled and then login again (still at the console)
- Log back in at the console and make sure you can ping the gateway, the vCenter for vCloud Suite, and the primary DNS server. When complete exit out and close the console. Time to move to the web interface!
- Change the password for the admin account (if you like pain
) - Set the NTP server and reboot to take effect
- Create a service account for vShield to use to connect to vCenter (make sure to put it in the security group that is configured in SSO for login access)
- SSL Certificate time! Create an A record in DNS for vShield Manager. Next, in the vShield web interface go to SSL Certificates. For Common Name, use the FQDN for vShield (thus the record you just created in DNS). The remaining fields would be filled out like with other SSL certificates within the organization. Set the Key to RSA and it should change to 2048 for size. Click Generate and then after a moment you can download the CSR file. Copy and paste the contents into the CA request web interface. The template choice is the Web Server option. In the Attributes box add this information to also allow for certification if you go to the short name and IP address for vShield. (Here is an example: san:dns=10.10.130.20) Download the certificate as Base 64 encoded
- Import the Root64.cer (this was created and used for the vSphere installation)
- Import the CA generated cer file for vShield and click Apply Certificate when prompted. This will reboot vShield to apply it. After reboot wait a few minutes for it to turn up the web interface
- Once the web interface is accessible, check the certificate to make sure it applied and is legit. I used the short name and FQDN and it works. For whatever reason at this point it does not work with the IP address
- Next connect to vCenter using the FQDN, service account credentials, and leave the box checked to make it an Enterprise user
- Once that connection is complete it will show up in Solutions in the vSphere Client. Go assign the license key for it
- Next we will attach it to the Lookup Service for SSO. Edit the Lookup Service and use the FQDN of the vCenter server as well as the admin@system-domain account and master password from setting up SSO prior with vSphere
- With this completed, the last step is to setup a backup. An FTP/SFTP location will be required. Note that for the backup directory, use the complete path the home directory for the user created for the vShield backup jobs
- With vShield Manager deployed, it is time to create the database for the vCloud Director cells. Log into the designated SQL server and create a database. Growth for the database and the log should be 10% and the database itself should start at 100mb, the log at 1mb. Set the Recovery Model (if it needs to be something besides Full) AND set the correct collation: Latin1_General_CS_AS
- Run the following query to modify the database correctly:
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
- Create a database user for the vcloud database and set that as the default database, set db_owner and schema to dbo
- Deploy two Red Hat / CentOS 6.x virtual machines to be used as vCloud cell servers. Create DNS A records for each cell for the http (web interface) and consoleproxy (connection to consoles of VMs through web interface). For SSL certificates, they will need two A records for each cell. Configure static IP addresses (/etc/sysconfig/network-scripts/ifcfg-eth0) for the management interface and set the gateway (/etc/sysconfig/network). Patch them via yum (and reboot if needed). Now shut them down and add hardware (if not already at the recommended configuration). 2 vCPU, 4GB RAM, 2 VMXNET3 network interfaces.
- Power on the VMs, login, and then use SFTP to copy the vcloud installer binary to each cell (/root is fine) and chmod +x to make the binary executable
- Now set the static IP for the second VMXNET3 interface (required by the vCloud installer binary). The easiest thing is to probably just cp the existing ifcfg-eth0 to ifcfg-eth1 and then modify the DEVICE= and IPADDR= (/etc/sysconfig/network-scripts/ifcfg-eth1). Note that if the second interface (typically the consoleproxy) is on a different VLAN or subnet there will need to be work done on the cells to set the correct default routes. Once this work is done restart the network service and do some test pings to the new IP
- Run the binary installer but after installation do NOT run the configuration script. Additional work must be done to get the cells ready for kicking butt
- Now to test mount the NFS transfer point (always test this before editing the fstab as if you mess that up, you can hose up the OS on boot. Make sure these pieces are in order before attempting the mount:
yum install nfs-utils rpcbind
/etc/init.d/rpcbind start
/etc/init.d/nfslock start
***turn those on with chkconfig
- With those in place and confirmed, test the mount using the following syntax: mount -t nfs ip_address_of_nfs:/export_path /opt/vmware/vcloud-director/data/transfer
- If it does look like it mounts okay check using the command: df -h to confirm
- Once mounted and in good shape, edit the fstab file to mount this nfs volume on boot. Place the entry at the bottom of the fstab file on a new line and it should read like this (there are tabs between each section, only a space between the zeros) ip_address_of_nfs:/export_path /mount_point nfs defaults 0 0
- Reboot and then check using df -h to make sure it mounted correctly and is accessible
- Now change the owner (user and group) of the NFS mountpoint to allow vCloud to do as it pleases: chown -R vcloud.vcloud /opt/vmware/vcloud-director/data/transfer
- Create a certificate keystore and initial certificate for the http (web management). Run this command on each cell: /opt/vmware/vcloud-director/jre/bin/keytool -genkey -keystore
- /opt/vmware/vcloud-director/certificates.ks -storetype JCEKS -storepass testpassword -keyalg RSA -alias http
- The prompts to fill out the certificate should be completed as follows. Note that the First and Last name instance should be the FQDN of the cell:
What is your first and last name? [Unknown]:mycloud.example.com
What is the name of your organizational unit? [Unknown]:Engineering
What is the name of your organization? [Unknown]:Example Corporation
What is the name of your City or Locality? [Unknown]:Palo Alto
What is the name of your State or Province? [Unknown]:California
What is the two-letter country code for this unit? [Unknown]:US
- Is CN=mycloud.example.com, OU=Engineering, O=”Example Corporation”, L=”Palo Alto”, ST=California, C=US correct?[no]:yes
- Enter key password for <http> (RETURN if same as keystore password) – use the same password as the keystore for simplicity (testpassword)
- Now create the certificate signing request (CSR file) with the following command:
- /opt/vmware/vcloud-director/jre/bin/keytool -keystore /opt/vmware/vcloud-director/certificates.ks -storetype JCEKS -storepass testpassword -certreq -alias http -file http.csr
- Next create one for the consoleproxy (connecting to virtual machine consoles through vCloud Director web interface):
- /opt/vmware/vcloud-director/jre/bin/keytool -genkey -keystore /opt/vmware/vcloud-director/certificates.ks -storetype JCEKS -storepass testpassword -keyalg RSA -alias consoleproxy
- You will receive the same kinds of prompts so fill them out again, remembering to use the FQDN for the consoleproxy (the second DNS A record that was created)
- Now create the certificate signing request (this time for the consoleproxy) with the following command:
- /opt/vmware/vcloud-director/jre/bin/keytool -keystore /opt/vmware/vcloud-director/certificates.ks -storetype JCEKS -storepass testpassword -certreq -alias consoleproxy -file consoleproxy.csr
- Grab those CSR files from each cell using SFTP and run them through the MS CA web interface, selecting Web Server as the certificate type. Add in the following to the Attributes box to make sure FQDN, hostname, and IP are all registered: san:dns=hostname.domain.com&dns=hostname&dns=ip_address ***Download them as DER format
- Rename each of the files to be either http.cer and consoleproxy.cer respectively
- Copy each of those files and include the root.cer (certificate authority root cert) back onto each cell
- Import the CA root certificate (and answer yes when prompted to add to the keystore): /opt/vmware/vcloud-director/jre/bin/keytool -keystore /opt/vmware/vcloud-director/certificates.ks -storetype JCEKS -storepass testpassword -import -alias root -file root.cer
- With the root certificate imported, next import the http.cer: /opt/vmware/vcloud-director/jre/bin/keytool -keystore /opt/vmware/vcloud-director/certificates.ks -storetype JCEKS -storepass testpassword -import -alias http -file http.cer
- Finally import the consoleproxy certificate: /opt/vmware/vcloud-director/jre/bin/keytool -keystore /opt/vmware/vcloud-director/certificates.ks -storetype JCEKS -storepass testpassword -import -alias consoleproxy -file consoleproxy.cer
- Now do a chown to vcloud.vcloud on the certificates.ks file
- Make sure before going any further you are at the console and not using ssh. For whatever reason the configure script gets funky over ssh
- With the certificates imported, the next step is to run the vCloud configuration script: /opt/vmware/vcloud-director/bin/configure What this will do is let you select which IPs are used for the http piece and which is for the consoleproxy. It will require the path to the keystore, the keystore password, and information regarding the database. Also if this is being installed on a minimal install (CentOS or Redhat) do a yum install redhat-lsb to install all the needed packages.
- When you run the configure script, it will prompt for the location of the certificates.ks file. Since it is in /opt/vmware/vcloud-director/, just type certificates.ks as it doesn’t need the full path. Enter the password for the keystore and then you’ll need to put in the database info. Use the FQDN for the DB server. Once the install is complete it will want to start the services so fire them up.
- tail -f /opt/vmware/vcloud-director/log/cell.log so you can watch it coming up.
- With the first cell up, connect to it and make sure the certificate is legit. Now it’s important for all additional cells to have access to a file that contains all the information entered during the configure script. It is kept in a response.properties file in /opt/vmware/vcloud-director/etc. Copy this file to the transfer mount so that all the other cells have access. Make sure it is owned by vcloud.vcloud and the permissions are 600
- Log into each additional cell and copy the response.properties file into /root. Run the installer with the argument of the response.properties file to have it pull the info needed during the install: ./binary_installer_name -r /path_to_responses_file
- After installation of all cells is complete, connect to the first cell and enter the information needed for the initial configuration wizard (license key, administrator login, etc)
- Once the initial wizard is completed and the login page becomes available we move onto vCloud Director configurations. The first step is to connect it to the vCenter it will be using. After login you will be at the Home page. A service account will be needed by vCD to communicate with vCenter. Create one and add it to the correct sso_admins group
- Next there is some general configuration elements for vCloud that should be performed before attaching vCenter and building stuff. Now set the mail notification settings up in the Email section of the Administration page
- If SSO will be used to manage access to the System (so the administration part, not the orgs part) of vCloud, you cannot use a security group in AD as for whatever reason vCloud will not work with groups. You have to set individual users up instead. Register for the Lookup Service and use the FQDN for the Lookup Service URL and admin@system-domain for the admin credentials. Go to the Users section of the Administration page. Click the Import Users button. Put the name of the users (one per line) in this format: group@domain Note that no spaces are allowed so just use _ for everything like you’ve been doing. With the users added test the ability to connect and login using an account that was added
- The alternative if SSO will not be used is to use the regular LDAP integration
- Next connect to vCenter and vShield Manager using the Attach a vCenter wizard on the Home tab of the vCloud web interface
- Now at this point, storage profiles need to be created to be used for the provider vdc. This is found in vCenter so pop into the vSphere Web Client, hit the home page and go into VM Storage Profiles. First, Enable storage profiles at the cluster level. Next, create a Storage Capability for each storage array that will be added to the pvdc. Next create a VM Storage Profile and add the capabilities. Now it needs to be assigned to a datastore, so head to Datastores and assign that sucker
- Now the provider vdc needs to be created. Go through the creation wizard and at the storage profiles part of the wizard you will be able to select the storage profiles. Also pick the cluster and enter the credentials for the ESXi hosts to deploy the vCloud agent. Once finished check the hosts page in Monitor and Maintain to see when they are done being prepped
- Once the hosts are prepared, it’s time to create an organization and then the organization vdc(‘s) below it
- So at this point vCloud is ready for customization and multi-tenancy. Follow the vCloud Organization Build Guide for that piece
- Next up is the Chargeback installation. For chargeback you can have multiple nodes that are then put behind their crummy software load-balancer. Likely one Windows VM will be enough. To get started, you will need a 2 vCPU, 4GB RAM, 40GB Disk, VMXNET3 VM
- Sometimes there are cases where using a Template in the environment for Windows Servers will cause Chargeback to not run correctly. I recommend you build this VM from scratch
- Create a service account for Chargeback and put it into the correct security group to enable it to login to vCenter
- Create a SQL database for Chargeback and a local SQL account for it to use. Make the local account db_owner of the Chargeback database and set the schema to DBO. Next go back to the database, go to permissions, and make sure the SQL account has the following permissions checked:
* Alter any schema
* References
* Insert
* Select
* Delete
* Update
* Execute
* Alter any dataspace
* Create table
* Create view
* Create procedure
* Create function
- Install the Microsoft Visual C++ 2005 x86 redistributable on the Chargeback Windows VM
- Snapshot the VM before installing as Chargeback can be untrustworthy
- Run the Chargeback installer as administrator (right click > Run as Admin). Provide the hostname for the db server (and instance name if there are multiple instances on the db server), the database name, and the local sql account that was created in the previous steps. Modify the email address if needed when presented with the load balancer option. If you are installing this into an environment large enough to require multiple Chargeback servers then this first install will be the load balancer. You can then spread that out with additional installs. Finally there is the option to install the Chargeback Manager server itself (If you were just installing the load-balancer portion don’t check this box). Checking the box will require the Server Name field to be entered, use the server’s hostname. A default administrative (local to Chargeback) account will created and you will be prompted to enter the password to be used for this account. Select the data collectors that will be installed (likely all three if this is a vCloud Suite installation). The last piece of information required to enter relates to the vCloud Director data collector. It will ask for a hostname/ip or URL for one of the vCloud cell servers. In the case of a load balancer, use the FQDN to point to vcloud for the administration page (ex: vcloud.aheadaviation.com) and provide the administrator login
- After installation it will prompt to generate a default SSL certificate or to Generate your own. Click to Generate your own and a command prompt will launch. Use a password for all the key and signing request generation (you will be prompted 4 times for the same password in a row). I use testpassword like with all the VMware certificates. It will then ask you for the usual Country, State, City, Company, Division, and FQDN. You will be prompted once more for the testpassword. Then it should succeed and press any key to continue. Mind you that all this is really doing is creating the key and we have to create the csr to get the certificate from the authority
- Navigate using Windows Explorer to C:\Program Files x86\VMware\VMware vCenter Chargeback\Apache2.2\conf\. Copy the openssl.cnf file to C:\Program Files x86\VMware\VMware vCenter Chargeback\Apache2.2\bin folder and replace the one that is in that folder
- Copy the default.key file from C:\Program Files x86\VMware\VMware vCenter Chargeback\Apache2.2\conf\ssl\ into \bin
- Open a command prompt as admin and go to the bin folder. Run the following command to generate the CSR:
- openssl.exe req -new -key default.key > default.csr -config openssl.cnf
- Use that CSR to get the CER file using the normal web interface method for the certificate authority server. Submit using the Web Server template. Export as a DER encoded file and rename to default.cert
- Copy the default.cert file back into C:\Program Files x86\VMware\VMware vCenter Chargeback\Apache2.2\conf\ssl\ and replace the one that is in that folder
- Reboot the server and it should now be square when you launch the web interface (https://fqdn/cbmui)
- If all is well so far, delete the snapshot from prior to install
- Time to patch Chargeback (if there are patches). Follow the instructions VMware has provided and I’d recommend snapshotting the VM before as a precaution
- Chargeback now needs to be licensed (you will be prompted the first time you hit the web interface)
- After licensing is complete, log in using the admin account and navigate to the settings tab. The first thing to do is setup SMTP to get notifications for alerts if there are problems with Chargeback services and also for reporting emails to be sent. In the Email Setting section, click add and put in the info for the SMTP gateway. Next set the Alert Settings on the System Health tab to have the correct email address to send alerts
- Next, add the vCenter server(s) that Chargeback will be talking to. This requires the service account created earlier, the sql account credentials for the database, and the url for the db server and database name
- Now add the LDAP server to allow for logins from domain users. You can use the same service account for this configuration item
- Setup the Users and Roles using the LDAP security groups that were created for Chargeback. Test logins to make sure this is functioning. Note that you cannot put security groups within the security groups that are added to LDAP Groups in Chargeback and have logins be successful. For whatever reason it doesn’t like nested groups. As such, add individual users into these groups and then add them into Chargeback
- Now make sure the data collectors are working and healthy. Head to the System Health tab and click the refresh button at the top right. Now address any issues with the red x’s. As a note, the vShield Manager needs the cli vshield login (admin:default) and NOT the login for the web interface. These changes can be performed on the Settings tab under Data Collectors
- For proper stats collection, turn up the statistics logging level in vCenter to 3 for all 4 time intervals. Note that depending on the size of the vSphere environment this could lead to a ginormous database. As such, use caution and be considerate. There is also a VMware KB article to help with this sizing matter: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2010099







