This topic explains how to create and delete VMware Tanzu GemFire for Tanzu Application Service services instances.

Create a Service Instance

Run cf create-service p-cloudcache PLAN-NAME SERVICE-INSTANCE-NAME to create a service instance. Replace PLAN-NAME with the name from the list of available plans. Replace SERVICE-INSTANCE-NAME with a name of your choice. Use this name to refer to your service instance with other commands. Service instance names can include alpha-numeric characters, hyphens, and underscores.

$ cf create-service p-cloudcache extra-large my-cloudcache

Service instances are created asynchronously. Run the cf services command to view the current status of the service creation, and of other service instances in the current org and space:

$ cf services
Getting services in org my-org / space my-space as user...
OK

name            service        plan    bound apps   last operation
my-cloudcache   p-cloudcache   small                create in progress

When completed, the status changes from create in progress to create succeeded.

Provide Optional Parameters

You can create a customized service instance by passing optional parameters to cf create-service using the -c flag. The -c flag accepts a valid JSON object containing service-specific configuration parameters, provided either in-line or in a file.

The GemFire for Tanzu Application Service service broker supports the following parameters:

  • tls: A boolean, that when true, enables TLS for all communication within the cluster.
  • service_gateway: A boolean, that when true, causes the creation of a service gateway. The service instance must also use TLS for communication within the cluster.
  • num_servers: An integer that specifies the number of server instances in the cluster. The minimum value is 4. The maximum and default values are configured by the operator.
  • new_size_percentage: An integer that specifies the percentage of the heap to allocate to young generation. This value must be between 5 and 83. By default, the new size is 2 GB or 10% of heap, whichever is smaller.
  • distributed_system_id: An integer that provides a unique identifier for a cluster that participates in a WAN.
  • shared_write_access: A boolean, that when true, allows an app within a different space write access to the service instance when service-instance sharing is enabled.
  • pr_load_probe_class: A property that specifies the algorithm to be used by the server when rebalancing data. Supported values are:
    • org.apache.geode.internal.cache.partitioned.BucketCountLoadProbe
      Rebalance based on the total-num-buckets configuration and the number of members hosting the region.
    • org.apache.geode.internal.cache.partitioned.SizedBasedLoadProbe
      Rebalance based on the actual size of data in each member hosting the region. This is the default rebalancing algorithm.
  • advanced_configuration: A property that allows users to configure custom JVM options, Tanzu GemFire properties, credentials, and Resource Manager properties. This property is not recommended for general use. It is intended only for advanced users and support staff. See Advanced Service Instance Configuration for details.

This example enables TLS within the cluster:

$ cf create-service p-cloudcache small TLS-cluster -c '{"tls": true}'

This example creates a service gateway that is connected to the cluster:

$ cf create-service p-cloudcache small TLS-cluster -c '{"tls": true, “service_gateway”: true}'

This example creates the service with five service instances in the cluster:

$ cf create-service p-cloudcache small my-cloudcache -c '{"num_servers": 5}'

This example assigns the service a specific distributed system ID, which is important when restoring a WAN participant from backups:

$ cf create-service p-cloudcache small my-cloudcache -c '{"distributed_system_id": 2}'

This example creates a cluster that allows write access by an app in a different space when service-instance sharing is enabled.

$ cf create-service p-cloudcache small my-cloudcache -c '{"shared_write_access":true}'

Single-VM Plans

The Colocated Single-VM Plan is a type of service plan that is useful for development and testing. This example creates a Colocated Single-VM Plan service instance:

$ cf create-service p-cloudcache dev-plan my-dev-cloudcache

The plan provides a single locator and a single server colocated within a single VM. Because the VM is recycled when the service instance is updated or upgraded, all data within the region is lost upon update or upgrade.

When post-deploy scripts are enabled for Ops Manager, the service instance is created with a single sample region called example_partition_region. The region is of type PARTITION_REDUNDANT_HEAP_LRU, as described in Partitioned Region Types for Creating Regions on the Server.

If example_partition_region has not been created, it is probably because post-deploy scripts are not enabled for Ops Manager, as described in Configure a Co-located Single VM Plan.

Delete a Service Instance

You can delete service instances using the cf CLI. Before doing so, you must remove any existing service keys and app bindings.

  1. Run cf delete-service-key SERVICE-INSTANCE-NAME KEY-NAME to delete the service key.
  2. Run cf unbind-service APP-NAME SERVICE-INSTANCE-NAME to unbind your app from the service instance.
  3. Run cf delete-service SERVICE-INSTANCE-NAME to delete the service instance.
$ cf delete-service-key my-cloudcache my-service-key
$ cf unbind-service my-app my-cloudcache
$ cf delete-service my-cloudcache

Deletions are asynchronous. Run cf services to view the current status of the service instance deletion.

check-circle-line exclamation-circle-line close-line
Scroll to top icon