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.
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:
- Log on to the server with the Agent service installed (vRealize Automation IaaS Server) with Administrator rights;
- Open a Windows command console as Administrator;
- Go to the installation directory (C:\Program Files (x86)\VMware\vCAC\Agents\);
- 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‘
- Check the current configuration settings by running the following command.
‘ .\DynamicOps.Vrm.VRMencrypt.exe VRMAgent.exe.config get‘
The output looks like this: - 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.
- 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‘.
- 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.
