Stop/Start a Service Instance
Currently a9s PostgreSQL is the only Data Service that supports the usage of the Stop/Start feature.
Trying to apply the information contained on this document to an a9s Data Service aside from the ones mentioned above can leave the Service Instances in an irrecuperable state.
The Stop/Start feature, which is currently in Beta, must be enabled by the Platform Operator in order to be used.
The Stop/Start feature allows for the removal of the VMs belonging to a Service Instance when necessary as well as adding them again later without losing any persistent data. This allows to save on infrastructure costs during periods when the Service Instance is not needed.
Use the Stop/Start Feature
There are two ways to use the Stop/Start feature: via the a9s Public API and via the a9s CF Plugin.
a9s Public API
The a9s Public API can be used to stop and startan a9s Service Instance. For more information on these endpoints, see API V1 Endpoints - Stop/Start documentation.
a9s CF Plugin
There is also an a9s CF Plugin available that can be used to stop and start a Service Instance via the CF CLI.
Install the a9s CF Plugin
The a9s CF Plugin can be downloaded from our public S3 bucket. The plugin is available for the following operating systems:
- Linux (sha256:68d3a24293c0b74fa2c91662beaa1c9effd215685c0709bbbf8f8be8018b799c)
- MacOS (sha256:4f69e9a55d89d8d125f56142e513d7233e7f2c25c47a430d02da60877796b568)
- Windows (sha256:38899d3e1301cfb3f0d28df72de025cd168600d215478725101bbe67263a1233)
Once downloaded, the binary file can be installed to the Cloud Foundry CLI with the following command:
cf install-plugin <source-path>/a9s-cf-plugin -f
The -f flag in the command is necessary because this plugin is not signed by Cloud Foundry. Therefore it is needed to
ignore the unsigned certificate when installing the a9s CF Plugin to the CF CLI.
Execute the following command to verify that the a9s CF Plugin was successfully installed:
cf a9s-version
1.0.0
Usage
There are 3 commands available in the a9s CF Plugin which are described in more detail below.
Stop
The stop command can be used to stop a Service Instance:
cf a9s-stop-service <my-service>
Are you sure you want to stop the service instance 'my-service'? [y/N]: y
stop in progress. Operation ID: 1234
More details on the available option can be found in the help text of the command:
cf a9s-stop-service -h
NAME:
a9s-stop-service - Stop a service instance via the a9s Public API
USAGE:
cf a9s-stop-service SERVICE_INSTANCE [--force] [--wait]
OPTIONS:
--force, -f Skip confirmation prompt
--wait, -w Wait for the stop operation to complete
Start
The start command can be used to stop a Service Instance:
cf a9s-start-service <my-service>
start in progress. Operation ID: 1234
More details on the available option can be found in the help text of the command:
cf a9s-start-service -h
NAME:
a9s-start-service - Start a service instance via the a9s Public API
USAGE:
cf a9s-start-service SERVICE_INSTANCE [--wait]
OPTIONS:
--wait, -w Wait for the start operation to complete
Status
The status command can be used to stop a Service Instance:
cf a9s-status <my-service>
State: provisioned
More details on the available option can be found in the help text of the command:
cf a9s-status -h
NAME:
a9s-status - Show service instance status via the a9s Public API
USAGE:
cf a9s-status SERVICE_INSTANCE [--json] [--details]
OPTIONS:
--details, -d Display detailed information
--json, -j Display raw JSON response
Expected Behavior
-
Any attempt to bind an application to a
stoppedService Instance, or to create a Service Key for it, will be rejected, as astoppedService Instance doesn’t count asprovisioned. -
Any attempt to unbind an application, or to delete a Service Key, from a
stoppedService Instance will be rejected, as astoppedService Instance doesn’t count asprovisioned. -
Any attempt to update a custom parameter for a
stoppedService Instance will be rejected, as astoppedService Instance doesn’t count asprovisioned. -
Any attempt to update the Service Plan for a
stoppedService Instance will be rejected, as astoppedService Instance doesn’t count asprovisioned. -
Only the data stored on the persistent disk is retained and available again after a restart; all data in the memory and on the ephemeral disk is lost when a Service Instance is
stopped. -
Calling the
startendpoint of the a9s Public API for a Service Instance in any state other thanstoppedwill not trigger a BOSH task and instead will get the following error message:Service Instance is currently in the state '<Service Instance's state> and not in 'stopped'. -
Calling the
stopendpoint of the a9s Public API for a Service Instance in any state other thanprovisionedwill not trigger a BOSH task and instead will get the following error message:Service Instance is currently in the state <Service Instance's state> and not in 'provisioned'.
Known Limitations
- The Application Developer cannot determine via the Cloud Foundry's cf CLI whether a Service Instance has been
stoppedor not. - If a binding, or a service key, for a Service Instance exists in CF, this Service Instance cannot be deleted as long
as it is
stopped.