vRealize AutomationDuring the POC we did a demo of the default vRealize Automation lease/archive/delete-process which I discussed yesterday. After seeing this the customer is worried that virtual machines with or without an archive period configured get deleted during holiday periods. So their question is, ‘is it possible to keep vRealize Automation from deleting the virtual machines altogether or can we keep the virtual machines in vSphere’.

A colleague had a similar question. His customer wants to prevent deletion of virtual machines to perform debugging after the guest customization fails. The default behavior of vRealize Automation is to delete the virtual machines when for whatever reason the deployment fails.

no trashWe can achieve this by modifying the vRealize Automation Agent Service. By changing the ‘doDeletes‘ setting to FALSE, vRealize Automation removes the virtual machines from its management and move the virtual machines to the VRMDeleted folder. The result is that these virtual machines no longer show up in the vRealize Automation portal as a managed item but in vSphere you can find the in the VRMDeleted folder. 

To do this, go to the server on which you installed the Agent service, often this is the vRealize Automation IaaS Server, and modify the vRealize Automation Agent Service setting in the service’s executable configuration-file.

How to configure move to VRMDeleted folder

Follow these steps to modify the deletion policy for virtualization platforms:

    1. Log on to the server with the Agent service installed (vRealize Automation IaaS Server) with Administrator rights;
    2. Open a Windows command console as Administrator;
    3. Go to the installation directory (C:\Program Files (x86)\VMware\vCAC\Agents\);
    4. Go to the folder where the name of the agent is equal to the name of the folder that contains the agent;
      In my case this is ‘vSphereAgent
    5. Check the current configuration settings by running the following command.
      ‘ .\DynamicOps.Vrm.VRMencrypt.exe VRMAgent.exe.config get
      The output looks like this:VRMDeleted
    6. To change the doDeletes property, we use the set command as shown below:
      .\DynamicOps.Vrm.VRMencrypt.exe VRMAgent.exe.config set doDeletes FALSE
      If the syntax is right there should be no output.
    7. Now restart the vRealize Automation Agent Service (although it still has its old name).
      In my case the service is named ‘VMware vCloud Automation Center Agent – vSphereAgent‘.
    8. If you want to change the configuration back to its default setting (TRUE), use this command:
      .\DynamicOps.Vrm.VRMencrypt.exe VRMAgent.exe.config set doDeletes TRUE
      If the syntax is right there should be no output.


NOTE: When we used this in combination with NSX, the archival of a multi-tier application with NSX logical switches, edge and load balancers to the VRMDeleted folder, prevented the deletion of the logical switches. This was due to the fact that the virtual wires to the logical switches were still in use due to the archival of the virtual machines instead of a deletion.

Other articles in the series vRealize Automation: