Last week, I spent some time exploring how I can automate the process of installing vCenter and VMware Update Manager (VUM) for vSphere5.
Why? Well, I’ve been manually installing these products since they were version 1.0, and to be honest I’m a bit tired of doing that. But, more important, I think the future will be in automating mundane tasks such as installing vCenter as part of the process of decreasing the time to set up a new vSphere deployment.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
It’s also part of another of my projects to fully automate the build out process of a VMware management layer.
Alongside forklifting new hardware into the data centre in the shape of Dell vStart, VCE vBlocks, HP Matrix or NetApp FlexPod, shouldn’t there be an automated way of putting the vSphere stack on top of this bare metal in the fastest way possible with minimum effort?
VSphere5 supports an “auto deploy” feature that allows for the PXE booting of ESX (virtualisation product from VMware). It offers the potential of a stateless host without any local storage -- not disks, USB sticks nor SDcards.
The Auto Deploy feature is an add-on to vCenter. So, start with installing vCenter and then use auto deploy as way of getting the ESX hosts up and running.
There’s precious little written right now, on the cusp of the general availability of vSphere5, about how to automate the installation of vCenter and VUM. Fortunately, there is plenty from VMware for vSphere4, and I found that this documentation still works for vSphere5.
One interesting aspect of the documentation is the rather odd statement of support from VMware:
“IMPORTANT: The command-line installation method is not officially supported. However, if the installation succeeds, the installed products are supported.”
I think that means that if a scripted installation of vCenter makes it into production, it will be supported. But if you’re getting errors and general weirdness when getting the scripted install to work, you’re caught in a “don’t call us” situation.
In my deployment, for instance, I’ve never used free database engines such as SQL Express with vCenter. In my environment, the Microsoft SQL Server is always an external machine regardless of whether it is physical or virtual. That’s why I was pleased to see VMware finally support Windows Authentication to the Microsoft SQL Server as this is more secure and more desirable than the older, less secure and legacy SQL Authentication.
However, a scripted installation of vCenter shouldn’t care either way what format of authentication is used.
Before you start a scripted installation, remember these prerequisites: First, any account you use for installing vCenter needs administrator rights over the local machine, which you can achieve by using the old “net localgroup” command on Windows 2008 R2 64-bit:
net localgroup administrators corp\vcdbuser-nyc /add
Second, the account (in my case, vcdbuser-nyc) needs to have Windows right to “Logon on as service”. Normally, that would be automatically granted during a manual install but not when it is scripted.
Sadly, Windows 2008 no longer ships with the old ntrights.exe utility that would allow you to script this portion of the prerequisites, so you may be forced to use the “Local Policy” snap-in instead (see Figure 1).
Finally, the vCenter installer cannot handle the database requirements directly, so I found myself using the /passive switch to silent install the Microsoft SQL Native Drivers. And then, using the ODBC Manager, I created a System DSN connect to the database.
Once these prerequisites are in place, you can perform the scripted installation of vCenter. Below is an example of a typical scripted install of vCenter using an external SQL Server. (The string has been “wrapped” for readability as normally it would be one continuous string.)
start /wait \\192.168.3.254\software\VMware\vc5\vCenter-Server\VMware-vcserver.exe /q /s /w /L1033 /v" /qr WARNING_LEVEL=0
COMPANYNAME=\"For and On behalf of Corp, Inc.\"
VPX_ACCOUNT=\"CORP\vcdbuser-nyc\" VPX_PASSWORD=\"Password1\" VPX_PASSWORD_VERIFY=\"Password1\"
Most of this is pretty straightforward. The switches immediately after VMware-vcserver.exe are designed to completely silently install the product, and the entries in capitals beginning with “WARNING_LEVEL=0” are intended to answer the variables in the installation.
The key parts are the DB_ and VPX_ variables. They handle the connection to the database and the setting of the user account for starting the service. Then there’s VCS_ variables, which handle the vCenter “Linked Mode” feature that allows you to collapse multiple vCenters together. So, when you log in, you see multiple vCenters, and it offers advanced features like license and roles sharing. The VCS_ variables allow you to create a stand-alone vCenter or to join a new vCenter to an existing vCenter group. If you do want to use the free, built-in vCenter, most DB_ variables wouldn’t be present; instead, the command line would simply have a statement to use two parameters: DB_SERVER_TYPE=Bundled and FORMAT_DB=1.
Installing VMware Update Manager
Scripting the Update Manager install is similar but differs in two critical ways. First, VUM in vSphere5 still requires 32-bit DSN because it remains a 32-bit service
start /wait \\192.168.3.254\software\VMware\vc5\ updateManager\VMware-UpdateManager.exe /L1033 /v" /qr
VMUM_SERVER_SELECT=vcnyc.corp.com VC_SERVER_IP=vcnyc.corp.com VC_SERVER_ADMIN_USER=\"corp\administrator\" VC_SERVER_ADMIN_PASSWORD=\"Password1\" VCI_DB_SERVER_TYPE=Custom
Again, the switches after the main .exe are there to keep the installation silent. The second difference is that although the DB_ options remain much the same, the command VCI_DB_SERVER_TYPE is used instead of DB_SERVER_TYPE to indicate the installer is to use an external SQL database.
The VMUM_DATA_DIR is also used to set the variable for the location of patches and updates to be downloaded.
I’ve always put these on a separate virtual disk inside the vCenter server (hence, the reference to the D: drive). Note that VUM “registers” itself with vCenter as a trusted service and requires authentication to the vCenter to complete this process.
How to script the Client installs
Once these two core services are installed, you’re well on the way to having the core management services installed. If you want to automate the installation of the vSphere Client and VUM plug-in, they are, in comparison, much easier.
start /wait \\192.168.3.254\software\VMware\vc5\ \vSphere-Client\VMware-viclient.exe /q /s /w /L1033 /v" /qr
start /wait \\192.168.3.254\software\VMware\vc5\ updateManager\VMware-UMClient.exe /q /s /w /L1033 /v" /qr
Other management tools can also be installed silently, including the vSphere CLI and vSphere PowerCLI tools.
192.168.3.254\software\VMware\vs5\VMware-vSphere-CLI-5.0.0-373086.exe /s /v/qn
192.168.3.254\software\VMware\vs5\VMware-PowerCLI-5.0.0-374833.exe /s /v/qn
Remember that with PowerCLI you must run the 32-bit version, so set your execution policy as appropriate with (for example) set-executionpolicy remotesigned
I know no reason for installing vCenter and its associated installs manually. I plan to create a process which automates the process of building a vSphere environment ready to be the platform for the cloud and virtual desktops with minimum steps.
Mike Laverick is a former VMware instructor with 17 years of experience in technologies such as Novell, Windows, Citrix and VMware. Since 2003, he has been involved with the VMware community. Laverick is a VMware forum moderator and member of the London VMware User Group. He is also the man behind the virtualisation website and blog RTFM Education, where he publishes free guides and utilities for VMware customers. Laverick received the VMware vExpert award in 2009, 2010 and 2011.
Since joining TechTarget as a contributor, Laverick has also found the time run a weekly podcast called the Chinwag and the Vendorwag. He helped found the Irish and Scottish VMware user groups and now speaks regularly at larger regional events organised by the global VMware user group in North America, EMEA and APAC. Laverick published several books on VMware Virtual Infrastructure 3, vSphere4, Site Recovery Manager and View.