Configuring vRealize Log Insight Agent on MS SQL Server 2012

There’s a lot of information available about the SQL Server Content Pack for Log Insight, but actually  trying to use it reveals a lot of gaps.  So, here’s what I’ve done to get my SQL Server 2012 R2 instances to correctly report their information to vRealize Log Insight and show up in the Content Pack filters.

To ensure the correct log directories are used and allow reuse of filelog sections, I suggest creating an agent group for each SQL Server.  I’m also a fan of the server-side agent configuration, so if the agent gets totally removed and reinstalled, it’ll acquire the correct configuration again.

Steps:

  1. Install the Log Insight Agent for Windows on the SQL Server machine, be sure to use the FQDN of the Log Insight VIP
  2. While logged on to the SQL Server, locate the Logs folder for each SQL server instance. Note that this is not the database transaction logs folder – if it contains *.ldf files, it’s the wrong folder.   Specifically, you want the folder that contains the ERRORLOG file.  To be certain follow these steps:
    • Launch SQL Server Configuration Manager
    • Select “SQL Server Services” from the left pane
    • Right-click “SQL Server (INSTANCENAME)” from the right page, choose “Properties”.
    • Select the “Startup Parameters” tab
    • In the Existing Parameters box, make a note of the parameter that starts with “-e”
    • The filepath in that parameter (minus “ERRORLOG”) is the folder we need.
    • DO NOT CHANGE ANY VALUES, Cancel Properties, Close Configuration Manager

Startup Params in ConfigurationManager

  1. Logon to Log Insight as an administrator
  2. Check the Content Package area to be sure the “Microsoft – SQL Server” Content Pack is installed
  3. In the next steps, we’ll configure the agent from the server-side. It is possible to do from the client-side.
  4. In the Administration|Agents section of Log Insight select Microsoft – SQL Server from Available Templates drop-down list
  5. Click the “Copy Template” button. In the Copy Agent Group box that appears, change the name to “Microsoft – SQL Server – SERVERNAME”.  (replace SERVERNAME with the actual server’s name).  Click “Copy”.
  6. Now, the dropdown list should indicate that you are editing the new Agent Group
  7. In the Filter box, edit the parameters to create a filter that identifies only the desired server. For example “Hostname | starts with | SERVERNAME”
  8. In the Agent Configuration section
    • Update the section header from “[filelog|MSSQL]” to [filelog|MSSQL-SERVERNAME-INSTANCENAME]” replace SERVERNAME and INSTANCENAME with the correct, actual values. Be sure to keep “MSSQL” as the prefix, since the dashboard elements key on that.
    • Update the directory value to where the ERRORLOG file was found
    • Update the exclude value to read *.trc;*.xel;*.mdmp
    • Example:

[filelog|MSSQL-COREDB1-MSQLSERVER]
; IMPORTANT: Change the directory as per the environment
directory=C:\MSSQL\DATA\MSSQL12.MSSQLSERVER\MSSQL\Log
tags={“ms_product”:”mssql”}
charset=UTF-16LE
exclude=*.trc;*.xel;*.mdmp

  1. If there are multiple instances of SQL server on the host server, copy the entire section and edit the section header with the Instance Name. Example of configuration for multiple instances:

[filelog|MSSQL-COREDB1-MSSQLSERVER]
; IMPORTANT: Change the directory as per the environment
directory=C:\MSSQL\DATA\MSSQL12.MSSQLSERVER\MSSQL\Log
tags={“ms_product”:”mssql”}
charset=UTF-16LE
exclude=*.trc;*.xel;*.mdmp

[filelog|MSSQL-COREDB1-WORKLOAD]
; IMPORTANT: Change the directory as per the environment
directory=C:\MSSQL\DATA\MSSQL12.WORKLOAD\MSSQL\Log
tags={“ms_product”:”mssql”}
charset=UTF-16LE
exclude=*.trc;*.xel;*.mdmp

  1. Click Save New Group.
  2. On the SQL Server, restart the “VMware vRealize Log Insight Agent”
  3. Navigate to %ALLUSERSPROFILE%\VMware\Log Insight Agent and open liagent-effective.ini with notepad. Check that the sections added above appear in this file.
    • If they do not, you may have to adjust the filters on the Agent Group
Advertisement

Fix – Unable to import vCAC/vRA certificates into Orchestrator

Problem:

While in the vRealize Orchestrator Client you find that the Library/Configuration/SSL Trust Manager/”Import a certificate from URL” workflow returns an error reading “InternalError: handshake alert: unrecognized_name” when provided. The URL the resolves to the Load-Balancer VIP for the vCAC/vRA appliances.

 

Background:

Signed SSL certificate installed on vCAC/vRA Appliance, SSL Passthrough on NSX/vCNX Load-Balancer, vCAC/vRA Settings/Hostname set to resolve to VIP, matching SSL cert.

 

Fix:

  1. SSH into the vCAC Appliance as root
  2. Backup /etc/apache2/vhosts.d/vcac.conf to vcac.conf.bak
  3. Use vi to edit /etc/apache2/vhosts.d/vcac.conf
  4. Scroll down to  <virtualHost _default_:443>
  5. Add these lines

    ServerName fqdn.of.appliance.node

    ServerAlias: load.balancer.name

  6. Scroll further to ensure these params aren’t listed elsewhere, remove or revise if so.
  7. save the file and exit vi
  8. restart the vCAC/vRA services

Automating NSX Security Groups with vCAC/vRA – Part 2

***UPDATE***  The download link is currently broken.   I seem to have lost the file, will fix the link as soon as I find or recreate it.  Sorry about that. 😦

In part 1 of this series, we created a list of security groups and displayed that list to users during the request.  In this post, we want to enhance that functionality by adding these features.

  • Creation of Security Groups and inclusion in Dropdown lists
  • Add a VM to a Security Group post-provisioning
  • Import existing Security Groups into vRA inventory
  • Add a Security Group to a Dropdown list

We’re going to do that by importing a vCO package with some new workflows and actions, then link up the workflows to Advanced Services and Resource Actions.  As before, we’ll require the NSX and vCAC/vRA plugins for Orchestrator.

Preparation

  • Complete the creation of the VCNS.SecurityGroup.Names.production property dictionary and valuelist attribute from Part 1.  We’re going to reuse those items. so make a note of the exact name of the property dictionary and the valuelist attribute.  In my case, I’ve named the Property Dictionary VCNS.SecurityGroup.Names.production and also named the valuelist attribute for it VCNS.SecurityGroup.Names.production
  • Make sure vRA Advanced Services Server Configuration is complete and test the connection to the Orchestrator server.  The default, built-in VCO is fine.
  • Login to vCO client as a vCO Admin. Set the mode to “Design” and navigate to the Inventory tab.  Make sure that you have a connection listed under “vCAC Infrastructure Administration” and a connection listed under “NSX”.

 

Confirm that you have the necessary connections on the inventory tab
Confirm that you have the necessary connections on the inventory tab

Get the Package

I’ve put together a handful of workflows and actions that use or expand the NSX plugin to provide information of functionallity back to vRA.  Where possible, I reused existing library workflows, but in some cases, I had to use the API to create a REST call and consume that in an action.

By downloading any code, package or file, you acknowledge that:

There is no explicit or implied warranty or support for the code.  Neither Brian Ragazzi, his employer nor anyone else is responsible for any problems, errors, omissions, unexpected behavior, breakage, trauma, outage, fatigue, lost time, lost work or incontinence that may occur as a result of using the code or package.

Download the zip file.  It contains the package and a couple of images that can be used for the advanced services

Import the Package

  1. Extract the zip file
  2. In the vCO Client, navigate to the packages tab.
  3. Click the “import package” button and select the extracted .package file
  4. On the Package Import Information step, click “Import

    Package Import Information
    Package Import Information
  5. On the Import package… step, check the “Select/Deselect all” box to check all of the items.  Please note the server path, these should not be duplicates of anything else you have in your vCO inventory (unless you’ve already imported this package previously).  Click “Import Selected elements”.

    Select all items
    Select all items
  6. Review the workflows and actions added to your inventory.

Configure Advanced Services – Create Security Group

This service enables the user to create a new NSX Security Group and automatically adds its name to the appropriate dropdown list of security groups.  It can be added once for each different list of security groups.  You’ll need to know the exact name of the Property Dictionary and valuelist attribute you created in Part 1.

NSX Management Services
NSX Management Services
NSX Security Groups in vRA Items
NSX Security Groups in vRA Items
  1. While logged into vRA as a service architect, navigate to the Advanced Services tab, click “Custom Resources
  2. We need to make vRA aware of NSX Security Groups.  Click the Add button.
  3. In the Orchestrator Type field, enter “NSX:SecurityGroup“; for the Name, I suggest “NSX Security Group“, click Next

    Add NSX Security Group as Custom Resource
    Add NSX Security Group as Custom Resource
  4. On the details form, we’re not going to make any changes, but if you wanted to hide certain properties, you could here.  Click “Add“.
  5. Click “Service Blueprints”, then the “Add” button.
  6. On the Workflow tab, select the AddNewSecurityGrouptoDropdown workflow, click next.

    Select "AddNewSecurityGrouptoDropdown" workflow
    Select “AddNewSecurityGrouptoDropdown” workflow
  7. On the Details tab, set the name to something like “Create new Production NSX Security Group“, because we’re going to create the security group and add its name to the “production”dropdown list.  Click Next.

    Set the Service Item Name
    Set the Service Item Name
  8. On the Blueprint  Form tab, under the “Step” Form page (default), mouseover the text field labelled “Name of Custom Property Dictionary in vCAC/vRA”.  Click the pencil “edit” icon when it appears.

    Edit the Form Fields
    Edit the Form Fields
  9. Click the Constraints tab of the “Edit Form Field” window.  On the Value field, select “Constant” and enter “VCNS.SecurityGroup.Names.Production” (or whatever suffix you used) for the Property Dictionary.  Set the Visible value to “No” so it doesn’t show up. Click Submit on the Edit Form Field window.

    Set the name of the Property Dictionary to be updated
    Set the name of the Property Dictionary to be updated
  10. Using the same method, set the Name of the Attribute appropriately and its visibility to no
  11. Edit the “Value to be appended to the ValueList attribute” field.  Set the label to “New Security Group Name“.  Do not set a value or make this one invisible, we need the user to enter a value, submit to save.
  12. Edit the vCACIaaSHost field – using the Constraints tab again– when setting the value, choose constant, then click Add by the green plus, to display a treeview, where you can choose your connection to the IaaS Server.  Visible: No, submit to save.

    Select connection to IaaS host
    Select connection to IaaS host
  13. Edit the “NSX endpoint” field in the same way, selecting the NSX connection.
  14. When done, all fields except “New Security Group Name” will have a value.  Click Next.
  15. On the Provisioned Resource tab, select “securityGroup [NSX Security Group]“.  Click Add to save the service blueprint.
  16. Repeat steps 5-15 for any other dropdown lists containing security groups; say “Non-Production” for instance
  17. Highlight the Service Blueprint and click “Publish” to make the blueprint available for entitlements
  18. Navigate to Administration, Services.
  19. Add a new Service named “NSX Management” (for example) – I included a nifty image in the zip file
  20. Under Catalog Items, click the “Create new Production NSX Security Group” item to edit it.
  21. The Catalog item should inherit the Security Group icon from vCO, set its Service to “NSX Management”,click update to save.
  22. Create or Edit an entitlement to include the new Service and/or catalog item.
  23. Try it out, confirm that the Security Group was created in NSX, is visible in vCAC items and it name was added to the Property Dictionary

Configure Advanced Services – Import Security Group

This service allows you to make existing security groups visible as items in the vCAC Items view.  Once this is done, we’ll add actions that allow you to add the security group to a dropdown list.

  1. Click “Service Blueprints”, then the “Add” button.
  2. Select the “GetNSXSecurityGroup” workflow, click Next
  3. On the details tab, set the name to “Import NSX Security Group“, click Next
  4. On the Blueprint form, set the “connection” to the NSX connection in vCO, then hide the field.  Security Group Name will be a dropdown list of existing NSX Security Groups for the user to choose from. Click Next
  5. On the Provisioned Resource tab, select “securityGroup [NSX Security Group]“.  Click Add to save the service blueprint.
  6. Just as before, publish the service blueprint, add it to a service and an entitlement.

 Configure Advanced Services – Add Security Group to Dropdown list

With this service, we’ll let the user add the name of an existing Security Group to a drop down list.  Unlike the first two, this is implemented as a Resource Action, meaning it’ll be executed against an existing item (a Security Group in this case)

  1. Under Resource Actions, click “Add”
  2. For the Workflow, select the “AddExistingSecurityGrouptoDropdown“, click Next
  3. On the “Input Resource” tab, keep NSX Security Group, click Next
  4. On the Details tab, set the Name to “Add Security Group to Production list” or similar, set the description, leave the Type options unchecked.  click Next

    Set Action Name and Description
    Set Action Name and Description
  5. On the Form tab, just like the first service blueprint, set the Property Dictionary and Attribute names as appropriate.  VCNS.SecurityGroup.Names.production in my example, set visible to no on both.
  6. Again, we’ll set the vCACIaaSHost to the connection to the Server and hide the field
  7. Click Add to save the action.
  8. Repeat steps 1-6 for each security group dropdown list (say “non-production” for instance)
  9. Publish the action and add it to an entitlement

    Add Action to Entitlement
    Add Action to Entitlement
  10. Test by navigating toNSX under Items, highlight a Security group and Select “Add Security Group to…” from the Actions menu.

    Yay! A Resource Action
    Yay! A Resource Action

 Configure Advanced Services – Add VM to a Security Group

This service lets you add a provisioned VM to additional Security Groups.  So, at provisioning-time, the VM is added to the Security Group selected by the user, but we may need to refine the security by adding that VM to additional Security Groups.

  1. Under Resource Actions, click “Add
  2. For the Workflow, select the “AddVMtoSecurityGroup“, click Next
  3. On the “Input Resource” tab, keep IaaS VC VirtualMachine, click Next
  4. On the Details tab, set the name to “Add VM to a Security Group“, click Next
  5. On the Form tab, set the connection Value to the NSX connection.
  6. Leave the NSX Security Group field visible, click Add to save the action
  7. Publish the action and add it to an entitlement
  8. Test by selecting a machine under Items and “Add VM to a Security Group” from the Actions menu

    VM Resource Action for Security Groups
    VM Resource Action for Security Groups
  9. You’ll be presented with the list of allNSX Security Groups to which you can add the selected VM

    Select Security Group
    Select Security Group

Conclusion

This part of the series should help streamline the management of VMs and their membership in Security Groups.  Obviously, items like removing a VM from a Security Group or even removing a Security Group are not included here.  The NSX plugin is missing quite a bit of functionality available in the API, so those additional functions require significantly more configuration.

Thanks to John Dias for his information and examples posted here.

 

Automating NSX Security Groups with vCAC/vRA – Part 1

In this series, I’ll document how to automate the creation and (some of) the management of NSX security groups within NSX.

First, what’s the use case?  Why is this interesting?  Let’s assume that you’ve decided to use large “flat” networks instead of many small networks.  One reason you may make that decision is because of the challenges with either having many blueprints (one per network!) or making changes to the workflows to reliably set the appropriate properties.

Background

In this solution, we’ll have to have vCAC 6.1 or vRealize Automation 6.2, NSX 6.x and vCenter/vRealize Orchestrator with the vCAC and NSX plugins installed and configured. We have two Logical Switches, one for Production and one for Non-Production.  In addition, there’s a corresponding network profile and the business groups have reservations.  Now, we have to ensure that there  are security boundaries within the flat networks.  We’ll accomplish this through Security Groups.

Caveats

We’ll create security groups and nod in the direction of security profiles, but will not be automating the creation of security profiles nor their assignment to the Security Group(s).  That can be done by the security admins through the NSX interface or maybe later we’ll add that capability too. 😉

 Procedure

  1. Create Security Groups.
    • Open vSphere Web Client and navigate to Networking and Security, then Service Composer.
    • Click the “New Security Group” icon
    • Enter a Name and Description for your new Security Group and click Next
    • If you want to create rules for dynamic membership or include/exclude existing VMs, you can do so in the subsequent steps.  Finish the wizard.
    • Repeat to create all of your security groups
    • Create Security Groups in NSX
      Create Security Groups in NSX
  2. Create Property Dictionaries invCAC/vRA.
    • Log into vCAC as an Infrastructure Admin and navigate to Infrastructure|Blueprints|Property Dictionary
    • Click “New Property Definition”, for the name enter “VCNS.SecurityGroup.Names.Production“.  You can replace “Production” with a name of your choosing, so you can have multiple lists.
    • Select “DropDownList” as the control type and check to make it required, click the green check to save.

      Create Property Dictionary
      Create Property Dictionary
    • Click the “Edit” link in the Property Attributes column
    • Click “New Property Attribute”, select “ValueList” as the attribute type
    • Set the name to something appropriate, such as the same name as the Property Definition or “ValueList” or “SecurityGroups”
    • In the Value field, enter the names of the security groups you want included.  Separate the group names by commas (no spaces).  If you have groups whose names include spaces or commas, put them in quotes.  Click the green check to save.
    • Repeat to create another property dictionary and attribute for the Non-Production list
  3. Update Blueprints.
    • Edit your “production” blueprints by adding the “VCNS.SecurityGroup.Names.Production” custom property. Set the value to your default security group or leave it blank to require a selection. Be sure to check the “Prompt User” box. Click the green check to save.

      Add Custom Property to Blueprint
      Add Custom Property to Blueprint
  4. Test
    • Submit a request for the affected blueprint and verify that the dropdown list of security groups looks like you expect it to. Remember, that unlike many other custom properties in vCAC (eg: Network Profiles), you CAN have multiple versions of this one and display different lists.

      Dropdown list of Security Groups
      Dropdown list of Security Groups
    • After a VMis provisioned, verify in the vSphere Web Client that ithas been assigned to the expected security group

      VM added to Security Group
      VM added to Security Group

Next

In the next parts of this series, I plan to address the problems of maintaining the dropdown list manually and having a single security group per machine.

Many thanks to my friend Grant Orchard for his article on selecting a security group in a blueprint . It was the inspiration for this series.

Quick and Dirty workaround for vCAC/vRA MSDTC issues

Please note that this is a workaround, not a fix. I couldn’t get the damn thing working reliably, so I bypassed authentication. I wish I knew why I got “DataBaseStatsService: ignoring exception: Error executing query usp_SeclectAgent Inner Exception: Error Executing query usp_SelectAgentCapablities” all the frigging time. Followed John’s advice and reinstalled MSDTC on e.v.e.r.y.t.h.i.n.g, no change. Made sure that the settings match VMKB2089583, no change.

As a workaround, I just selected “No Authentication required” on the Clustered MSDTC and the IaaS Manager Service services. Don’t do this as a long-term thing.

This works, but don't do it in production
This works, but don’t do it in production

Adding a vCloud Air Endpoint to vCloud Automation Center

vCAC Service Catalog
vCAC Service Catalog

So, you have vCAC configured locally and now have access to vCHS vCloud Air and want to create an endpoint to provision machines to your virtual data center.

In this example, the vCloud Air account has a Virtual Private Cloud.

Background

vCloud Hybrid Service was recently renamed to vCloud Air to reflect it changing services (and to get people to stop calling it vCHeeSe).  It uses a lot of vCloud Director terminology and behavior.

Preparation

  1. Make sure your vCloud Air account setup is completed.
  2. Login to your vCloud Air account
  3. Have credentials for an Infrastructure Admin on vCloud Automation Center

Get Information

What? Where? How?
vCloud Air Username and Password duh!  hello-my-name-is-nametag
Virtual Data Center Name On the Dashboard, under VIRTUAL DATA CENTERS, the top line in bold is the virtual data center name.

Virtual Data Center
Virtual Data Center
vCloud Director API URL Click the name of your virtual data center (it doesn’t give you the pointing-finger icon, but it is a link) to view the details.  On the right, under RELATED LINKS, click “vCloud Director API URL”.  Copy the value and paste it somewhere handy.

vCloud Director API URL
vCloud Director API URL
Network details  While still in the Virtual Data Center details, click the Networks tab to view a list of the defined networks.  By default you’ll have a “Default-Isolated” and a “Default-Routed”.  You can create more, but for this example, I’m just going to use the default-routed network. Locate the network and record the gateway IP.  Make a note of the network size (/24 in this case) and the IP Range.  The IP range is the range of values that vCloud Director/vCloud Air will assign to newly-created VMs in this network.

Default Routed Network Details
Default Routed Network Details

 

Configure vCAC

  1. Logon to vCAC Console as an Infrastructure Administrator
  2. Navigate to Infrastructure/Endpoints
  3. Click New Endpoint/Cloud/vApp (vCloud Director)
  4. In the Endpoint configuration, give it a catchy name like “vCloud Air” and description.
  5. In the Address field, paste the vCloud Director API URL, but only up to the :443.  Don’t need the path.
  6. In the Organization field, paste the Virtual Data Center Name – it’s case-sensitive.
  7. If you have Custom Properties to be applied, you can add them now or later.
  8. Click OK to save your endpoint

    vCAC Endpoint for vCloud Air
    vCAC Endpoint for vCloud Air
  9. On the list of Endpoints, mouseover the new one and choose Data Collection from the menu. On the Data Collection status page, click the Start button to begin data collection
  10. After the data collection completes successfully, you will be able to create or edit a fabric group to add the Virtual Data Center as a Compute resource.

Next Steps

  1. Create a network profile for the network(s) you recorded earlier.  I suggest configuring the vCAC Network Profile IP Range to be exclusive of the vCD IP range
  2. Create reservations for your business groups on the vCloud Air Compute Resource
  3. Consider a Reservation Policy for your vCloud Air reservations

Coming Soon

I’m hoping to configure the VPN connection to extend my lab network to the virtual data center. Creating blueprints for use on vCloud Air, making existing blueprints work on vCloud Air.

Thanks to David Hill for his post about this very topic

 

Configuring Replicated vPostgres for vCAC 6.x

This is the second in my series for building a fully distributed vCAC deployment.  In this part, we’re building the vPostgres database server with replication for use with vCAC 6.x.

I’m using v9.2.6.0. The vCAC 6.0 Support Matrix says 9.2.4 is supported but the PDF version of the Installation and Configuration guide says 9.2.4 or higher is supported.  I originally wanted to use 9.3.2.0 because the documentation includes replication, but I’m unsure whether it’s officially supported with vCAC 6.x yet.  We’ll still configure replication though 🙂  I’m going to front-end the vPostgres nodes with a vCNS Edge Gateway load balancer so that in the case of a failure, we don’t have to reconfigure the vCAC appliance database connection.  Updated documentation shows that for vCAC 6.0, vPostgres v9.2.4 is supported, v9.2.6 and v9.3.4 were untested.  For vCAC 6.1, versions 9.2.4, 9.2.6 and 9.3.4 are supported.
Prerequisites:

  • Reserve IP addresses for the appliances and the virtual IP.
  • Add DNS entries for the IP addresses.  I used vpostgres1 for vpostgres2 for the appliances and vpostgres as the virtual/load-balanced name/address.

vProgres setup Steps

  1. Download the VMware vFabric Postgres Appliance from my.vmware.com.
  2. Deploy the vFabric Postgres Appliance from OVF twice.  I named them vPostgres1 and vPostgres2.  vPostgres1 will be the master and vPostgres2 will be the slave.
  3. Power on vPostgres1, browse to https://vpostgres1:5480, logon as root using the password you entered during deployment.
  4. Configure the hostname (eg: vpostgres1.ragazzi.lab) and timezone
  5. Browse to https://vpostgres1:8443, leave the default values, enter your password and click “Connect” to enter the Enterprise Manager (vpgdbem)

    Login to vpgdbem
    Login to vpgdbem
  6. Click on localhost:5432/DB Login Users to list the existing users (just “postgres” so far)
  7. Click the green plus to add a new DB Login user.  In the properties, enter “vcac” (or whatever you want) as the name, check “Enable login”, do not check “Can create DB login users” and set the password.  Click OK to save.

    Create vcac user
    Create vcac user
  8. Click on localhost:5432 to display the overview and list of databases (just “postgres” so far)
  9. Click the green plus to Create a new database.  Just enter “vcacdb” (or similar) for the name, set the Owner to “vcac”, add a comment if you wish and click “OK” to save. Click the refresh button (blue ccw arrow) to refresh the list.

    Create vcacdb database
    Create vcacdb database
  10. Expand the Databases item under the treeview and select your new “vcacdb” database.  The database overview should load, displaying the uptime, size and more.

    Select the database
    Select the database
  11. Toward the right side of the window is a button labelled “Enter SQL”, click it.
  12. In the SQL Script area, type the following:

    CREATE EXTENSION "hstore";
    CREATE EXTENSION "uuid-ossp"

    SQL Statements
    SQL Statements
  13. Click “Execute” and check the Output|Messages area for SQL query succeeded
  14. Click the X to close the SQL window
  15. Complete steps 2-4 for vpostgres2. Do not configure any users or databases on vPostgres2.
  16. SSH into vpostgres1, logon as “postgres”, not root.
  17. Run this command to create a replication user named “replicate”:

    v9.2/opt/vmware/vpostgres/current/share/create_replication_user replicate

    v9.3/opt/vmware/vpostgres/current/scripts/create_replication_user replicate

    You’ll be prompted for a password and confirmation.

    Create "replicate" user
    Create “replicate” user
  18. SSH into on vpostgres2 as “postgres”
  19. Run this command to configure vpostgres2 as a replica:

    /opt/vmware/vpostgres/current/share/run_as_replica -h 192.168.101.31-b -W -U replicate

    Obviously, replace the red text with the IP address of the master vPostgres server. First you’ll be prompted for the password for the “replicate” user, then you’ll confirm the authenticity of the connection, then you’ll be prompted to enter the password for the postgres user on the master. Next, you’ll confirm that you want to enable WAL archiving on the primary/master by typing “yes” and lastly, you’ll confirm your intention to overwrite the data directory with the databases from the master. It’ll copy the tablespace over.

    Configure replica and confirm
    Configure replica and confirm
  20. Run this command on vpostgres1 to verify the replication:

    /opt/vmware/vpostgres/current/share/show_replication_status

    Replication Status
    Replication Status

