MySQL for PCF Errands

Warning: MySQL for PCF v2.5 is no longer supported because it has reached the End of General Support (EOGS) phase as defined by the Support Lifecycle Policy. To stay up to date with the latest software and security updates, upgrade to a supported version.

Page last updated:

This topic describes how to use the BOSH CLI to run service broker errands. Errands can manage service brokers and run mass operations on service instances created by brokers.

Run an Errand

To run an errand:

  1. Locate the BOSH deployment name for your MySQL service broker by running:

    bosh deployments
    
  2. Run an errand by running:

    bosh -d pivotal-mysql-GUID run-errand ERRAND-NAME
    

    Where:

    • pivotal-mysql-GUID is the BOSH deployment name for your MySQL service broker.
    • ERRAND-NAME is the name of the errand you want to run.

    For example:

    $ bosh -d pivotal-mysql-e3ddd36247fe5b923caf run-errand deregister-broker

find-deprecated-bindings

The find-deprecated-bindings errand lists apps and service keys that are deprecated or unsupported in PCF v2.5 because of either of the following:

  • They use IP addresses instead of DNS. This is unsupported in PCF v2.5.
  • They do not require TLS. This is deprecated in PCF v2.5. Pivotal recommends that operators configure bindings to require TLS. For how to require TLS, see Configure Security.

Before you upgrade to MySQL for PCF v2.5, you run the find-deprecated-bindings errand. The errand exits whether or not a deprecated or unsupported binding is found.

See below example of the errand output:

$ bosh -d pivotal-mysql-e3ddd36247fe5b923caf run-errand find-deprecated-bindings
Using environment '10.0.0.5' as client 'ops_manager'

Using deployment 'pivotal-mysql-e3ddd36247fe5b923caf'

Task 148

Task 148 | 02:42:08 | Preparing deployment: Preparing deployment (00:00:01)
Task 148 | 02:42:09 | Running errand: dedicated-mysql-broker/63f9ad1e-998e-451e-8c6e-f6211958f6fb (0) (00:00:03)
Task 148 | 02:42:12 | Fetching logs for dedicated-mysql-broker/63f9ad1e-998e-451e-8c6e-f6211958f6fb (0): Finding and packing log files (00:00:01)

Task 148 Started Tue Dec 18 02:42:08 UTC 2018
Task 148 Finished Tue Dec 18 02:42:13 UTC 2018
Task 148 Duration 00:00:05
Task 148 done

Instance   dedicated-mysql-broker/63f9ad1e-998e-451e-8c6e-f6211958f6fb
Exit Code  0
Stdout     +---------------------------+--------------------------------------+------------------------+--------------------------+--------------------+-------------------+-----------------------------+
           |          SERVICE          |             SERVICE GUI             |          ORG           |          SPACE           | APP OR SERVICE KEY |       TYPE        |           REASON            |
           +---------------------------+--------------------------------------+------------------------+--------------------------+--------------------+-------------------+-----------------------------+
           | tlsDB                     | a999db0b-176e-4ac8-8342-d72b338d1f0c | MYSQL-ORG-upgrade-test | MYSQL-SPACE-upgrade-test | user-cli           | ServiceKeyBinding | no tls                      |
           | tlsDB                     | a999db0b-176e-4ac8-8342-d72b338d1f0c | MYSQL-ORG-upgrade-test | MYSQL-SPACE-upgrade-test | user-cli           | ServiceKeyBinding | no dns: hostname="10.0.8.6" |
           | upgrade-outdated-instance | 34f26746-fb46-4f14-87bc-e1ddce26f340 | MYSQL-ORG-upgrade-test | MYSQL-SPACE-upgrade-test | cs-accept          | AppBinding        | no dns: hostname="10.0.8.5" |
           | tlsDB                     | a999db0b-176e-4ac8-8342-d72b338d1f0c | MYSQL-ORG-upgrade-test | MYSQL-SPACE-upgrade-test | cs-accept-tls      | AppBinding        | no dns: hostname="10.0.8.6" |
           +---------------------------+--------------------------------------+------------------------+--------------------------+--------------------+-------------------+-----------------------------+

For information about using this errand, see Check for Bindings with IP Addresses.

smoke-tests

This errand performs a test to validate that the service broker has been installed and configured correctly and can perform the basic functions of creating and removing service instances. If this errand runs successfully, MySQL for PCF is installed successfully. If it fails, see Deprecated Service Bindings Found to debug installation.

