When running bosh vms, it may be observed that there is an instance of a VM missing. Usually an Apply Changes or bosh cck would recover this missing VM, but in this case these operations don't pick up on this.
Running bosh is --details instead shows that the VM is in a detatched state.
diego_cell/a26be528-b6f5-40d6-b4bf-3f184be93ac1 - detatched
Product Version: 2.10
In some instances it may be possible to force the instance out of the detached state by running bosh start on the instance:
bosh -d <DEPLOYMENT NAME> start <INSTANCE>/<GUID> --no-converge
In the event that the above does not work, the state may be updated manually in the database. To do this, we will use the BOSH director console:
/var/vcap/jobs/director/bin/console # Will result in a terminal similar to: irb(main):001:0>
Bosh::Director::Models::Instance.where(state: "detached").all.map{|n| "#{n.uuid} #{n.job} #{n.index}"} # Example output: > ["b87d02d7-54d6-4c9c-826f-f8b08937dd61 diego_cell 1", "fb4ff31a-a059-4c50-b330-0d2549258eba diego_cell 0"]
Bosh::Director::Models::Instance.where(state: "detached").update(state: "started")
Bosh::Director::Models::Instance.where(uuid: "<GUID>").first.update(state: "started")
Afterward, proceed with an Apply Changes or other BOSH operation as normal.