Reset VMware Auto Deploy Database to default

One of the things that the VMware Auto Deploy Database contains is the ESX Images that are uploaded and related to the DeployRules that are created. For instance, if I add an ESXi Image to the software depot and create a new DeployRule using the following commands:

Add-EsxSoftwareDepot "VMware-ESXi-6.0.0.update01-3380124.x86_64-Dell_Customized-offline-bundle-A04.zip"
Get-EsxImageProfile | ft -autosize 
New-DeployRule -Name "Cluster01" -Item "Dell-ESXi-6.0U1-3380124-A04"  -Pattern "model=PowerEdge M630"

The result is that the Dell-ESXi-6.0U1-3380124-A04 Image is uploaded to the Auto Deploy Database:

Downloading lpfc 10.6.126.0-1OEM.600.0.0.2159203
Download finished, uploading to AutoDeploy...
Upload finished.
Downloading sata-ata-piix 2.12-10vmw.600.0.0.2494585
Download finished, uploading to AutoDeploy...
….

While testing different scenario’s within Auto Deploy I came to a point in which wanted to reset the Database to be totally clean again. VMware has got an KB article in which they describe how to clean the database. The article states the following:

vSphere Auto Deploy utilizes a database to store information about hosts. It is possible that the Auto Deploy database may need maintenance. SQLite is the tool of choice for performing these activities. By default, SQLite comes with the vCenter Server Appliance only. However, the SQLite shell is a free application and is available for use with Windows at http://sqlite.org/download.html.

However, this is only applicable to vCenter 5.5. vCenter 6 Appliance (VCSA) does not have this SQLite tool, only an empty directory with sqlite in the name.

Below steps can be walked through to get the Auto Deploy database to become completely clean on a vCenter 6 Appliance, and need to be executed on the VCSA itself with Shell enabled:

  • Stop the Auto Deploy Service: service-control –stop vmware-rbd-watchdog
  • Unregister Auto Deploy from vCenter: autodeploy-register -U -a <vCenter IP>
  • Rename the Auto Deploy DB: mv /var/lib/rbd/db db.backup
  • Start the Auto Deploy Service, this creates a new blank DB: service-control –start vmware-rbd-watchdog
  • Stop the Auto Deploy Service: service-control –stop vmware-rbd-watchdog
  • Register Auto Deploy to vCenter again: autodeploy-register -R -a <vCenter IP> –user=<user> –password=<password>
  • Start the Auto Deploy Service: service-control –start vmware-rbd-watchdog

And your ready to go with a brand new Auto Deploy DB file.

Leave a comment

1 Comment

  1. Ionuţ-Dan Nica

     /  June 19, 2019

    I have recently hand a need for this on 6.7 U1, and I found a few things are slightly different.

    It seems there are now multiple backups for the database. Also there seem to be multiple files in that folder, so I was unsure which one to delete.
    While reading the syntax of autodeploy-register tool, they claimed it was cleaning up the configuration. That being said, command that worked for me were:

    service-control –stop ‘vmware-rbd-watchdog’

    autodeploy-register -U -a ‘somehost.local’ \
    -u ‘administrator@vsphere.local’ \
    -w ‘changeme’
    service-control –start ‘vmware-rbd-watchdog’

    service-control –-stop ‘vmware-rbd-watchdog’
    autodeploy-register -R -a ‘somehost.local’ \
    -u ‘administrator@vsphere.local’ \
    -w ‘changeme’
    service-control –-start ‘vmware-rbd-watchdog’

    This did not clear the “software depot” section in the Auto-Deploy GUI, I did that manually. I suspect that is part of the image builder construct, and I am not sure if a similar tool to auto-deploy exists.

Leave a Reply

%d bloggers like this: