Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
61 lines (41 loc) · 1.24 KB

File metadata and controls

61 lines (41 loc) · 1.24 KB
Copy raw file
Download raw file
Outline
Edit and raw actions

Director Console debugging

SSH to the Director VM

For director version >= 266.x

sudo su
/var/vcap/jobs/director/bin/console

Potentially useful snippets:

List foreign keys for a table

Bosh::Director::Config.db.foreign_key_list(:instances)

Typical select

Bosh::Director::Config.db[:instances].where(variable_set_id: nil).first

Find first item in a table

Bosh::Director::Config.db[:schema_migrations].where(filename: "xxx").first

Consistent sort of applied migrations

Bosh::Director::Config.db[:schema_migrations].order(:filename).last

Manually record applied migration -- super dangerous.

Bosh::Director::Config.db[:schema_migrations] << {filename: "xxx"}

update first item in a table

Bosh::Director::Models::Instance.first.update(boostrap: false)

verify and delete disk reference

Bosh::Director::Models::PersistentDisk.where(disk_cid: "...").all
Bosh::Director::Models::PersistentDisk.where(disk_cid: "...").delete

download specific blob from blobstore with an ID

File.open("/tmp/my-temp-blob-file", 'wb') { |file| Bosh::Director::App.instance.blobstores.blobstore.get("some-blobstore-id", file) }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.