This topic is a comprehensive guide for using Tanzu Cloud Service Broker for GCP if you have service instances that belong to deactivated plans. It will:
This section provides a concise summary of the commands and steps required for detecting orphaned service instances and database maintenance in the Tanzu Cloud Service Broker for GCP (CSB) and Cloud Foundry environments.
Install the upgrade-all-services
CLI plug-in by running:
cf install-plugin -r CF-Community "UpgradeAllServices"
Check for orphaned instances by using the plug-in. Run this command to identify instances linked to deactivated plans:
cf upgrade-all-services <broker_name> -check-deactivated-plans
Review logs: Review the output the plug-in to identify any instances that require attention.
If there are any service instances belonging to deactivated plans, it is essential to resolve these before attempting further upgrades of the Cloud Service Broker for GCP. For more information, see strategies for handling orphaned instances.
In the context of the CSB for GCP and Cloud Foundry environments, it’s essential to understand what constitutes orphaned service instances, why they occur, and the best practices for managing them.
When the Cloud Service Broker for GCP is upgraded or configuration changes are made to plans, check for orphaned service instances. For more information, see detecting orphaned service instances.
This section provides guidance on identifying service instances that have become orphaned in CSB for GCP and Cloud Foundry environments. Addressing these instances is crucial for maintaining security, manageability, upgradeability, and agility.
Using CLI tools: Use Cloud Foundry CLI tools to identify orphaned instances.
upgrade-all-services
plug-in - Flag -check-deactivated-plans
: This flag can be used to check for instances linked to deactivated plans.Plug-in Installation: To further clarify the installation of the plug-in, here is a code example:
# Example code to demonstrate plugin installation
cf install-plugin -r CF-Community "UpgradeAllServices"
Example of execution: To further clarify the use of the plug-in, here is a code example:
# Example code to demonstrate plugin usage
cf upgrade-all-services <broker_name> -check-deactivated-plans
Example of log: To further clarify the use of the plug-in, here is an execution example:
✓ cf upgrade-all-services csb-broker-dev -check-deactivated-plans
2024-01-16T14:34:43Z: discovering service instances for broker: csb-broker-dev
2024-01-16T14:34:43Z: skipping instance: "bucket-dev" guid: "1fe84e95-21c0-4acd-9bd9-6f2796971e46" Deactivated Plan: "default" Offering: "csb-google-storage-bucket" Offering guid: "837f5ff6-5765-44a0-8b78-d7e3ebc8d428" Upgrade Available: false Last Operation Type: "create" State: "succeeded"
upgrade-all-services plugin failed: discovered deactivated plans associated with instances. Review the log to collect information and restore the deactivated plans or create user provided services
Section 3 outlines the steps and strategies necessary for effectively managing and resolving issues related to orphaned service instances in CSB for GCP and Cloud Foundry environments.
If an orphaned service instance was created with the current version of the Cloud Service Broker for GCP, you can resolve it by doing one of the following:
Move to a new plan: when a service instance belongs to a deactivated plan, you can update the service instance to be associated with a valid plan. First, identify a valid plan for the service instance, then issue a command to update the plan. Changing a plan may update the service instance properties to match the default properties of the new plan.
cf update-service SERVICE-INSTANCE-NAME -p NEW-PLAN-NAME
Where: - SERVICE-INSTANCE-NAME
is the name of the service instance. - NEW-PLAN-NAME
is the name of the valid plan that you have chosen.
If an orphaned service instance was created with a previous version of the Cloud Service Broker for GCP, it is not possible to resume management of the service instance with a later version of the Cloud Service Broker for GCP. In such cases, your options include:
Transitioning to a user-provided service instance: You can keep the service instance in GCP, but it will no longer be managed by the Cloud Service Broker for GCP. Instead, it becomes a user-provided service instance.
cf create-user-provided-service
command to create a new service instance with the credentials.cf purge-service-instance
command.Remove the service instance: You can remove the service instance. To do this:
cf purge-service-instance
command.cf ssh <app name>
and then run the command app/cloud-service-broker purge <service instance id>
. This removes data about the service instance and all binding from the Cloud Service Broker for GCP database.We have addressed the crucial aspects of managing orphaned service instances within the Tanzu Cloud Service Broker for GCP and Cloud Foundry environments. The key takeaways include:
UpgradeAllServices
plug-in with the -check-deactivated-plans
flag.Managing orphaned service instances is an essential aspect of maintaining a secure, agile, and manageable cloud environment. By following these strategies and guidelines, you can ensure that your Cloud Foundry environments remain robust and responsive to changing needs and potential security risks.