For example:
<pre class="terminal">$ bosh -d pivotal-mysql-e3ddd36247fe5b923caf run-errand smoke-tests
  run-errand find-deprecated-bindingsUsing deployment 'dedicated-mysql-broker'
  Task 5192168
  Task 5192168 | 15:24:19 | Preparing deployment: Preparing deployment (00:00:04)
  Task 5192168 | 15:24:23 | Running errand: dedicated-mysql-broker/425c9a28-6a8e-4a39-8785-c1a26a8095d3 (1) (00:11:33)
  Task 5192168 | 15:35:56 | Fetching logs for dedicated-mysql-broker/425c9a28-6a8e-4a39-8785-c1a26a8095d3 (1): Finding and packing log files (00:00:01)
  Task 5192168 Started  Wed Jan  8 15:24:19 UTC 2020
  Task 5192168 Finished Wed Jan  8 15:35:57 UTC 2020
  Task 5192168 Duration 00:11:38
  Task 5192168 done
  Instance   dedicated-mysql-broker/425c9a28-6a8e-4a39-8785-c1a26a8095d3
  Exit Code  0
  Stdout     Running Errand with plan: db-small
             Running Errand in org: dedicated-mysql-smoketests
             /var/vcap/packages/smoke-tests/bin /var/vcap/bosh
             Running Suite: Smoke Tests Suite
             ================================
             Random Seed: 1578497063
             Will run 1 of 1 specs
             • [SLOW TEST:623.171 seconds]
             Lifecycle
             /var/vcap/data/compile/smoke-tests/src/specs/smoke_tests/lifecycle_test.go:13
               binds the service instance to an app, and writes to and reads from database
               /var/vcap/data/compile/smoke-tests/src/specs/smoke_tests/lifecycle_test.go:34
             ------------------------------
             Ran 1 of 1 Specs in 692.140 seconds
             SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
             PASS
             /var/vcap/bosh
  Stderr     -
  1 errand(s)
  Succeeded</pre>

upgrade-all-service-instances

When you make changes to the plan configuration, you should upgrade all the MySQL for Pivotal Platform service instances to the latest version of the plan.

What the Errand Does

The upgrade-all-service-instances errand does the following:

  1. Collects all of the service instances that the on-demand broker has registered
  2. For each instance the errand does the following:
    1. Issues an upgrade command to the on-demand broker
    2. Regenerates the service instance manifest based on the latest configuration from the tile
    3. Deploys the new manifest for the service instance
    4. Waits for this operation to complete, then proceeds to the next instance
  3. Adds to a retry list any instances that have ongoing BOSH tasks at the time of upgrade
  4. Retries any instances in the retry list until all instances are upgraded

If any instance fails to upgrade, the errand fails immediately. This prevents systemic problems from spreading to the rest of your service instances.

How to Run the Errand

To run the errand:

  1. Do one of the following
    • Select the errand in the Ops Manager Installation Dashboard on the Review Pending Changes page and then click Apply Changes.
    • Run the following command:

      bosh -d DEPLOYMENT-NAME run-errand upgrade-all-service-instances

For more information, see Upgrading MySQL for PCF.

register-broker

The register-broker errand registers the broker with Cloud Controller and enables access to plans in the Marketplace. You should run this errand whenever the broker is re-deployed with new catalog metadata to update the Marketplace.

Plans with disabled service access are only visible to admin Cloud Foundry users. Non-admin Cloud Foundry users, including Org Managers and Space Managers, cannot see these plans.

What the Errand Does

The register-broker errand does the following:

  1. Registers the service broker with Cloud Controller.
  2. Enables service access for any plans that are enabled on the tile.
  3. Disables service access for any plans that are disabled on the tile.
  4. Does nothing for any plans that are set to manual on the tile.

How to Run the Errand

To run the errand:

  1. Run the following command:
    bosh -d DEPLOYMENT-NAME run-errand register-broker

delete-all-service-instances-and-deregister-broker

Ops Manager runs this errand only when deleting MySQL for PCF. Running this errand removes all service instances and their data.

Warning: This errand destroys all of the on-demand service instances and deregisters the broker from PCF. Use it with extreme caution.

This errand:

  1. Disables service access to the service offering for all orgs and spaces. The errand disables service access to ensure that new instances cannot be provisioned during the lifetime of the errand.
  2. Unbinds all apps from the service instances.
  3. Deletes all service instances sequentially. Each service instance deletion includes:
    1. Running any pre-delete errands.
    2. Deleting the BOSH deployment of the service instance.
    3. Checking for instance deletion failure, which results in the errand failing immediately.
  4. Determines whether any instances have been created while the errand was running. If new instances are detected, the errand returns an error. In this case, Pivotal recommends running the errand again.
  5. Deregisters the broker from Cloud Foundry.