APS Resource Management

In the platform, there are various resource components involved in the deployment of application services and products based on them, as well as the provisioning of the application resources for customers.

APS Type to Resource Type Mapping

digraph {
    fontname="Verdana";
    graph [compound=true splines=ortho ranksep=0.3 concentrate=true forcelabels=true bgcolor="gray95"];
    node [shape=box width=1.5 color="beige" style=filled fillcolor="beige" fontname="Verdana" fontsize=12];
    edge [fontname="Verdana" fontsize=10];

    subgraph cluster_app {
        bgcolor="snow3";
        color="none";
        fontsize = 20;
        label="APS application";

        ApsRefResources [peripheries=3 label="APS resources\n(for references)"];
        ApsTypes [peripheries=3 color="cadetblue1" fillcolor="cadetblue1" label="APS types"];
        ApsResources [peripheries=3 label="APS resources\n(owned by customer)"];
        AppPoint2 [shape="point" style="invisible" width=0.01];
        AppPoint1 [shape="point" style="invisible" width=0.01];

        ApsRefResources -> AppPoint1 [dir="back" style="dotted" xlabel="Deployment"];
        AppPoint1 -> ApsTypes [dir="none" style="dotted"];
        ApsTypes -> AppPoint2 [dir="none" style="dotted"];
        AppPoint2 -> ApsResources [style="dotted" xlabel="Provisioning"];
    }

    subgraph cluster_provider {
        bgcolor="snow3";
        color="none";
        fontsize = 20;
        label="Provider environment";

        ResTypeRefs [peripheries=3 label="Resource types\n(for references)"];
        subgraph cluster_rc_asr {
            label="Resource class";
            fontsize = 16;
            labelloc=b;

            ResClassAsr [label="Application\nService Reference"];
        }

        ResTypes [peripheries=3 color="cadetblue1" fillcolor="cadetblue1" label="Resource types"];

        subgraph cluster_rc_as {
            label="Resource class";
            fontsize = 16;
            labelloc=b;

            ResClassAs [color="cadetblue1" fillcolor="cadetblue1" label="Application\nService"];
        }

        subgraph cluster_st {
            bgcolor="cadetblue4";
            label="Service template";
            fontcolor="white";
            StResources [peripheries=3 color="cadetblue1" fillcolor="cadetblue1" label="Resource types\n(to be owned\nby customers)"];
            StResRefs [peripheries=3 label="Resource types\n(for references)"];
            Empty2 [style="invisible" label=""];
            Empty1 [style="invisible" label=""];

            StResRefs -> Empty1 -> StResources -> Empty2 [style="invisible" dir="none"];
        }

        ResTypeRefs -> ResClassAsr [dir="back"];
        ResClassAsr -> ResTypes [style="invisible" dir="none"];
        ResTypes -> ResClassAs [dir="back"];
        ResTypeRefs -> StResRefs [constraint=false];
        ResTypes -> StResources [constraint=false];

    }

    ApsRefResources -> ResTypeRefs [constraint=false color="cadetblue4" penwidth=5];
    ApsTypes -> ResTypes [constraint=false color="cadetblue4" penwidth=5];


    subgraph cluster_customer {
        bgcolor="snow3";
        color="none";
        fontsize = 20;
        label="Customer environment";

        subgraph cluster_c1 {
            bgcolor="cadetblue4";
            fontcolor="white";
            label="Customer #1\nSubscription #1";

            SbResRefs1 [peripheries=3 label="Resources\n(for references)"];
            SbResources1 [peripheries=3 color="cadetblue1" fillcolor="cadetblue1" label="Resources\n(owned by customer)"];
            SbResRefs1 -> SbResources1;
        }

        subgraph cluster_c2 {
            bgcolor="cadetblue4";
            fontcolor="white";
            label="Customer #5\nSubscription #5";

            SbResRefs2 [peripheries=3 label="Resources\n(for references)"];
            SbResources2 [peripheries=3 color="cadetblue1" fillcolor="cadetblue1" label="Resources\n(owned by customer)"];
            SbResRefs2 -> SbResources2;
        }
        Empty3 [style="invisible"];

        SbResources1 -> Empty3 -> SbResRefs2 [style="invisible" dir="none"];
    }

    StResRefs -> SbResRefs1  [ltail=cluster_st lhead=cluster_c1 constraint=false color="cadetblue4" penwidth=5];
    Empty2 -> SbResRefs2  [ltail=cluster_st lhead=cluster_c2 constraint=false color="cadetblue4" penwidth=5];
    SbResources2 -> ApsResources [constraint=false style="dotted" xlabel="Provisioning"];


}

Resource Types for APS Resources

APS application resources are split into two groups:

  • Reference application resources. These belong to the provider and are shared among all subscribers. The provider creates these resources from the respective APS types during application deployment. For example, every application has the application root APS resource representing the application instance. In addition, the provider can create a number of reference resources, such as offered configurations or simply offers, for example, Gold Mail Account, Silver Mail Account, and so on.

  • Individual application resources. These are created from the respective APS types individually for customers or service users during the provisioning process. They belong to customers.

APS types are resource schemas shipped inside the application APS package and used for instantiating APS resources, regardless of whether they are shared or individual.

In the provider environment, the following resource related components are used to offer services to customers:

  • Resource types representing reference APS resources. When creating these resource types, the provider selects the predefined Application Service Reference resource class and links these types with the respective reference APS resources.

  • Resource types representing individual APS resources. When creating these resource types, the provider selects the predefined Application Service resource class and links these resource types with the respective APS types.

  • Resource types representing special structures of APS resources called counters. They are not displayed in the above diagram but described in a separate section.

  • A service template is a container of the resources representing the application services and linked with respective resource types. The provider can set a limit on each of the resources inside a service template.

Subscription

When a customer subscribes to application services contained in a service template, the system creates a subscription instantiated from the selected service template with all its resources and limits. The customer subscription will present the following resource components:

  • Reference resources belong to the provider. The customer uses them as offered configurations.

  • Individual resources belong to the customer. Some or all of the individual resources can be linked with reference resources defining configuration of the individual resources.

Note

A limit on a reference resource in a subscription defines the limit on the number of individual resources based on the configuration offered by the reference resource.

Limits on individual resources define the limits on the total number or amount of these resources.

The system will not allow the customer to create a resource based on a reference resource if one of the above limits is reached in the subscription.

APS Resources

APS resources are application specific. They represent application services provided through APS applications. They may have any properties and relations with other resources provided either by the same or different application.

Every resource has its owner. In the account model considered here, the resource owner can be either the provider or a customer.

Consider the following set of examples of application resource models, starting with the simplest one.

Applications with Singular Service

Usually, cloud applications are multitenant, meaning for each subscription they create a tenant that may log in the cloud system and use application services remotely. On the customer side, there must be a resource that represents the tenant as well as the subscription that contains this resource. You may assign any name to this resource, for example, tenant, or management context, or subscription service.

../../../_images/resource-model1.png

The integration APS application declares two APS types to create APS resources:

  • In the provider context, there is the application root resource, called app on the diagram. This is a mandatory resource for each instance of an integrated application. All other resources are linked directly or indirectly with this resource. In the above diagram, the app resource has a link collection called tenants.

  • In the customer context, there is a subscription service (tenant) linked with the app resource through a single required link called app.

To provision such an application service, the provider needs to create the following two resource types and then add them to a service template.

../../../_images/resource-types1.png

A subscription created from the service template will contain the respective resources.

Parameterized Service

An application can provide various functionalities and resource usage to its tenants. For this purpose, the provider can offer various configurations for tenants. In the following example, the tenant/config APS type allows for the creation of a number of reference resources used to parameterize subscription services.

../../../_images/resource-model2.png

When purchasing a subscription, customers choose one of the tenant/config offers. Their subscription service will be linked with the chosen offer.

To provision such an application service, the provider needs to create the following resource types and then add them to a service template.

../../../_images/resource-types2.png

A subscription created from the service template will contain the respective resources.

Subservice

An application can provide various services, for example, mailboxes, calendar, and instant messaging. In the customer context, they look like subservices linked with the main subscription service. In the following example, the subscription may have a limited number of serviceA resources.

../../../_images/resource-model3.png

In this case, you may think of the subscription service as the management context used by customers to manage subservices. The services collection links the management context with all serviceA resources provisioned in the customer context.

To provision such an application service, the provider needs to create the following resource types and then add them to a service template.

../../../_images/resource-types3.png

A subscription created from the service template will contain the respective resources.

Parameterized Subservices

An application can enable the provider to parameterize subservices by offering various configurations. In the following example, the provider uses the service-A/config APS type to create various reference resources to offer various subservice configurations to customers.

../../../_images/resource-model4.png

When provisioning a service-A resource, a customer selects a service-A/config reference resource to assign its parameters to the new resource. The new service-A resource is linked with the selected service-A/config reference resource.

To provision such an application service, the provider needs to create the following resource types and then add them to a service template.

../../../_images/resource-types4.png

A subscription created from the service template will contain the respective resources.

Resource Counters

Resource Counting Mechanism

Once subscribed to application services, customers and their service users consume application resources, such as storage, network traffic, CPU power, and memory space. To count resource consumption, the subscription service must be able to activate counters as the resource structures.

../../../_images/resource-model5.png

The platform periodically wakes the APS controller to sync counters. Once some counters are active in a subscription, the APS controller will call the retrieve method of the subscription service to get the newest counters values and to update the respective objects in the database.

To provision the application service, the provider needs to create the following resource types and then add them to a service template.

../../../_images/resource-types5.png

A subscription created from the service template will contain the respective resources.

The provider can view and update the periodical process responsible for initiating resource usage collection in the platform task manager.

  1. In the provider control panel, navigate to Operations > Tasks.

  2. On the Periodic tab, find the “Synchronize resource usage for instances of APS applications” periodic task.

  3. Open it to perform one of available operations:

    • Run the task immediately by clicking Run.

    • Cancel the task by clicking Cancel Task.

    • Click Edit to change the period or start time as needed:

Note

The above operations are useful when testing an application to minimize the sync period and to run the task immediately.

Mapping Counters to Resource Types

A counter is a property of an APS resource implementing usually the counter structure of the abstract Resource APS type. A counter property allows creating resource types based on various Application Counter resource classes (depending on the measurement unit) as explained and demonstrated in the Resource Counters procedure guide. In the following example, a resource type is based on the Application Counter (unit) resource class and the UnitCounter property of the Tenant APS type.

../../../_images/counter-rt-st.png

The above-mentioned periodic task synchronizes the limit and usage properties of the counter so that the limit changed in the subscription will change the limit property in the counter, and the usage property in the counter will change the respective usage in the subscription.

../../../_images/st-subscription-counter.png

Note

When the APS controller sets a PUT request to the APS application connector to change the limit of a counter, the connector usually forwards this request to the respective integrated cloud application.