Starting with Tanzu for MySQL on Cloud Foundry 2.8, you can upgrade MySQL service instances individually. This is usually done with the command cf upgrade-service SERVICE_INSTANCE
However, in some scenarios, the above command returns: "No upgrade available". This happens in the event that there is no change made to the actual plan config, but you may still want to upgrade individual service instances. (For example, a cert rotation or stemcell change in which you want to upgrade instances one by one).
The following are the steps to upgrade a single service instance:
$ cf service <service> --guid 4378b86e-62a6-4858-8337-195c2af366bc
$ bosh -d <pivotal-mysql-deployment> ssh $ sudo -i $ egrep "username|password" /var/vcap/jobs/broker/config/broker.yml username: broker password: <password>
$ curl -k -u broker:<password> https://localhost:8080/mgmt/service_instances
[{"service_instance_id":"7c48e439-cc1d-4a12-ba59-5043f24e909b","plan_id":"07cf3296-b8e3-4c6b-8d74-b11a89599627"},{"service_instance_id":"4378b86e-62a6-4858-8337-195c2af366bc","plan_id":"07cf3296-b8e3-4c6b-8d74-b11a89599627"}]
$ curl -k -vv -X PATCH -u broker:<password> https://localhost:8080/mgmt/service_instances/4378b86e-62a6-4858-8337-195c2af366bc?operation_type=upgrade -d '{ "plan_id": "07cf3296-b8e3-4c6b-8d74-b11a89599627" }'
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
* Server auth using Basic with user 'broker'
> PATCH /mgmt/service_instances/4378b86e-62a6-4858-8337-195c2af366bc?operation_type=upgrade HTTP/1.1
> Host: localhost:8080
> Authorization: Basic YnJva2VyOmJ6MmFRdzd6bk9ja2ZMZ0RlRzRqajFwY2VkZFgxSi1C
> User-Agent: curl/7.47.0
> Accept: */*
> Content-Length: 53
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 53 out of 53 bytes
< HTTP/1.1 202 Accepted
< Date: Tue, 12 May 2020 19:25:46 GMT
< Content-Length: 144
< Content-Type: text/plain; charset=utf-8
<
{"BoshTaskID":6564,"BoshContextID":"cede1fba-7986-42c9-9515-3796d189f638","OperationType":"upgrade","PostDeployErrand":{},"PreDeleteErrand":{}}
* Connection #0 to host localhost left intact
This gives you the BoshTaskID, which you can monitor with bosh task <id>. After the associated BOSH task completes, the service instance should be upgraded.