Cloud Service Broker: How to purge a service instance
search cancel

Cloud Service Broker: How to purge a service instance

book

Article ID: 297086

calendar_today

Updated On:

Products

Cloud Services Products

Issue/Introduction

From time to time it is necessary to manually remove a service instance from Cloud Service Broker. A service instance in Cloud Service Broker stores data in three place:

- The IaaS, for example AWS, GCP or Azure
- Cloud Service Broker - the Cloud Service Broker state database
- CloudFoundy - the Cloud Controller database

To completely remove a service instance, it must be removed from all three places.


Environment

Product Version: Other

Resolution

To remove a service instance from the IaaS, use the web console or the command line appropriate to the IaaS. Typically you can identify the resources because their names begins with "csb" and/or they have the service instance GUID as part of their name. You can determine a service instance GUID by running the command "cf service INSTANCE-NAME --guid" where INSTANCE-NAME is the name of the service instance. For example an AWS S3 bucket with service instance GUID "1c12e49e-d237-11ed-9f22-bb95563cd272" will be called "csb-1c12e49e-d237-11ed-9f22-bb95563cd272". Some service instances may have a number of associated resources in the IaaS such as subnets groups, security groups, parameter groups, etc... You can see the associations in the web console for the IaaS.

To remove a service instance from the CSB state database, connect to the broker app using "cf ssh". The app will typically be in the org "system" and space "cloud-service-broker-space". Log into the app with "cf ssh <app name>" and then run the command "app/cloud-service-broker purge <service instance id>". This will remove data about the service instance and all binding from the CSB database.

To remove a service instance from CloudFoundry, use the "cf purge-service-instance INSTANCE-NAME" command. This will remove the service instance from the CloudFoundry database without communication with the service broker. For more information, see https://cli.cloudfoundry.org/es-ES/v8/purge-service-instance.html