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>
- Once in the terminal, retrieve the list of instances in a detached state:
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"]
- The output will retrieve a comma separated list of instance GUID, associate job name, and the instance index
- Verify that the list of GUIDs returned matches the expected instances that are to be updated
- If all of the GUIDs match, proceed with the following to update all detached instances:
Bosh::Director::Models::Instance.where(state: "detached").update(state: "started")
- If there are GUIDs that do not match the expected instances, each can be updated individually by replacing <GUID> in the following with the desired GUID:
Bosh::Director::Models::Instance.where(uuid: "<GUID>").first.update(state: "started")
Afterward, proceed with an Apply Changes or other BOSH operation as normal.