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 Reply

%d bloggers like this: