Skip to content

Conversation

@mariash
Copy link
Member

@mariash mariash commented Dec 15, 2025

What is this change about?

This PR adds support for dynamically managed disks.

The following API endpoints are added for dynamic disk management:

  • POST /dynamic_disks/provide
  • POST /dynamic_disks/:disk_name/detach
  • DELETE /dynamic_disks/:disk_name

The following corresponding jobs were added:

  • ProvideDynamicDisk - creates disk in the cloud if it doesn't exist, saves record in dynamic_disks database table and attaches it to VM, calls add_dynamic_disk agent method
  • DetachDynamicDisk - detaches disk from VM, calls remove_dynamic_disk agent method
  • DeleteDynamicDisk - deletes disk in the cloud and from the database.

These operations are idempotent.

The implementation also introduces:

  • New database migration adds dynamic_disks table

  • VM lock for VM cloud operations - attach disk, detach disk, reboot VM and delete VM to make sure only 1 operation is executed per VM.

  • New UAA scopes for dynamic disk operations introduced:

    • bosh.dynamic_disks.update (provide/detach)
    • bosh.dynamic_disks.delete (delete)
    • included in Director admin scopes
  • Dynamic disks are deleted when deployment is deleted

  • Dedicated dynamic disk workers and queue (configurable via a new dynamic_disks_workers Director property; when > 0, a separate worker process is started and drain behavior is updated accordingly).

Please provide contextual information.

What tests have you run against this PR?

  • bundle exec rake spec
  • manual deploy of updated bosh release, updating CF and using dynamic disks feature.

How should this change be described in bosh release notes?

Add support for dynamic disks

Does this PR introduce a breaking change?

No, this PR only adds new functionality.

Tag your pair, your PM, and/or team!

@Alphasite @mkocher @cppforlife

Alphasite and others added 7 commits December 15, 2025 22:46
* Add database migration for dynamic_disks table
* Handle NATS request to provide dynamic disk
* Attach disk via CPI, save disk info in the database

Co-authored-by: Maria Shaldybin <maria.shaldybin@broadcom.com>
* Handle NATS API request to delete dynamic disk
* Send CPI request to delete disk
* Remove disk from dynamic_disks table

Signed-off-by: Nishad Mathur <nishad.mathur@broadcom.com>
Co-authored-by: Nishad Mathur <nishad.mathur@broadcom.com>
* Handle NATS request to detach dynamic disk
* Send CPI request to detach disk
* Update disk in the database

Signed-off-by: Maria Shaldybin <maria.shaldybin@broadcom.com>
Co-authored-by: Maria Shaldybin <maria.shaldybin@broadcom.com>
Signed-off-by: Maria Shaldybin <maria.shaldybin@broadcom.com>
Co-authored-by: Maria Shaldybin <maria.shaldybin@broadcom.com>
The following endpoints were added:

/dynamic_disks/provide
/dynamic_disks/detach
/dynamic_disks/delete

Remove all NATS dynamic disks related code
* bosh.dynamic_disks.update allows to create, attach and detach dynamic
  disks
* bosh.dynamic_disks.delete allows to delete dynamic disks
* bosh director admin scopes allow update and delete dynamic disks
* Change dynamic disks jobs to be in dynamic_disks queue
* Add dynamic_disks_workers property to director
* When dynamic_disks_workers is greater than 0, start separate
  dynamic_disks_worker process
* Update drain to drain dynamic_disks workers
@mariash mariash force-pushed the dynamic-disks-squashed branch from 70633ac to b540264 Compare December 16, 2025 00:13
@rkoster
Copy link
Contributor

rkoster commented Dec 18, 2025

As discussed during the FI working group meeting, a change like this especially if it is gonna be used by something like diego needs an RFC. For more information about the RFC process please look here: https://github.com/cloudfoundry/community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants