I have a customer approach me asking of how we can stop vCAC from deleting VMs after deployment has failed for debugging purposes. The default behavior of vCAC is to delete the VM after deployment failure even if that failure was just caused by Guest customization failure or by the Guest Agent execution failure. The problem when a deployment fail due to a Guest Customization failure or by Guest Agent execution failure and the VM get delete as the deployment fail, you are left with no in guest logs to trace the cause of the problem which explain the need for stopping vCAC from deleting VMs after VMs deployment failure for debugging/troubleshooting.
Luckily vCAC Proxy Agent can be configured not to delete VMs after deployment failure and send it to VRMDeleted folder instead of deleting it and it can be deleted manually after you finish your debugging. If you think you need to stop vCAC from deleting VMs from vCenter after deployment failure for troubleshooting or any other reason, then below is how to do just that.
A system administrator can modify proxy agent configuration settings, such as provisioning machine credentials and deletion policy for virtualization platforms, after installation. The proxy agent utility can be used to modify the initial configurations that are encrypted in the agent configuration file. The system administrator can also use the utility to change the machine deletion policy for virtualization platforms. The steps below document how to modify the deletion policy for virtualization platforms.
- Log in as a system administrator to the machine where you installed the agent.
- Open a Windows command console as administrator.
- Change to the agents installation directory, where agent_name is the directory that contains the proxy agent, which is also the name under which the agent was installed.
- cd Program Files (x86)\VMware\vCAC\Agents\agent_name
- View the current configuration settings by running the following command.
- .\DynamicOps.Vrm.VRMencrypt.exe VRMAgent.exe.config get
- Example Output:
- managementEndpointName: VCendpoint
- doDeletes: True
Below is the output screenshot from my lab environment.
- Note: doDeletes is the property we need to use in here. This property determines whether machines are deleted from vCenter Server when destroyed in vCloud Automation Center, or instead moved to the VRMDeleted folder.
- To change the doDeletes property, we use the set command as shown below:
- .\DynamicOps.Vrm.VRMencrypt.exe VRMAgent.exe.config set doDeletes false
- At last you will need to restart your proxy agent service by going to Start > Administrative Tools > Services. Remember your agent service will be called something like: vCloud Automation Center Agent – agentname service
Now every time a VM deployment fail after it was actually built, the VM will be sent to a folder called VRMDeleted in vCenter instead of being deleted as shown in the below screenshot
Hope you find this helpful debugging the cause of your deployment failure. Please note more information on this can be found in the vCloud Automation Center 6 Installation and configuration guide here.