Load-Balancer setup steps
I’m going to use the load-balancer feature in vCloud Networking and Security Edge Gateway. It’s not the most intelligent Load-Balancer ever, but it’s what I have.

  1. Using vCNS Manager, locate the appropriate edge gateway, click Actions|Manage to open it for editing
  2. On the Configure Tab, edit the interface that will listen on the virtual IP
  3. Edit the Subnet and add the Virtual IP. It’s probably not the primary IP. Save and publish those changes

    Add the virtual IP to the Edge Gateay
    Add the virtual IP to the Edge Gateay
  4. On the Load Balancer tab, on the Pools page, click “Enable”, then “Publish Changes”Enable Load Balancer
  5. Click the green plus to add a load-balancing pool
  6. Enter a recognizable Name and Description, click “Next”
  7. On the Services step, check only TCP, set Balancing Method to “ROUND_ROBIN” and the Port to 5432. Click “Next”
  8. On the Health Check step, set it as shown. Click “Next” when done.
  9. On the members step, click the green plus to add the IP address of you SSO servers to the pool. Add the primary/master vPostgress server with a weight of 1 or higher.  Add the slave/replica with a weight of 0 (zero).  This will ensure all of the traffic goes to the primary until it is changed in the event of a primary failure. Keep the TCP port and Monitor Port at 5432 for each. Click “Next” once all you members are added.
  10. Review the Ready to complete step and click “Finish” if it all correct
  11. Click the Publish Changes Button before proceeding
  12. Click the “Virtual Servers” link, then the green plus to add a Virtual Server
  13. Enter a meaningful name and description, provide the Virtual IP adddress that you added to the edge earlier, select the Pool created in the steps above and Enable TCP on port 5432. Make sure the “Enabled” box is checked. Click “Add” then “Publish Changes”

Now, when you configure your vCAC Appliance, provide the host name that resolves to the virtual IP address.vpostgres-vCAC1

Dealing with a failure
By default, the replica acts like a read-only copy of the database. It has a very short replication delay, so do not count on it to save you if you delete things from the primary.

When to promote a replica:

  • You’ve screwed up the network settings on the primary vPostgres node beyond repair; preventing vCAC from using it and replication from occurring
  • You’ve applied an update to the primary vPostgres node that broke it; preventing vCAC from using it and replication from occurring

When to NOT promote a replica

  • You deleted a bunch of stuff from vCAC. Too late! Those changes have already replicated
  • The physical host where the primary vPostgres virtual appliance was running has failed. Just wait for vSphere HA to being it back online
  • You want to see it run active/active. It does’t do that. relax

Recovery Procedure

  1. See if the primary/master node is up. If it is, stop here.
  2. Using the vCNS Manager web interface, edit the load-balancing pool, setting the weight for vpostgres1 (which has failed) to 0 (zero) and the weight for vpostgres2 (which we’re going to promote) to 1. Save and publish changes.
  3. SSH into the slave (vpostgres2) as postgres
  4. Run this command to promote the slave to master:

    /opt/vmware/vpostgres/current/share/promote_replica_to_primary

    The response will be “server promoting

  5. If/When vpostgres1 comes back to life, you’ll need to configure it as a replica to vpostgres2. Do this by running the command from step 19 above.
  6. Now if you want to make vpostgres1 primary again, I strongly suggest you stop the vcac_service on your vCAC appliances. Then, you’ll just promote it like you did before and make vpostgres2 a replica again.

Configuring Highly Available vCenter SSO with SSL certificates

*** UPDATE 12/18/14 ***
Instead of this blog, I strongly suggest you use and follow the
Configuring VMware vCenter SSO High Availability for VMware vRealize Automation Technical Whitepaper. It is somewhat more comprehensive and authoritative. For VMware documentation, it’s really good.
*** UPDATE ***

I love the simplicity of the vCenter Server Appliance and the VMware Identity Appliance for vCAC, but neither offer a high availability option better than vSphere HA. There are use cases where you’d need your SSO service to offer better uptime and resilience. In addition, there is some SSL certificates to be configured and for that, we’ll follow the instructions in KB2034833,  KB2061934 and KB2034181.

Notes, caveats, warnings
AFAIK, this will only work with vSphere 5.5. v5.1 handles SSO differently. I’m only using two nodes, if you have more, there will be extra steps. I do not have intermediate CAs, if you do, consult the KBs for the additional steps. I’m going to use a vCloud Networking and Security Edge Gateway as my load-balancer.  It does not offer SSL offload like some other load-balancers do, so you may have to take extra steps to configure SSL offload.

Here's what I have in mind; load-balanced SSO Servers
Here’s what I have in mind; load-balanced SSO Servers

Prerequisites
Reserve the IP addresses for your actual SSO servers, plus the Virtual IP address.
Add A or CNAME records to your DNS for the SSO servers and the virtual IP.
The DNS name of the virtual IP is what the SSL certificate must match (vcsso in my case)
You should have an edge gateway already configured with an interface in the same networks as your virtual IP and actual SSO servers.

First SSO Server

I’m starting with two freshly deployed Windows Server 2008 R2 VMs, joined to the domain and named vcsso1 and vcsso2.  On vcsso1, install the Single Sign-on service.  Be sure the prerequisites are all ok.

vCenter SSO Prereqs

On the deployment mode step, choose “vCenter Single Sign-On for your first vCenter Server” First SSO Server

Next,next,finish your way through the installation. You’ve set up an SSO server, YAY!

Second SSO Server

On the second server, vcsso, also install the SSO service.  We’re going to make a few different selections than we did on vcsso1 though.  On the deployment mode step, here we’re going to select “vCenter Single Sign-On for an additional vCenter Server in an existing site”.Second SSO

 

Next, we’re prompted for information about the first, or partner, SSO server.  SSO Partner

 

We have to confirm that the information obtained from the first SSO server is correct, so click Continue.Certificate Verification

Then we select the site name configured on the first SSO server.  I named mine “Lab”, but you can leave yours as “Default-First-Site” or whatever makes sense for your environment. Select Site Name

 

From here, you’ll Next,Next,Finish your way to completion.

Generating the Cert
Prerequisites: Either the VMware ssl-certificate-updater-tool or OpenSSL Win32 v0.9.8

  1. Log on to the first SSO server (vcsso1), extract the VMware SSL certificate updater tool to C:\ssltool or similar.  Create folders named “C:\certs\sso“.  Open notepad and paste the following:

    [ req ]
    default_bits = 2048
    default_keyfile = rui.key
    distinguished_name = req_distinguished_name
    encrypt_key = no
    prompt = no
    string_mask = nombstr
    req_extensions = v3_req


    [ v3_req ]
    basicConstraints = CA:FALSE
    keyUsage = digitalSignature, keyEncipherment, dataEncipherment
    extendedKeyUsage = serverAuth, clientAuth
    subjectAltName = DNS:ServerShortName, IP:ServerIPAddress, DNS:server.domain.com, DNS:ServerIPAddress

    [ req_distinguished_name ]
    countryName = Country
    stateOrProvinceName = State
    localityName = City
    0.organizationName = Company Name
    organizationalUnitName = vCenterSSO
    commonName = server.domain.com
  2. Replace the values in red with those appropriate for your environment. Be sure to specify the server name and IP address as the Virtual IP and its associated DNS record. Save the file as c:\certs\sso\sso.cfg
  3. At a command prompt, navigate to the folder containing openssl.exe (eg: C:\ssltool\tools\openssl). Run this command to create the key and certificate site request (CSR):

    openssl req -new -nodes -out c:\certs\sso\rui.csr -keyout c:\certs\sso\rui-orig.key -config c:\certs\sso\sso.cfg

    Generate CSR
    Generate CSR
  4. In the same command prompt, run this to change the key to the necessary type.


    openssl rsa -in c:\certs\sso\rui-orig.key -out c:\certs\sso\rui.key

  5. Follow the steps in KB2062108 to create the appropriate certificate template in you Active Directory Certificate Authority.
  6. Log into the Microsoft CA certificate authority Web interface. By default, it is http://servername/CertSrv/.
  7. Click the Request a certificate link.Click advanced certificate request.
  8. Click the Submit a certificate request by using a base-64-encoded CMC or PKCS #10 file, or submit a renewal request by using a base-64-encoded PKCS #7 file link.
  9. Open the certificate request (rui.csr) in notepad. Copy the content between —–BEGIN CERTIFICATE REQUEST—– and —–END CERTIFICATE REQUEST—–
  10. Paste the copied content into the “Base-64-encoded certificate request” textarea. Select VMware Certificate as the Certificate Template. See KB2062108 if you don’t have the “VMware Certificate” template
  11. Click Submit to submit the request.
  12. Click Base 64 encoded on the Certificate issued screen. Click the Download Certificate Chain link.
  13. Save the package as C:\certs\certnew.p7b.
  14. Double-click the p7b to open it in certmgr.  Navigate to Certificates – Current User\C:\Certs\Certnew.p7b\Certificates.

    Certs in P7b
    Certs in P7b
  15. You’ll see two certificates here (unless you have intermediate certificates, then you’ll have more).
  16.  Right-click the one for the SSO server, choose All Tasks|Export.  Save the file as Base-64 encoded X.509 (.CER) to c:\certs\sso\rui.crt
  17. Right-click the one for root CA server, choose All Tasks|Export.  Save the file as Base-64 encoded X.509 (.CER) to c:\certs\root.cer ..  Close certmgr.
  18. Generate the pfx by running this command:

    openssl pkcs12 -export -in c:\certs\sso\rui.crt -inkey c:\certs\sso\rui.key -certfile c:\certs\Root64.cer -name "ssoserver" -passout pass:changeme -out c:\certs\sso\ssoserver.p12

    Note: The certificate store password must be changeme and the key alias must be ssoserver. Do not change these parameters.

Install and Configure the Certificate

  1. While logged on to the first SSO server (vcsso1) as an administrator, make sure this folder exists: C:\Program Files\Common Files\VMware vCenter Server – Java Components If it doesn’t, you’ll need to check your SSO installation
  2. Open an elevated command prompt (as administrator) and enter the following

    SET JAVA_HOME=C:\Program Files\Common Files\VMware vCenter Server - Java Components
    SET PATH=%PATH%;C:\Program Files\VMware\Infrastructure\VMware\CIS\vmware-sso;%JAVA_HOME%\bin

  3. In the command prompt, cd to the folder containing openssl.exe (eg: C:\ssltool\tools\openssl)
  4. Generate a subject hash from the certificate using this command:

    openssl x509 -subject_hash -noout -in c:\certs\root.cer

    This will return an 8-character hash. Record it, we’ll need it later

  5. On both SSO servers, create the folder C:\ProgramData\VMware\SSL
  6. On both SSO servers, copy c:\certs\root.cer to C:\ProgramData\VMware\SSL renaming it to ca_certificates.crt
  7. On both SSO servers, copy c:\certs\root.cer to C:\ProgramData\VMware\SSL again, this time renaming it to <subjecthash>.0 (replacing <subjecthash> with your hash value from above and appending dot zero)
  8. Just on the first SSO server, paste the following into a text file named c:\certs\gc.properties. Replace the red text with appropriate values.

    [service]
    friendlyName=The group check interface of the SSO server
    version=1.5
    ownerId=
    productId=product:sso
    type=urn:sso:groupcheck
    description=The group check interface of the SSO server


    [endpoint0]
    uri=https://SSOserver.domain.com:7444/sso-adminserver/sdk/vsphere.local
    ssl=c:\certs\Root64.cer
    protocol=vmomi

  9. Paste the following into a text file named c:\certs\admin.properties. Replace the red text with appropriate values.

    [service]
    friendlyName=The administrative interface of the SSO server
    version=1.5
    ownerId=
    productId=product:sso
    type=urn:sso:admin
    description=The administrative interface of the SSO server


    [endpoint0]
    uri=https://SSOserver.domain.com:7444/sso-adminserver/sdk/vsphere.local
    ssl=c:\certs\Root64.cer
    protocol=vmomi

  10. Paste the following into a text file named c:\certs\sts.properties. Replace the red text with appropriate values.

    [service]
    friendlyName=STS for Single Sign On
    version=1.5
    ownerId=
    productId=product:sso
    type=urn:sso:sts
    description=The Security Token Service of the Single Sign On server.


    [endpoint0]
    uri=https://SSOserver.domain.com:7444/sts/STSService/vsphere.local
    ssl=c:\certs\Root64.cer
    protocol=wsTrust

  11. Next, we need the service ID for each of the three services SSO uses. To get these, run the following command, replacing the red text with the FQDN to your first SSO server:

    ssolscli.cmd listServices https://vcsso1.domain.local:7444/lookupservice/sdk

    SSO Services
    SSO Services
  12. The service ID for each service should be saved to a file. Use quickedit to copy the service id for each and echo it to a file:

    Echo service ID to files
    Echo service ID to files
  13. Update the Group Check service:

    ssolscli updateService -d https://ssoserver.domain.com:7444/lookupservice/sdk -u SSO_administrator -p password -si c:\certs\gc_id -ip c:\certs\gc.properties

  14. Update the Admin service:

    ssolscli updateService -d https://ssoserver.domain.com:7444/lookupservice/sdk -u SSO_administrator -p password -si c:\certs\admin_id -ip c:\certs\admin.properties

  15. Update the STS service:

    ssolscli updateService -d https://ssoserver.domain.com:7444/lookupservice/sdk -u SSO_administrator -p password -si c:\certs\sts_id -ip c:\certs\sts.properties

  16. Copy the new SSL files to C:\ProgramData\VMware\CIS\runtime\VMwareSTS\conf on both/all SSO servers:


    copy C:\certs\SSO\ssoserver.p12 C:\ProgramData\VMware\CIS\runtime\VMwareSTS\conf\ssoserver.p12
    copy C:\certs\Root.cer C:\ProgramData\VMware\CIS\runtime\VMwareSTS\conf\ssoserver.crt
    copy C:\certs\SSO\rui.key C:\ProgramData\VMware\CIS\runtime\VMwareSTS\conf\ssoserver.key

  17. Stop and restart the VMware Secure Token Service on both servers

Preparing to load-balance

  1. Navigate to http://firstssoserver.domain.local:7444/sts/STSService/vsphere.local notice that the certificate gives an error, but look at the cert. The certificate should return the “common” name (in my case, “vcsso” instead of “vcsso1”. Repeat this for the second and subsequent SSO servers, verifying that they provide the same certificate
  2. Using vCNS Manager, locate the appropriate edge gateway, click Actions|Manage to open it for editing
  3. On the Configure Tab, edit the interface that will listen on the virtual IP
  4. Edit the Subnet and add the Virtual IP. It’s probably not the primary IP. Save and publish those changes

    Add the virtual IP to the Edge Gateay
    Add the virtual IP to the Edge Gateay
  5. On the Load Balancer tab, on the Pools page, click “Enable”, then “Publish Changes”Enable Load Balancer
  6. Click the green plus to add a load-balancing pool
  7. Enter a recognizable Name and Description, click “Next”LB2-AddPool1
  8. On the Services step, check HTTPS, set Balancing Method to “ROUND_ROBIN” and the Port to 7444. Clck “Next”LB2-AddPool2
  9. On the Health Check step, set it as shown. Click “Next” when done.LB2-AddPool3-HealthCheck
  10. On the members step, click the green plus to add the IP address of you SSO servers to the pool. I suggest keeping the weifght for each at 1, unless you have a reason to send more requests to specific nodes. Keep the HTTPS port and Monitor Port at 7444 for each. Click “Next” once all you members are added.LB2-AddPool4-Members
  11. Review the Ready to complete step and click “Finish” if it all correct
  12. Click the Publish Changes Button before proceeding
  13. Click the “Virtual Servers” link, then the green plus to add a Virtual Server
  14. Enter a meaningful name and description, provide the Virtual IP adddress that you added to the edge earlier, select the Pool created in the steps above and Enable HTTPS on port 7444. Set the Persistence Method to SSL_SESSION_ID and make the “Enabled” box is checked. Click “Add” then “Publish Changes”LB2-AddVirtualServer
  15. Test by navigating to https://ssovirtual.domain.local:7444/lookupservice/sdk and https://ssovirtual.domain.local:7444/sts/STSService/vpshere.local verifying that the certificates match.
  16. YAY, load-balanced SSO with matching SSL certs!

One more thing….

Using your favorite web browser, navigate to http://ssovirtual.domain.local:7444/websso/SAML2/Metadata/vsphere.local you’ll be prompted to download and save an XML file named vsphere.download. Now open the XML file in notepad or Notepad++.  First, make sure you received a readable XML file.  Second, noticed that the EntitiesDescriptor/EntityDescriptor entityID property is server-specific.  We’ll need both servers to respond with the same information.

<EntitiesDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:vmes="http://vmware.com/schemas/attr-names/2012/04/Extensions" Name="vsphere.local" validUntil="2014-08-12T23:54:04Z">
<Extensions>
<vmes:ExportedOn>2014-08-11T23:54:04Z</vmes:ExportedOn>
<vmes:ExportedBy>Exported by VMware Identity Server (c) 2012</vmes:ExportedBy>
</Extensions>
<EntityDescriptor entityID="https://VCSSO1.domain.local:7444/websso/SAML2/Metadata/vsphere.local">
<IDPSSODescriptor WantAuthnRequestsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<KeyDescriptor xmlns:ds="http://www.w3.org/2000/09/xmldsig#" use="signing">
<ds:KeyInfo>
<snip...>

Warning This is not in a VMware KB, and may not be best way to do it. Having the value in the EntitiesDescriptor/EntityDescriptor entityID property match the FQDN is going to be very important in the near future. Trust me.

  1. On each server, open C:\ProgramData\VMware\CIS\cfg\vmware-sso\hostname.txt. It only contains the resolved hostname, so update it to the virtual hostname (vcsso.ragaazzi.lab in my case) save the file
  2. Retrieve the XML file from http://ssovirtual.domain.local:7444/websso/SAML2/Metadata/vsphere.local again open it and confirm that it contains the virtual hostname

Conclusion
This was such a lengthy post, I considered breaking it up, but there was no good break-point. Thanks for sticking with it. This is mostly for my own benefit, hopefully you’ll find it helpful too.

Thoughts on VCAP-CIA exam (VCIA510)

VCAP-CIAIt’s been a while, (a year?) since I’ve spent much time on vCloud Director 5.1. To prepare for the exam, I went through the blueprint thoroughly, reinstalled vCD in the lab and made sure I knew how to find/execute the objectives.

The environment:
You switch between the test questions/information and the Remote Desktop session to the Control Station. I would have preferred dual monitors so that I could look at the required values in the text while entering them. As it were, I spent a lot if time flipping between the question and the RDP session to make sure I entered the values verbatim.

