Pivotal Knowledge Base


How to Manually Delete a VM Reference from Bosh Director Database


Pivotal Cloud Foundry (PCF) Version 1.9


There is a known issue on PCF Version 1.9 where you are unable to delete virtual machine (VM) reference regardless of:

  • bosh delete vm executing successfully but running Bosh VMs after still includes the deleted vm
  • bosh vms shows a vm is failing but bosh cck is unable to detect the failing VM
  • Delete or turn off the vm on IaaS then running bosh cck is still unable to detect the failing vm


This is a known issue on 1.9 and was fixed on a 1.11+ release.


Here are the troubleshooting steps to resolve this issue:

  1. ssh into director VM
  2. sudo su
  3. /var/vcap/jobs/director/bin/director_ctl console to connect to director console
  4. Get the ID of the VM you wish to delete by using bosh instances. The ID should be under instance column. For example, vm cloud_controller/0c6ecf2f-fc70-4afb-b62c-2c76d9947cf0. The id should be 0c6ecf2f-fc70-4afb-b62c-2c76d9947cf0
  5. Run the command Bosh::Director::Models::Instance[uuid: "0c6ecf2f-fc70-4afb-b62c-2c76d9947cf0“]
  6. Get the instance by running the command instance = Bosh::Director::Models::Instance[uuid: "0c6ecf2f-fc70-4afb-b62c-2c76d9947cf0”]
  7. Verify if you got the correct instance by checking the vm cid using the command instance.vm_cid 
  8. This command should delete vm reference instance.update(vm_cid: nil, agent_id: nil, trusted_certs_sha1: nil, credentials: nil)



Powered by Zendesk