LATEST VERSION: 0.16.1 - CHANGELOG

How On-Demand Services Process Commands

These sequence diagrams in this topic show how an on-demand service sets up and maintains service instances, indicating which tasks are undertaken by the on-demand broker (ODB) and which require interaction with the Service Adapter.

Register Service Broker with Cloud Foundry

sequenceDiagram User->>Cloud Controller:cf create-service-broker Cloud Controller->>On Demand Broker:GET catalog On Demand Broker->>Cloud Controller:catalog Cloud Controller->>User:OK

Create Service Instance

Note that there are two ways this can fail: synchronously and asynchronously. When it fails synchronously, the Cloud Controller will subsequently delete the service according to its orphan mitigation strategy. In the case when it fails asynchronously (e.g. while BOSH deploys the service instance), the Cloud Controller won’t issue a delete request.

sequenceDiagram User->> Cloud Controller: cf create-service Cloud Controller->> On Demand Broker: POST instance (provision) On Demand Broker->>Service Adapter: generate-manifest Service Adapter->>On Demand Broker: manifest On Demand Broker->>BOSH: deploy BOSH->>On Demand Broker: accepted On Demand Broker->>Cloud Controller: accepted Cloud Controller->>User: create in progress loop until bosh task is complete Cloud Controller->>On Demand Broker: GET last operation On Demand Broker->>BOSH: GET deploy task BOSH->>On Demand Broker: task in progress On Demand Broker->>Cloud Controller: create in progress end Cloud Controller->>On Demand Broker: GET last operation On Demand Broker->>BOSH: GET task BOSH->>On Demand Broker: task done On Demand Broker->>Cloud Controller: create succeeded User->>Cloud Controller:cf service Cloud Controller->>User: create succeeded

Delete Service Instance

In the delete service workflow the service adapter is not invoked.

sequenceDiagram User->>Cloud Controller:cf delete-service Cloud Controller->>On Demand Broker:DELETE instance On Demand Broker->>BOSH:delete deployment BOSH->>On Demand Broker:accepted On Demand Broker->>Cloud Controller:accepted Cloud Controller->>User: delete in progress loop until bosh task is complete Cloud Controller->>On Demand Broker: GET last operation On Demand Broker->>BOSH: GET task BOSH->>On Demand Broker: task in progress On Demand Broker->>Cloud Controller: delete in progress end Cloud Controller->>On Demand Broker: GET last operation On Demand Broker->>BOSH: GET task BOSH->>On Demand Broker: task done On Demand Broker->>Cloud Controller: delete succeeded User->>Cloud Controller:cf service Cloud Controller->>User: not found

Create/Update Service Instance with Post-Deploy Errand

ODB will not report create/update succeeded to Cloud Foundry until both the deployment and post-deploy errand have completed successfully.

sequenceDiagram User->> Cloud Controller: cf create-service Cloud Controller->> On Demand Broker: POST instance (create) On Demand Broker->>Service Adapter: generate-manifest Service Adapter->>On Demand Broker: manifest On Demand Broker->>BOSH: deploy BOSH->>On Demand Broker: accepted On Demand Broker->>Cloud Controller: accepted Cloud Controller->>User: create in progress loop until bosh task is complete Cloud Controller->>On Demand Broker: GET last operation On Demand Broker->>BOSH: GET deploy task BOSH->>On Demand Broker: task in progress On Demand Broker->>Cloud Controller: create in progress end Cloud Controller->>On Demand Broker: GET last operation On Demand Broker->>BOSH: GET task BOSH->>On Demand Broker: task done On Demand Broker->>BOSH: run post-deploy errand BOSH->>On Demand Broker: accepted loop until bosh task errand is complete Cloud Controller->>On Demand Broker:GET last operation On Demand Broker->>BOSH:GET errand task BOSH->>On Demand Broker:task in progress On Demand Broker->>Cloud Controller:create in progress end Cloud Controller->>On Demand Broker:GET last operation On Demand Broker->>BOSH:GET errand task BOSH->>On Demand Broker:task done On Demand Broker->>Cloud Controller:create succeeded User->>Cloud Controller:cf service Cloud Controller->>User: create succeeded

Delete Service Instance with Pre-Delete Errand

ODB will not report delete succeeded to Cloud Foundry until both the pre-delete errand and delete deployment have completed successfully.

sequenceDiagram User->>Cloud Controller:cf delete-service Cloud Controller->>On Demand Broker:DELETE instance On Demand Broker->>BOSH:run pre-delete errand BOSH->>On Demand Broker:accepted On Demand Broker->>Cloud Controller:accepted Cloud Controller->>User: delete in progress loop until errand bosh task is complete Cloud Controller->>On Demand Broker:GET last operation On Demand Broker->>BOSH:GET errand task BOSH->>On Demand Broker:task in progress On Demand Broker->>Cloud Controller:delete in progress end Cloud Controller->>On Demand Broker:GET last operation On Demand Broker->>BOSH:GET errand task BOSH->>On Demand Broker:task done On Demand Broker->>BOSH:delete deployment BOSH->>On Demand Broker:accepted loop until delete deployment bosh task is complete Cloud Controller->>On Demand Broker: GET last operation On Demand Broker->>BOSH: GET delete deployment task BOSH->>On Demand Broker: task in progress On Demand Broker->>Cloud Controller: delete in progress end Cloud Controller->>On Demand Broker: GET last operation On Demand Broker->>BOSH: GET delete deployment task BOSH->>On Demand Broker: task done On Demand Broker->>Cloud Controller: delete succeeded User->>Cloud Controller:cf service Cloud Controller->>User: not found

