WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Uncategorized / Automating VCSA 5.1 (vCenter Server Appliance) Configurations

Automating VCSA 5.1 (vCenter Server Appliance) Configurations

09.03.2012 by William Lam // 15 Comments

If you have seen my previous article on Automating VCSA (vCenter Server Appliance) 5.0, you will notice the existing script will not work on latest VCSA 5.1, without a minor tweak. The reason for this is due to the new vCenter SSO (Single Sign-On) configuration that is now part of the initial setup.

Note: If you would like to learn more about the new vCenter SSO, I would recommend you take a look at the What's New vCenter Server 5.1 whitepaper.

Luckily, the change is quite simple and in the example below, you will be configuring vCenter Server SSO to run in the embedded mode on the VCSA. I have also enhanced the script to include the joining of an Active Directory domain if you wish to have the VCSA backed by AD.

Disclaimer: This is for educational purposes only, this is not officially supported by VMware. Please test this in a development environment before using it on actual systems.

Here is a script with the minimal commands needed for running an embedded configuration:

#!/bin/bash

# User Configurations
JOIN_AD=0
AD_DOMAIN=primp-industries.com
AD_USER=administrator
AD_PASS=mysupersecurepassword
VCENTER_HOSTNAME=vcenter51-1.primp-industries.com

## DO NOT EDIT BEYOND HERE ##

echo "Accepting EULA ..."
/usr/sbin/vpxd_servicecfg eula accept

if [ ${JOIN_AD} -eq 1 ]; then
        echo "Configuring vCenter hostname ..."
        SHORTHOSTNAME=$(echo ${VCENTER_HOSTNAME} |  cut -d. -f1)
        /bin/hostname ${VCENTER_HOSTNAME}
        echo ${VCENTER_HOSTNAME} > /etc/HOSTNAME
        sed -i "s/localhost.localdom/${VCENTER_HOSTNAME}/g" /etc/hosts
        sed -i "s/localhost/${SHORTHOSTNAME}/g" /etc/hosts

        echo "Configuring Active Directory ..."
        /usr/sbin/vpxd_servicecfg ad write "${AD_USER}" "${AD_PASS}" ${AD_DOMAIN}
fi

echo "Configuring Embedded DB ..."
/usr/sbin/vpxd_servicecfg db write embedded

echo "Configuring SSO..."
/usr/sbin/vpxd_servicecfg sso write embedded

echo "Starting VCSA ..."
/usr/sbin/vpxd_servicecfg service start

Note: By default the script will not join an AD domain, you will need to change the JOIN_AD variable to 1 and ensure you specify all the Active Directory configurations including the FQDN of your vCenter Server as this is required for properly join your VCSA to your AD domain. If you choose to join an AD domain, make sure you have proper forward/reverse DNS configured on the VCSA and you will also need to reboot the VCSA for the changes to take effect.

To run the script remotely (you do not need to copy it to VCSA), use the following command:

# ssh root@[vcsa-ip] < configureVCSA.sh

You can now quickly deploy and configure your VCSA in just minutes versus spending 5-10 minutes clicking around and waiting for the web interface. Once you have tried this script, you will never go back to manually configuring the VCSA using the web interface!

More from my site

  • Increasing disk capacity simplified with VCSA 6.0 using LVM autogrow
  • Completely automating vCenter Server Appliance (VCSA) 5.5 Configurations
  • Quick Tip - Automate JVM Heap configurations after increasing VCSA memory
  • Automating VCSA 5.5 Configurations including SSO Administrator password
  • Quick Tip - Automate the enabling of the Customer Experience Improvement Program (vTelemetry) in VCSA

Categories // Uncategorized Tags // VCSA, vcva, vpxd_servicecfg, vSphere 5.1

Comments

  1. *protectedSean Leahy says

    09/04/2012 at 9:27 pm

    script is great, it is exactly what I was looking for, I am also trying to re-configure the eth0. Can this be done by using ifconfig in the script, modifying the config file or will that cause issues. Is there a vami cmd to modify the network settings or some vmware cmd. Any help is welcome. thanks
    Sean

    Reply
    • *protectedWilliam says

      09/04/2012 at 9:51 pm

      Yes, there various ways of changing the IP Address (not sure if there's any VAMI specific tools). I would start by looking at /etc/sysconfig/network/ifcfg-eth0 and you can of course search online if you need the steps

      Reply
    • *protectedAnonymous says

      05/23/2013 at 9:36 am

      You can reconfigure eth0 by running /opt/vmware/share/vami/vami_config_net

      You could also call that script from William's script.

      Chris

      Reply
  2. *protectedAnonymous says

    10/28/2012 at 3:07 pm

    Hi,

    I am looking for solution to configure vCSA to authenticate over two (or more) MS AD domains. In fact, for some reason, I need to add roles to my vCSA, using accounts from two different (and un-related) MS AD domains.

    Do you have any idea would it be possible, using scripts?

    Milan

    Reply
  3. *protectedIvan Gostev says

    05/29/2013 at 9:39 pm

    sed commands made too many changes to /etc/hosts, localhost completely gone, you'd better write to it from the scratch with:

    echo "127.0.0.1 ${VCENTER_HOSTNAME} ${SHORTHOSTNAME} localhost" > /etc/hosts
    echo "::1 ${VCENTER_HOSTNAME} ${SHORTHOSTNAME} localhost ip6-localhost ip6-loopback" >> /etc/hosts

    Joining AD domain did not work for me, I used another command:

    /opt/likewise/bin/domainjoin-cli join "$AD_USER" "$AD_PASS" "$AD_DOMAIN"

    Reply
  4. *protectedAnonymous says

    07/02/2013 at 1:05 pm

    Hi,

    With the latest versions, 5.1U1, eg. VMware-vCenter-Server-Appliance-5.1.0.10100-1123965_OVF10.ova Do you know if this problem remains between VCSA and SSO? Is it even necessary to make this small touch? I mean to a instalation from scratch.

    By the way, Is it better ovf or ova to implement VCSA?

    Flat

    Reply
  5. *protectedDan Tehranian says

    06/17/2014 at 5:31 pm

    I'm not seeing the script source... Maybe it got lost in the migration in between the old wiki and the new one?? :-/

    Reply
    • William Lam says

      06/18/2014 at 4:57 am

      Thanks, I've fixed the post

      Reply
  6. *protectedjoseiii says

    08/18/2014 at 5:42 am

    Hi, William:

    What about scripts to automate vCSA and VDP upgrades? Looking forward to these. 🙂

    Best Regards,
    Joe

    Reply
    • William Lam says

      08/18/2014 at 2:37 pm

      Take a look at this article for updating the virtual appliances http://www.virtuallyghetto.com/2013/05/patching-vmware-virtual-appliances.html

      Reply

Trackbacks

  1. How to Quickly Get Started with VMware vSphere & OpenStack? | virtuallyGhetto says:
    02/28/2014 at 9:02 pm

    […] ready environment with vCenter Server and at least one ESXi host (I recommend using the vCenter Server Appliance for quick […]

    Reply
  2. Configuring Additional VCSA 5.1 as vSphere Web Client Servers | virtuallyGhetto says:
    05/29/2014 at 12:29 pm

    […] Automating VCSA 5.1 (vCenter Server Appliance) Configurations […]

    Reply
  3. Virtualbox + Vagrant + VCSA + VCSIM To Automate Your vCenter Test Environment | errr-online.com says:
    07/30/2014 at 6:22 am

    […] wonderful blog posts that have helped me get a lot of what I needed done with out even having to do anything myself except modify a script to meet my needs. This blog post is going to take what I […]

    Reply
  4. Hybrid environment leveraging SSO Multi-Master Replication between vCenter Server for Windows & VCSA | virtuallyGhetto says:
    10/31/2014 at 7:40 pm

    […] majority of the script is actually from an earlier script that I wrote during vSphere 5.1 release for the VCSA. However, there are a couple of additions to […]

    Reply
  5. New vCenter Server Simulator 2.0 enhancements in VCSA 5.5 | virtuallyGhetto says:
    11/15/2015 at 10:24 am

    […] Note: Before you can use VCSIM, you will need to configure the VCSA as you normally would by going through the VAMI interface or running through the SSH commands noted in this article. […]

    Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025