How to Delete a VM Disk Reference Using the BOSH and Director Console
search cancel

How to Delete a VM Disk Reference Using the BOSH and Director Console

book

Article ID: 293558

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

This article will explain how to fix the MySQL instance. We will delete the disk reference and replace it with a new blank one. 

 


Environment


Resolution

This was the process followed: 

  • Changed BOSH deployment to p-mysql and ran bosh cck and deleted the disk reference
  • Recorded the disk-id that BOSH is complaining about
  • Connected via SSH into the BOSH director (ssh vcap@<director-IP> password in the Operations Manager Director tile credentials section under VM Credentials)
  • Start the director console.  The method to access the director console depends on your version of Operations Manager
    • Operations Manager 2.1 or earlier
      • /var/vcap/jobs/director/bin/director_ctl console
    • Operations Manager 2.2 or later
      • /var/vcap/jobs/director/bin/console
  • Ran Bosh::Director::Models::PersistentDisk.where(disk_cid:"blah").all (Blah is swapped with the disk-id previously recorded)
  • Ran Bosh::Director::Models::PersistentDisk.where(disk_cid:"blah").first.update(active: false)
  • Ran Bosh::Director::Models::PersistentDisk.where(disk_cid:"blah").instance.persistent_disks
  • Ran Bosh::Director::Models::PersistentDisk.where(disk_cid:"blah").first.instance.persistent_disks
  • Ran Bosh::Director::Models::PersistentDisk.where(disk_cid:"blah").first.delete
  • Exited out of the SSH session
  • Ran bosh cck and it passed
  • Ran bosh deploy (with mysql targeted as deploy)
  • Ran bosh instances --details & bosh vms --ps and verified all was good