Orphaned bosh deployment cannot be deleted with "bosh delete-deployment --force"
search cancel

Orphaned bosh deployment cannot be deleted with "bosh delete-deployment --force"

book

Article ID: 391422

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

There is a orphaned deployment that wanted to delete but bosh delete-deployment fails. Also the deployment does not have any manifest. 

ubuntu@opsmanager:~$ bosh -d service-instance_########-####-####-####-############ vms
Using environment '10.0.0.0' as client 'ops_manager'
Task 3013402. Done
Deployment 'service-instance_########-####-####-####-############'
Instance                                              Process State       AZ    IPs          VM CID                                                                      VM Type           Active  Stemcell
rabbitmq-server/########-####-####-####-############  unresponsive agent  null  10.0.0.0 agent_id:########-####-####-####-############;resource_group_name:#####  Standard_DS11_v2  true    bosh-azure-hyperv-ubuntu-xenial-go_agent/621.211
1 vms
Succeeded
ubuntu@opsmanager:~$ bosh -d service-instance_########-####-####-####-############ manifest
Using environment '10.0.0.0' as client 'ops_manager'
Using deployment 'service-instance_########-####-####-####-############'

Succeeded
ubuntu@opsmanager:~$ bosh delete-deployment -d service-instance_########-####-####-####-############ --force
Using environment '10.0.0.0' as client 'ops_manager'
Using deployment 'service-instance_########-####-####-####-############'
Continue? [yN]: y
Task 3013404
Task 3013404 | 21:50:21 | Deleting instances: rabbitmq-server/########-####-####-####-############ (0) (00:01:30)
                        L Error: Timed out sending 'list_disk' to instance: 'rabbitmq-server/########-####-####-####-############', agent-id: '########-####-####-####-############' after 45 seconds
Task 3013404 | 21:51:51 | Error: Timed out sending 'list_disk' to instance: 'rabbitmq-server/########-####-####-####-############', agent-id: '########-####-####-####-############' after 45 seconds
Task 3013404 Started  Wed Mar 19 21:50:21 UTC 2025
Task 3013404 Finished Wed Mar 19 21:51:51 UTC 2025
Task 3013404 Duration 00:01:30
Task 3013404 error
Deleting deployment 'service-instance_########-####-####-####-############':
  Expected task '3013404' to succeed but state is 'error'
Exit code 1

Cause

Since the roadblock for deleting the deployment is that bosh times out when attempting to delete the VM, if you first remove that VM, then you can delete the deployment. 

Resolution

You can remove the VM in one of 3 ways:

bosh -d service-instance_########-####-####-####-############ delete-vm <vm_cid>

 

The vm_cid can be found in the output of bosh vms

bosh -d service-instance_########-####-####-####-############  stop <vm_name> --hard

 

Note that the vm_name is the first field in the output of bosh vms or bosh instances, and it is not the same as the vm_cid.

Or you can delete the VM in the IaaS (vSphere, or public cloud) console. You would search for the VM in your IaaS console using the vm_cid.

It would be advisable to verify that the VM has been deleted by looking for it in the IaaS console, even if you use one of the bosh methods above successfully.

 

After you have removed the VM, then you can try to delete the deployment again:

bosh delete-deployment -d service-instance_########-####-####-####-############ --force