Speaking of time…. The time constraint is the real test. I completed the questions with less than 10 minutes left to review and correct.

Obviously, some test stations/connections will be better than others, but in my case, it took three full seconds after a click for the vCD web GUI to respond.

Many of the questions build on one another. For example, Completing #4 correctly is necessary for #27 to make sense.

There are multiple vCD environments, make sure you read the question carefully and alter the correct cell. (Oops)

Hints & Tips:
Multi-task. While waiting for one item to complete (say waiting for a vCNS edge to redeploy), proceed to the next question so you can read it and begin it’s required steps. Return to your original question to verify your completed all the sub-tasks before getting too far ahead. There is no way I would have completed all the questions had I waited for each to complete before proceeding.

Read the blueprint. Know it cold. Know it well enough to identify which tasks will take you the longest.

In my case, I re-read the documentation for vCenter Chargeback Manager, but did not reinstall it or refresh my hands-on experience with it. (It’s crap, IMHO). So, I knew that the vCBM question would take me a bit to complete. I poked around for a few minutes, but left that item incomplete, hoping to return if time allowed (It didn’t).

Rather than trying to remember “/opt/vmware/vcloud-director”, just use “$VCLOUD_HOME”, it saved me some typing and recollection time.

Additional resources

I recommendKarthic Kumar’s VCAP-CIA Study Material, it’s more thorough that what I have here

 

Selected Objectives

Not comprehensive, just the items that I thought needed an explanation. This is kind of messy since I just pasted it from my word doc I used to prepare.

VCAP-CIA Objectives

Section 1 – Configure and Maintain vCloud Director

Objective 1.1 – Configure centralized logging

Skill 1.1.1             Determine use cases for and configure local and syslog options for vCloud Director

Syslog host can be set during installation.  Settings can be altered in the /opt/vmware/vcloud-director/etc/log4j.properties file.  Per Org-vDC syslog settings are in the Org vDC properties. Local logs are in /opt/vmware/vcloud-director/logs.  Syslog host should be changed via the configuration script, but can be altered in the global.properties file.

Skill 1.1.2             Configure and administer logging options for VMware vShield™ Manager

Syslog settings on Edge Gateways in Org vDCs can be synchronized by right-clicking the edge gateway under an Org vDC and selecting “Synchronize syslog settings”.  vShield Edge syslog settings are under Configuration|General|Syslog Server on vShield Manger web GUI.  Syslog settings can be set per Edge on the Syslog Server Settings tab of the Edge Gateway properties.

Skill 1.1.3             Configure Log4j options for vCloud Director

Within the log4j.properties file, the log level can be altered to TRACE, DEBUG, INFO, WARN, ERROR, ALL or OFF.  Root logger and several vCloud loggers are included.  Syslog appender is not used in the default configuration, vCD logs to both log4j and syslog natively.

 

Objective 1.2 – Configure vCloud Director for scalability

Know 1.2.1          Identify vCloud Director Installation methods

A vCloud Director sever groups consists of one of more vCD servers sharing a common database.  vCD 5.1 requires RHEL 5U4,5U5,5U6,5U8, 6U1 or 6U2.  Requires 1Gb RAM, 2Gb Recommended.  Can use MSSQL or Oracle for database. HTTP service should be load-balanced.  Transfer Server Storage must be mounted at $VCLOUD_HOME/data/transfer on each cell.  Before install first cell, install and configure vShield Manager.  Not necessary to register vShield Manager as a vSphere Client plug-in.

Steps:

        1. Add database, logon and permissions
        2. Create and Import SSL Certificates (or create self-signed SSL certs)
        3. Download and install the VMware public keys from http://packages.vmware.com/tools/keys. To alleviate warning about key missing
        4. Verify Transfer storage volume is mounted
        5. Copy installation file, chmod u+x it to make it executable
        6. Run it, run configuration file
        7. backup and copy the response file

Know 1.2.2          Identify vCloud Director Installation options

Advanced Message Queuing Protocol, AMQP, is optional.  It is used to provide a stream of notifications about events in vCD.  By default, the messages are unencrypted.  SSL Encryption can be enabled in the Extensibiity page of the vCD Web GUI by providing an SSL certificate pathname or a JCEKS trust store pathname and password.

Skill 1.2.3             Generate vCloud Director response files

Response file is located at /opt/vmware/vcloud-director/etc/responses.properties.  It is created by the /opt/vmware/vcl     oud-director/bin/configure script

Skill 1.2.4             Add vCloud cells to an existing installation using response files 

Copy response file from first cell.  Copy keystore and installation file.  Chmod u+x installation file.  As root, run installation-file –r path-to-response-file.  Add HTTP address for new cell to load-balancer config.

Skill 1.2.5             Set up vCloud Director transfer storage space

Configure NFS export with write permission for root.  Typically a few hundred GB. On each vCD host, add an entry to /etc/fstab to automatically mount the NFS export in the correct mount-point.  <NFS host IP>:path/to/export /opt/vmware/vcloud-director/data/transfer/ nfs intr 0 0  Use chown to give vcloud user and group access to the share.  Transfer space is used when subscribing to a published catalog.

Skill 1.2.6             Configure vCloud Director load balancing

Identify the HTTP addresses for each cell.  Add each to the pool for HTTP/HTTPS.  Create and import SSL certificates on each cell that use the FQDN of the virtual IP. Import the SSL certificate into the load-balancer for SSL-offload.  Repeat for console proxy addresses, except do not configure SSL-offload, use SSL-passthrough only for console proxy.

 

Objective 1.3 – Maintain vCloud using command line tools

Skill 1.3.1             Manage and maintain vCloud Director cells using the cell management tool

Cell Management Tool is located at $VCLOUD_HOME/bin/cell-management-tool

Commands:

  • cell – Manipulates the Cell and core components
  • dbextract – Exports the data from the given set of tables
  • certificates – Reconfigures the SSL certificates for the cell
  • ciphers – Reconfigure the list of disallowed SSL ciphers for the cell
  • generate-certs – Generates self-signed SSL certificates for use with vCD cell
  • recover-password – Change a forgotten System Administrator password. Database credentials are required
  • cell -m <arg>      enter maintenance mode (vCD 5.5+ only)
  • cell -q <arg>       quiesce activity
  • cell -s                     shut down cell
  • cell -t                     show the cell status

 

Skill 1.3.2             Install and manage a vCloud Director installation using the configure script

Configure script is located at $VCLOUD_HOME/bin/configure.  It can only be run of the vCD services are stopped.  It can be used to replace the SSL certificates by specifying a new keystore.

Skill 1.3.4             Manage vCloud services using Red Hat command line tools including service, chkconfig and netstat

                              Use chkconfig to list the services and their auto-start setting

Use service to stop, start, restart and check the status of a service.  vCD uses two services named “vmware-vcd-cell” and “vmware-vcd-watchdog” that are managed together through the service name “vmware-vcd”.

Use netstat to verify connections to database server or, with the –l –p options, verify vCD is listening on http and https

Skill 1.3.5             Collect logs for troubleshooting using the support script

Support script is located at $VCLOUD_HOME/bin/vmware-vcd-support

It zips all of the logfiles into a tgz file in $VCLOUD_HOME/bin.  –m parameter collects data from multiple cells.  –a collects all the data bundles.

 

Objective 1.4 – Configure Alarms and Notifications

Skill 1.4.1             Configure SMTP and notification settings

System/Default SMTP and notification settings are configured under the Administration tab.  Each Organization can use the system/default SMTP server or specify its own SMTP and notification settings under Organization properties|Email Preferences.  Organizations may specify a different sender and recipients from the system/default.  Optionally, audit events may be sent as notifications to the AMQP broker if one is configured.

Skill 1.4.2             Configure warning alerts

Default warnings for runtime and storage lease expiration are set under Preferences|Defaults.

Warning threshold for a Datastore is set in the datastore properties

Skill 1.4.3             Create System maintenance message 

                              Run $VCLOUD_HOME/bin/vmware-vcd-cell maintenance to display a maintenance message

Run $VCLOUD_HOME/bin/vmware-vcd-cell stop to stop the service

Run $VCLOUD_HOME/bin/vmware-vcd-cell start to start the service

 

 

Section 2 – Manage vSphere Resources

Objective 2.1 – Add vSphere compute resources to vCloud Director

Skill 2.1.1             Add new vCenter servers to vCloud Director

Add/modify/delete vCenter Servers under Manage and Monitor|vCenters.  The vShield Manager settings per vCenter Server are found on the vShield Manager tab of the vCenter Server properties.

Skill 2.1.2             Prepare/unprepared hosts in vCloud Director

Hosts are prepared/unprepared by right-clicking a host item under Manage and Monitor|Hosts.  Hosts in lockdown mode cannot be prepared.

Skill 2.1.3             Add ESXi hosts to vCenter

Add hosts to vCenter Server using the vSphere or vSphere Web Client.  Add the hosts to a cluster containing the resource pool assigned to a vCloud Director Provider vDC.  Prepare and enable the new hosts.

Skill 2.1.4             Manage ESXi hosts and DRS resource pools in vCenter

vCD-managed resource pools should not be manipulated manually.  Use vCD (Manage & Monitor|Hosts) to  Right-click to disable a host, then redeploy all VMs to a different host and put the selected Host into maintenance mode. Redeploy put a host in maintenance mode, which migrates the VMs, then exits Maintenance Mode.

 

Objective 2.2 – Manage vSphere storage resources

Know 2.2.1          Identify components, characteristics and features of vSphere storage

(Note: exam version pre-dates VSAN)

FC, FCoE, iSCSI, NFS

Skill 2.2.2             Decommission storage

A datastore must be disabled before removing it.  Enable/Disable and Remove actions are available by right-clicking a datastore under Manage and Monitor|Datastores.  New vApps cannot be added to a disabled datastore.  Existing vApps on a disabled datastore cannot be started.  A Datastore must be disabled and removed from Provider vDCs before it can be removed.  To vacate the datastore, update the datastore’s storage profile assigned in vSphere to one that is not used by vCD-managed VMs.  It is not recommended to simply move the VMs via the vSphere client as the Fast Provisioned VMs will be inflated to full clones,

Skill 2.2.3             Create and manage storage profiles

Storage profiles are created and managed within vSphere.  They are consumed by and represented within vCD.  Storage profiles can be named to reflect tier of storage and list the storage capabilities. Storage profile assignment per datastore cannot be altered from with vCD, only from vSphere.

Storage Profiles are added to Provider vDCs to make the storage available for consumption by vCD.

Storage for an org vDC is allocated per Storage Profile.  The default storage profile for an Org vDC is used to house VMDKs where the storage profile is not specified.  When VMs are provisioned by vCD, they are assigned a Storage Profile and placed on compliant datastores.

 

Objective 2.3 – Manage vSphere network resources

Know 2.3.1          Identify vSphere networking components

vSphere Standard Switch (vSS) and vSphere Distributed Switch (vDS).  Each vSS or vDS requires at least one physical uplink (vmnic).  VMKernal ports can reside on either vSS or vDS.

vDS Uplink Load-balancing options:

  • Route based on originating virtual port
  • Route based on IP hash.  Hash of source and dest IPs to select route
  • Route based on physical NIC load
  • Use explicit failover order

Skill 2.3.3             Configure vSphere network options including MTU and VLAN

On a vSS, the MTU is set on the vSwitch properties.  Each VMKernel port can have its MTU set.  VM port groups use the switch MTU. The VLAN for a VM port group or VMKernel port can be edited in its properties

On a vDS, the MTU is set on the vDS advanced properties.  Port groups inherit the vDS MTU.  On each host, the vmk (Virtual Adapter) is assigned to a vDS port group and can have its MTU set.

 

Objective 3.2 – Manage vCloud Director network resources

Know 3.2.1          Identify vCloud Director network pool types

                              Certain Organization networks and all vApp networks are backed by network pools

A network pool can be backed by VLAN IDs, port groups or Cloud isolated networks (vCD-NI)

VLAN-backed relies on a range of VLAN IDs and a vSphere distributed switch.  Provides the best security, scalability and performance.  VLANs must be isolated at layer 2.

vCD-NI-backed relies on an underlay VLAN ID and a vSphere distributed switch. Additional headers can cause frame to exceed 1500 bytes, set MTU on network pool and physical network to 1600 to avoid fragmentation.

Port Group-backed can use vSphere standard switchs.  Port groups must be isolated at layer 2 or physically isolated. Each port group must only a single VLAN.  Create one network for each port group.

Skill 3.2.2             Create and manage network pools

Each Organization can have one network pool, multiple organizations can share the same network pool.  Only system admins can create and manage network pools

Network pools are created and managed under the Manage & Monitor tab.  Network Pool MTU size can be set by right-clicking a network pool name.

Skill 3.2.3 – Create Provider external networks

Existing vSS or vDS port groups on the connected vCenter Server may be selected.  Network information is assigned including Gateway, network mask, DNS and a Static IP pool to use for VMs and gateways provisioned in that network by vCD.  External networks may be used by multiple provider vDCs, be sure the hosts have access to the network.

Skill 3.2.4             Manage and remove network resources

Before deleting an external network, all of the edge gateways and org vDC networks that rely on it must be removed.

 

Objective 3.3 – Manage Organization VDCs

Know 3.3.1          Identify org VDC types

The three allocation models an Org vDC may use are:  Allocation Pool, Pay-as-you-go, Reservation Pool

        • Allocation Pool                  Only a percentage of the resources you allocate from the Provider vDC are committed to the Org vDC.  Adding multiple resource pools to the provider vDC makes the org vDC elastic
        • Pay-as-You-Go                  Resources are committed when users create new vApps in  the Org vDC.  Specify a percentage of resources to guarantee.  Adding multiple resource pools to the provider vDC makes the org vDC elastic.  The benefit of the PaYG model is that it can take advantage of new resources added to a provider vDC.  No resources are reserved ahead of time, so a VM may fail to power on if insufficient resources are available.
        • Reservation Pool              All of the resources you allocate are immediately committed to the org vDC.  Can fine-tune over-commitment, but it is not elastic and could be configured non-optimally.

 

Know 3.3.2          Identify org VDC options

An Org vDC must be based on a Provider vDC.  The three allocation models are listed in 3.3.1.  After selection, the actual resource allocation settings are made.  Available Storage policies in the Provider vDC are added to the org vDC and a capacity limit is set.  Options to enable thin provisioning and/or fast provisioning are selected.  Fast Provisioning is linked cloning.  Default is thin provisioning off and fast provisioning on.  Optionally, the Org vDC may have a network pool assigned in order to draw from when vApp networks are created.

Know 3.3.3          Identify org VDC network options

An Org vDC network may be directly connected to an external network, be isolated or routed via edge gateway.  An Org Network may optionally be shared with other Org vDCs in the Organization.

Skill 3.3.4             Configure storage tiers

Storage Profiles must be created in vSphere and assigned to appropriate datastores based on the datastore capabilities.  The Storage profiles are added to the Provider vDCs, then to the Org vDCs.  A vApp Template can specify a default Storage profile per VM.  When provisioning a vApp from a vApp Template, you may select the storage profile per VM.

 

Objective 3.4 – Manage an Organization

Know 3.4.1          Identify Organization options and their uses

Org authentication can use:

  • vCD system LDAP with or without a specific OU
  • Custom LDAP service; vCD system LDAP must be linked to organization’s LDAP
  • No LDAP; local vCD users only

 Organizations can be granted the ability to share catalogs and publish and/or subscribe to external catalogs.

 An Organization can use the system SMTP server and notification settings or use their own.

 Leases, Quotas, Leases and Password Policies are set per Org.

Runtime lease:  Upon expiration, the vApp is powered off

Storage lease: Upon expiration, the vApp is moved to expired items or deleted permanently depending on the storage cleanup setting

Storage Cleanup: select Move to expired items or delete permanently

vApp Template maximum storage lease: Applies to vApp Templates, move or delete upon expiration

All VMs Quota:  Limits the total number of VMs in the org (default: unlimited)

Running VMs Quota: Limits the number of running VMs in the Org (default: unlimited)

 Limits can be set to prevent DoS attacks, they are:

  • Number of resource intensive operations per user (default: unlimited)
  • Number of resource intensive operations per Org (default: unlimited)
  • Number of simultaneous connections per VM (default: unlimited)

 Local account lockout policies can be enabled, setting the number of invalid logins before lockout and the lockout duration.

 

Skill 3.4.2             Create and manage Organizations

Existing organizations can be managed on the administration tab of the Org.

The Organization Name and URL cannot be altered, but the full (display) name can.

Options listed in 3.4.1 can be updated plus:

Enable Domain Join – VMs join the LDAP domain using the credentials and OU provided

Federation – Single Sign-On via SAML

Adding new local users and importing groups from LDAP

Skill 3.4.3             Manage Organization policies and settings

                                See 3.4.1 & 3.4.2

 

Section 4 – Manage Complex vCloud Director Networks

Objective 4.1 – Configure Organization and vApp network services

Skill 4.1.1             Configure DHCP and DNS relay

DHCP is enabled and configured in the Edge Gateway Edge Gateway Services Properties.  Must have an internal network to associate DHCP pool with

DNS relay is enabled in the Edge Gateway properties, DNS requests are received at the Edge and forwarded/relayed.

 

Skill 4.1.4             Configure and maintain static routes

Static Routes are created and maintained on the Static Routing tab of Edge Gateway Services properties.

Objective 4.2 – Create and maintain cloud networks

Skill 4.2.2             Configure Edge Gateways for availability and scalability

High Availability on an existing Edge Gateway can be enabled on the general tab of the edge gateway properties.  This creates a second Edge Appliance and enabled automatic failover to the backup edge gateway.

An Edge Gateway’s configuration can be upgraded from compact to Full to Full-4 to provide more memory and compute resources to the Edge Appliances.

 

Section 5 – Manage Security

Objective 5.1     Manage vCloud Director SSL Certificates

If using signed certificates, use keytool to create the keystore, the untrusted certificates and the certificate signing requests.  After receiving the signed certificates, import the CA’s root cert and the signed certs into the keystore.