Update Service Instance

Updates can only proceed if the existing service instance is up-to-date. ODB calls generate-manifest on service adapter to determine whether there are any pending changes for the instance.

When There Are Pending Changes

sequenceDiagram User->> Cloud Foundry: cf update-service -c ’{“some”:“config”}’ Cloud Foundry->> ODB: PATCH instance (update) ODB->>BOSH:GET manifest BOSH->>ODB:previous manifest ODB->>Service Adapter: generate-manifest (without request parameters) Service Adapter->>ODB: manifest ODB->>Cloud Foundry: update failed, pending changes detected Cloud Foundry->>User: update failed, pending changes detected

When There Are No Pending Changes

The manifest from the second call to generate-manifest is deployed.

sequenceDiagram User->> Cloud Controller: cf update-service -c ’{“some”:“config”}’ Cloud Controller->> On Demand Broker: PATCH instance (update) On Demand Broker->>BOSH:GET manifest BOSH->>On Demand Broker:previous manifest On Demand Broker->>Service Adapter: generate-manifest (without request parameters) Service Adapter->>On Demand Broker: manifest On Demand Broker->>Service Adapter: generate-manifest (with request parameters) Service Adapter->>On Demand Broker: manifest On Demand Broker->>BOSH: deploy BOSH->>On Demand Broker: accepted On Demand Broker->>Cloud Controller: accepted Cloud Controller->>User: update in progress loop until bosh task is complete Cloud Controller->>On Demand Broker:GET last operation On Demand Broker->>BOSH:GET task BOSH->>On Demand Broker:task in progress On Demand Broker->>Cloud Controller:update in progress end Cloud Controller->>On Demand Broker:GET last operation On Demand Broker->>BOSH:GET task BOSH->>On Demand Broker:task done On Demand Broker->>Cloud Controller:update succeeded User->>Cloud Controller: cf service Cloud Controller->>User: update succeeded

Bind

sequenceDiagram User->>Cloud Controller:cf bind-service Cloud Controller->>On Demand Broker:PUT binding On Demand Broker->>Service Adapter:create-binding Service Adapter->>On Demand Broker:binding credentials On Demand Broker->>Cloud Controller:binding credentials Cloud Controller->>User:OK

Unbind

sequenceDiagram User->>Cloud Controller:cf unbind-service Cloud Controller->>On Demand Broker:DELETE binding On Demand Broker->>Service Adapter:delete-binding Service Adapter->>On Demand Broker:exit 0 On Demand Broker->>Cloud Controller:OK Cloud Controller->>User:OK

Upgrade All Service Instances

ODB provides BOSH errand to upgrade all the instances managed by the broker. This can also be used in the scenario when a plan changes; this errand will update all instances that implement the plan with the new plan definition.

sequenceDiagram Operator->>Upgrade Errand:bosh run errand upgrade-all-service-instances Upgrade Errand->>Cloud Controller:GET instances Cloud Controller->>Upgrade Errand:instances loop for all instances Upgrade Errand->>On Demand Broker: PATCH instance (upgrade) On Demand Broker->>Service Adapter: generate-manifest Service Adapter->>On Demand Broker: manifest On Demand Broker->>BOSH: deploy BOSH->>On Demand Broker: accepted On Demand Broker->>Upgrade Errand: accepted Note over Upgrade Errand,BOSH: Upgrade Errand polls On Demand Broker for last operation until complete end Upgrade Errand->>Operator:completed successfully

Delete All Service Instances

ODB provides BOSH errand to delete all the instances managed by the broker.

sequenceDiagram Operator->>Delete Errand:bosh run errand delete-all-service-instances Delete Errand->>CF:GET instances CF->>Delete Errand:instances loop for all instances Delete Errand->>CF:GET bindings CF->>Delete Errand:bindings loop for all bindings Delete Errand->>CF:cf unbind-service CF->>ODB: DELETE binding ODB->>Service Adapter:delete-binding Service Adapter->>ODB:exit code 0 ODB->>CF:OK CF->>Delete Errand:OK end Delete Errand->>CF:GET service keys CF->>Delete Errand:service keys loop for all service keys Delete Errand->>CF:cf delete-service-key CF->>ODB: DELETE binding ODB->>Service Adapter:delete-binding Service Adapter->>ODB:exit code 0 ODB->>CF:OK CF->>Delete Errand:OK end Delete Errand->>CF:cf delete-service CF->>ODB:DELETE instance ODB->>BOSH:delete deployment BOSH->>ODB:accepted ODB->>CF:accepted CF->>Delete Errand:accepted loop until DELETE completes Delete Errand->>CF:GET instance CF->>Delete Errand:delete instance in progress Note over CF,BOSH: CF asynchronously polls ODB, which in turn polls BOSH for last operation status end Delete Errand->>CF:GET instance CF->>Delete Errand:instance not found end Delete Errand->>Operator:completed successfully
Create a pull request or raise an issue on the source for this page in GitHub