Continuing my quest in customizing the vCloud Automation Center experience, I noticed that manual typing the full URL for a tenant is not “ideal”, especially when not in front of your computer (where you might have a bookmark) or when working from a tablet.

One of my pet peeves is that I want to reach my services with the minimum amount of effort possible, this includes typing and thinking, I’m a big fan of short URLs and domain aliases, hence I wanted to explore how to do that with vCAC.

Currently to access a vCAC tenant you have to point your browser to a specific url in the form of: https://<vcac portal machine>/shell-ui-app/org/<your tenant id>

Which is not mnemonic at all, I thought it would be great to have a short domain like: http://gosddc-tenant

to get to the same place, this is easily achievable with some quick Apache and mod_rewrite wizardry, and looks like the vCAC appliance has everything already set up, waiting for you to customize.

DISCLAIMER

These modifications are absolutely NOT SUPPORTED by VMware, they should be harmless but may disappear at any time, I strongly warn you about making these modifications in a production environment.

What we’re going to do is basically add vhosts to the Apache running on the vCAC portal machine, if you’re using a load balanced environment make sure to create the file on all the vCAC appliances you have.

Log into the vCAC appliance as root and cd to /etc/apache2/vhosts.d, in this directory create a file called <your tenant>.conf make sure you use an appropriate for your tenant and add the .conf at the end (this is vital for Apache to pick the config file up).

Inside the file put these statements (make sure to change the values to your needs):

# Virtualhost for easy tenant redirect
<VirtualHost *:80>
    ServerName <fqdn for your alias>
    ServerAlias <name of your alias>
    RewriteEngine On
    RewriteRule ^(.*)$ https://%{SERVER_NAME}/shell-ui-app/org/<id of your tenant> [R=301,L]
</VirtualHost>

As an example, this is my configuration that serves http://gosddc-tenant:

# Virtualhost for easy tenant redirect
<VirtualHost *:80>
    ServerName gosddc-tenant.ad.lab.gosddc.com
    ServerAlias gosddc-tenant
    RewriteEngine On
    RewriteRule ^(.*)$ https://%{SERVER_NAME}/shell-ui-app/org/gosddc [R=301,L]
</VirtualHost>

After you’re done with the modifications, make sure to check the syntax is ok with service apache2 configtest, ignore the warnings and make sure you get the Syntax OK message at the end.

Once you’re done with the check, issue a service apache2 restart-graceful, this will restart Apache and load the modifications, note that this operation is disruptive and may drop connections from the clients.

And you should be all set, but remember, these modifications are NOT SUPPORTED by VMware!.

Fabio Rapposelli Picture

About the author...

  sddcvirtualizationvmwarevcac

Comments