If using self-signed certificates, use keytool to create the keystore and untrusted certificates.

The keystore must be readable by any user.  Watch for overly-restrictive permissions.

Skill 5.1.1             Create and process certificate requests

Create untrusted certificate for http:
keytool -keystore certificates.ks -storetype JCEKS -storepass <passwd> -genkey -keyalg RSA -alias http
Create Certificate Signing Request named http.csr:
keytool -keystore certificates.ks -storetype JCEKS -storepass <passwd> -certreq -alias http -file http.csr
Import CA’s root certificate from root.cer into keystore:
keytool -keystore certificates.ks -storetype JCEKS -storepass <passwd> -import -alias root -file root.cer
Import CA signed certificate from http.cer:
keytool -keystore certificates.ks -storetype JCEKS -storepass <passwd> -import -alias http -file http.cer

Skill 5.1.2             Replace default certificates

Create new certificates in new keystore.  Run $VCLOUD_HOME/bin/configure to provide path to new keystore.  Restart services.

 

Objective 5.2 – Configure and manage vCD access control

Skill 5.2.1             Configure LDAP (Active Directory and Open LDAP)

System LDAP is configured under the Administration Page|LDAP settings.  This establishes the default authentication for the system.  Organization may use the default/system LDAP or an Organization-specific LDAP.  Note that Org-specific LDAP directories must have a trust relationship with the system LDAP directory.

Skill 5.2.2             Import users and groups from a LDAP source

On the Administration Page for System, under System Administrators and Roles|Users, Users may be imported from the LDAP source and assigned to the System Administrator Role.

On the Administration Page for System, under System Administrators and Roles|Groups, Security Groups may be imported from the LDAP source and assigned to the System Administrator Role.

On the Administration Page for an Org, under Members|Users, Users may be imported from the LDAP source and assigned to a Role other than “System Administrators”

On the Administration Page for an Org, under Members|Groups, Security Groups may be imported from the LDAP source and assigned to a Role other than “System Administrators”

 

Skill 5.2.3             Create and assign roles

Roles are created under System|Administration|System Administrators and Roles|Roles.  They can only be created, deleted or edited by System Administrators.

Roles (other than System Administrators) are assigned per Organization to users and/or groups.

Skill 5.2.5             Configure and maintain VMware Single Sign-On for vCloud Suite products

First vCD must be registered with the vSphere Lookup Service under System|Administration|System Settings|Federation.  Provide lookup service URL and credentials.  Then, the Use vSphere Single Sign-On option becomes available to enable.

 

Section 6 – Manage catalogs and vApps

Objective 6.1 – Share vApps and catalogs

Skill 6.1.1             Manage catalog sharing and access levels

Catalogs can be shared with Everyone in the Org or with specific users and groups in the Org.  Each can be assigned Read Only, Read/Write or Full Control permission to the catalog.  If the Org has the “Allow Sharing Catalogs to other organizations” option enabled, the catalog may be shared with all or selected organizations as Read Only.

Skill 6.1.3             Manage Catalog and vApp ownership

Within an Organization, highlight a catalog and select actions|Change Owner to select a different owner of the catalog.

vApps can be shared with selected members of the same Organization. Each can be assigned Read Only, Read/Write or Full Control permission to the vApp.

 

Objective 6.2 – Create and deploy vApps

Skill 6.2.1             Customize vApps

Open the Properties of an existing vApp to change its name, lease, startup/shutdown order and sharing.

Skill 6.2.2             Manage guest customization including SYSPREP utilities

(vCD 5.1)

  1. Create a folder on the vCD  Cell.  Eg: /usr/tmp/sysprepFiles
  2. Create subfolders for O/Ses. /win2000  /win2k3  /win2k3_64  /winxp  /winxp_64
  3. Run $VCLOUD_HOME/deploymentPackageCreator/createSysprepPackage.sh /usr/tmp/sysprepFiles
  4. Restart the vmware-vcd services
  5. Copy $VCLOUD_HOME/guestcustomization/vcloud_sysprep.properties and $VCLOUD_HOME/guestcustomization/windows_deployment_package_sysprep.cab to remaining cells
  6. Restart the vmware-vcd services on the other cells

Skill 6.3.3             Import media into a catalog

Upon upload, media is copied to the transfer space, then to the datastore corresponding to the catalog.

 

Objective 6.4 – Manage vApp storage settings

Know 6.4.1 – Understand snapshots, consolidate and chain length

Skill 6.4.2             Create, discard and commit snapshots in vCloud Director

Use Actions|Create Snapshot to create, revert and remove (discard) a snapshot of a vApp.

Skill 6.4.3             Consolidate vApps

Consolidate VMs on the Virtual Machines tab of the vApp Properties.

Skill 6.4.4             Monitor chain length

Chain length for a VM is shown on the VM properties|General tab.

Setting the Machine Name of a vCAC-provisioned VM using vCO

This is a follow-up to the series of posts named “Setting the Machine Name of a vCAC-provisioned VM to comply with a Corporate Standard“. In this case, I wanted to use vCenter Orchestrator instead of Powershell to generate the name from the component values.

For this sequence, we’ll still use part 1 to set up the Build Profile and Property Dictionary, but these steps will replace part 2 and some of part 3.

Review

Recall that for this example, the name should use the initials of the Business Group, “V” for Virtual, a single letter for the OS (“W” for Windows, “L” for Linux, “S” for Solaris, “O” for other), a three character “role” and a two digit sequence number for uniqueness.

Example Naming convention:
BG1VWAPP14
BG1 = Business Group initials
V = Virtual
W = Windows
APP = APPlication server
14 = Sequence number

vCenter Orchestrator Workflow

  1. Create a Folder for your workflows outside of the “Library” and other folders
  2. Inside this folder, create a new workflow.  I named mine “vCAC.MachineName“.  The workflow will be opened for editing.
  3. Navigate to the “In” tab, add this attribute
    Name Type Value Description
    CharacterToReplace String What Character in the original name will be replaced
  4. Navigate to the “Inputs” tab, add these Parameters:
    Name Type Description
    OriginalName string ex: SUP-02
    OperatingSystem string ex: Windows 2008 R2
    Role string ex: SQL
  5. Navigate to the “Outputs” tab, add this Parameter:
    Name Type Description
    newMachineName string Name created from component values
  6. From the “Generic” pane, drag the “scriptable task” item to the blue arrow.

    Default schema
    Default schema
  7. Mouseover the scriptable task item in the schema and click the Pencil icon to edit the item

    Edit the Scriptable Task
    Edit the Scriptable Task
  8. On the “IN” tab of the scripting task properties, click the “Bind to workflow parameter/attribute” button to add these parameters:

    Scriptable Tasks IN Parameters
    Scriptable Tasks IN Parameters
  9. On the “OUT” tab of the scripting task properties, click the “Bind to workflow parameter/attribute” button to add these parameters:

    Scriptable Tasks OUT Parameter
    Scriptable Tasks OUT Parameter
  10. Open the Schema tab of the Workflow.
  11. Paste the following:


    var OS;
    OS="O" //"O" not zero, for "Other"
    OperatingSystem = OperatingSystem.toUpperCase();
    if (OperatingSystem.search("WIND")> -1) {OS="W"};
    if (OperatingSystem.search("RHEL")> -1) {OS="L"};
    if (OperatingSystem.search("SLES")> -1) {OS="L"};
    if (OperatingSystem.search("SOLA")> -1) {OS="S"};
    Role='V'+OS+Role.substring(0,3); //"V" for Virtual
    newMachineName = OriginalName.replace(CharacterToReplace,Role).toUpperCase();

    I’m not much of a javascript coder, so this is probably not the best way to write this. But, it worked for me. Close the scriptable task editing window.

  12. Back on the Schema tab of the workflow, let’s test our code. Click the “Run” button, enter some values in the fields and click submit.

    Test Run workflow
    Test Run workflow
  13. When the workflow finishes, check the Variables tab on the right to confirm that the newMachineName parameter has the expected value.

    Resulting newMachineName
    Resulting newMachineName
  14. If satisfied, click “Save and close” to save your new workflow

vCAC Workflow

There are only two changes to be made from the steps outlined here.  The first is in Step 3, instead of using a variable named “PowerShellOutVar“, we’re just going to name it “OutVar” for obvious reasons.  The second change is a replacement of step 7, do this instead:

  • From the DynamicOps.VcoModel.Activities toolbox, drag “InvokeVcoWorkflow” to the designer.

    InvokeVcoWorkflow
    InvokeVcoWorkflow
  • Click the ellipsis button to  display a list of the workflows in vCO, select the workflow we made earlier (vCAC.MachineName in this case).  Note that you can filter on the Folder to make it easier to find.
  • Set the parameters
    Direction Name expression/value
    Input OriginalName vmName
    Input OperatingSystem vmwareOS
    Input Role machineRole
    Output newMachineName OutVar

    Variables & Parameters
    Variables & Parameters
  • Continue with the remainder of the steps, remembering that when you link it up in step 12, you’ve replaced “InvokePowerShell” with “InvokeVcoWorkflow

Good luck!