Previous topic

APS Widgets

Next topic

Application Provisioning

Last updated 20-Dec-2016

Application Deployment


When testing and debugging APS packages on a demo Odin Service Automation system, you can enable the APS development mode that affects the system in the following way:

  • The system removes the restriction on updating an APS package by another package that has the same application ID.
  • Some of APS related screens will not be cached in web browsers. This allows the developers to see effect of script changes at instance. At the same time, it may delay screen rendering.
  • Operations Automation log will store more details on APS operations.

You can enable this mode on your demo system by these steps:

  1. In the Operations Automation provider control panel, navigate to System > Settings.
  2. In the Core section, follow the System Properties link.
  3. On bottom of the screen, click the Edit button.
  4. Mark the APS development mode check-box and click Submit to save the setting.

Integration of an application with Odin Service Automation is going through the application APS package, which usually contains the following parts as presented below:

  • Metadata with general description of the application and the package
  • APS types that will be used for creating APS resources; normally generated by the aps build command from the provisioning scripts
  • Provisioning logic, e.g. PHP scripts, containing definition of each services declared in metadata; also may contain definition of types
  • Presentation logic, e.g. HTML files with with JavaScript, implementing visual and control elements in control panels


Depending on application complexity, the package structure can be more complicated and it can contain much more files.

Initial APS package processing in Odin Service Automation contains the following steps:

  1. The whole package must be imported to Odin Service Automation. APS controller will need general data, definition of types and services for subsequent application configuration and provisioning. Presentation logic will be applied to control panels.
  2. Provisioning scripts must be used for setting the application endpoint. They expose the application services for the APS controller.
  3. Installation of application instance step will initiate the APS controller to configure the application instance through the application endpoint.

On completion of the above steps, the provider will be able to proceed with the following configuration steps:

  1. Setting global resources step is needed when the application requires some parameters to be applied globally to the application resources.
  2. Creating resource types step is a usual deployment step in Odin Service Automation. APS specifics here is that Odin Service Automation resource types are bound to APS resources.
  3. For selling application resources, the service plan in Business Automation must be configured appropriately.


the deployment process can be partially or fully automated as described in the Automatic Deployment section in the APS Testing Framework document.

Package Import

If you have administration permissions in the Odin Service Automation system, you can import a package following these steps in the provider control panel.

  1. Navigate to Services > Applications.
  2. Click the Import Package button, then select the local file or provide its URL.
  3. Click Submit to complete the operation.

Setting Application Endpoint

Each APS application must expose at least one APS application endpoint, or shorter endpoint, that will be able to receive REST requests from the APS controller. Endpoint deployment requires the following high level steps:

  1. Arrange a web server folder and copy all provisioning scripts to it.
  2. Provide access to these scripts for the web server.
  3. Configure web server.

APS endpoint for an application can be set up in one of two ways.

  • Automatically (highly recommended), using the following methods:
    • For Linux, we provide the automated method, based on the utility.
    • For Linux, as an alternative way, you can create an RPM package. For example, it is used in the OwnCloud demo package.
    • For Windows, create either PowerShell, or *.bat script or *.msi installation file.
  • Manually, following the Manual Setup instructions (not recommended).

Automated Setup based on

The application endpoint setting can be automated by means of the utility. If you are working on a sandbox, the utility already exists on the host. When you start it, the utility configures the platform (Apache and SSL), if needed, and then creates the required APS endpoint. The method consists of two steps.

  1. Copy the APS package to the endpoint host. For example, if your package is and base domain of your sandbox is


  2. Log in to the endpoint host and use the utility on your endpoint host to setup an APS application endpoint in a specified folder. For example, if you have package and need to install an endpoint in the folder /var/www/html/vpscloud, enter the following command: vpscloud

    The utility will print out the URL for the endpoint, e.g.:

If you need to add some configuration steps after the outlined ealier high level step are over, add the shell script named It must be placed in the application endpoint folder. If such script is present, the script will call it, once the basic configuration is done. Notice that exports the ENDPOINT_LOCATION variable - path to the application endpoint folder, where the application provisioning scripts are located. This variable can be used in Example of can be found in VPS Backup demo package.

Manual Setup

When setting endpoint manulally, we need to separate Platform Setup (used once per platform) from APS Endpoint Setup (used per each APS application endpoint installation). This method is not recommended as it is time consuming and prone to mistakes. We provide the details here to help you create one of automated methods.

Platform Setup

The host, on which APS endpoints will be set up for different applications, needs to be configured. To do it on a CentOS Linux, the following steps are needed:

  1. Enable HTTPS and client SSL certificate verification:

    • Install mod_ssl:

      yum install mod_ssl
    • In /etc/httpd/conf.d/ssl.conf, uncomment the SSLVerifyClient option and set it to optional_no_ca:

      SSLVerifyClient optional_no_ca
    • In /etc/httpd/conf.d/ssl.conf, configure the <Files> section as follows:

      <Files ~ "\.(cgi|shtml|phtml|php3?)$">
          SSLOptions +StdEnvVars +ExportCertData
    • Restart Apache:

      service httpd restart
  2. If you are going to use the APS PHP runtime framework, make sure the standard PHP package and APS PHP runtime library are installed on the host. For example, verify it as follows:

    rpm -qa | grep php

    If one or both of them are not installed, you can use the commands below appropriately:

    yum install php
    yum install


    Pay attention, the runtime version might increase by the time you will do these operations. Please use the URL for the latest version.

  3. Set the AllowOverride All option for the folder that will be the parent of application endpoints. It is usually var/www/html in Apache. For example, in the /etc/httpd/conf/httpd.conf file, find the <Directory “var/www/html”> section and edit the following line:

    AllowOverride All
  4. Restart the Apache service:

    service httpd restart

APS Endpoint Setup

For setting an APS application endpoint manually, you need to follow these steps.

  1. Create the application endpoint folder. For instance, the /var/www/html/vpscloud folder will be used in following steps.

  2. Copy all provisioning scripts, i.e. PHP and other files from the scripts folder of the package to the application endpoint folder, i.e. to /var/www/html/vpscloud/ in our example.

  3. Make sure the user apache is the owner of the endpoint folder and all its contents:

    chown -R apache:apache /var/www/html/vpscloud
  4. Set redirect from each URL that exposes an application service to the PHP file that implements the service. For example, if in metadata you declared four different services named clouds, offers, contexts, and vpses, you will probably have cloudes.php, offers.php, contexts.php, and vpses.php files. The redirect is configured by creating the .htaccess file just inside the vpscloud folder with the following content:

    Options +FollowSymLinks +ExecCGI
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /vpscloud
    RewriteRule ^clouds(|/.*)$ clouds.php?q=$1 [L,QSA]
    RewriteRule ^contexts(|/.*)$ contexts.php?q=$1 [L,QSA]
    RewriteRule ^offers(|/.*)$ offers.php?q=$1 [L,QSA]
    RewriteRule ^vpses(|/.*)$ vpses.php?q=$1 [L,QSA]
  5. Restart the Apache service:

    service httpd restart

Application Instance Installation

Installation of the APS application instance in Odin Service Automation is needed to establish the secured connection between the APS controller and the application. During this process, the APS controller must generate an application certificate for the application and send it to the application instance through the application endpoint. The provider should do this operation in the Operations Automation provider control panel following these directions:

  1. Open the imported APS package and switch to the Instances tab.
  2. Click the Install button.
  3. In the Application API end-point URI field, enter the application endpoint URL that must address to the endpoint root folder. In our example, it must be similar to https://<endpoint_domain_name>/vpsclouds/.
  4. Enter, if needed, application connection parameters, e.g. IP address of the cloud application host, login, and password.
  5. Complete the operation.

Setting Global Resources

Global resources are shared for all customers. For example, they can be used for offering a number of possible configurations from which customers can choose whichever is better for them when purchasing a resource as demonstrated at Custom Resource Relations. Suppose, our demo package allows the provider to create a number of VPS offers (Platinum, Premium, and Starter offers) in order customers can select them when purchasing VPSes. For example, a customer can purchase 15 VPSes, two of them will be based on the Platinum offer, three on Premium, and ten on Starter.

To create an offer, the provider should go through the following steps in the Operations Automation provider control panel:

  1. Open the application instance screen and switch to the Samples tab.


    Such a tab will appear if the custom UI in the package contains the Samples item in the declared navigation tree and a UI view element presenting the Samples tab.

  2. Create the needed number of offers using custom UI.

Creating Odin Service Automation Resource Types

Odin Service Automation contains APS resource classes used for presenting different APS resources as explained in the table:

APS Component Odin Service Automation Resource Class Example in Diagram Description
Application Application Service Reference cloud APS application instance related to all other resources.
Global Resource Application Service Reference offer APS resources with global settings. They must relate to Application.
Resource Type Application Service context, vps APS resources owned by an account or end-user.
Resource Counter Application Counter CPU cores, Memory Counter of an application resource consumption.

The table helps providers to correctly select the Odin Service Automation resource class when creating a list of needed Odin Service Automation resource types. Application Counter class actually is presented with its modifications that should be selected depending on the unit of measure used by the resource counter:

  • Application Counter (KB) maps with APS resources counters measuring resource usage in Bytes, KBytes, MBytes, etc. It is suitable for memory and storage counters.
  • Application Counter (unit) maps with unit counters, e.g. with counters of CPU cores or mailboxes.
  • Application Counter (MHz) is suitable for counters of CPU power.

To create a resource type in Operations Automation, providers goes through the following general steps:

  1. Open the application package and switch to the Resource Types tab.
  2. Click Create and select the Odin Service Automation resource class in accordance with the table.
  3. Assign a name to the resource.
  4. Select the proper APS type. When creating the Application resource, you need to select the application instance.
  5. Complete the operation.

The provider needs to repeat the outlined process until all needed resources are created.


The resource providing management context for customers must have the Autoprovisioning attribute marked.

Creating Odin Service Automation Service Template

All resources created in the previous step the provider usually includes into the service template that will be used for provisioning the application services to customers. Service providers follow these steps in the Operations Automation control panel to create the needed service template (ST).

  1. Navigate to Products > Service Templates and click Add New Service Template.

  2. Enter the ST name, e.g. Cloud VPS Services, mark the Autoprovisioning box, make sure Custom is selected in the drop-down Type list, and click Next.

  3. Select all APS related resource that were created at the previous step. Probably, the application needs some other resources, e.g. DNS hosting. Add them as needed, and then click Next.


    If you missed any resources at this step, you can easily add them later, after the ST is created.

  4. Set resource limits keeping in mind the following key points:

    • The subscription should provide only one application instance and one management context.
    • The limits for the other resources should be set following commercial reasons.
    • The limits set in the ST can be overridden by resource rates in the service plan based on this ST.
  5. Save the ST, and then activate it by clicking the Activate button.

Our demo application is presented with the following Odin Service Automation service template:


In accordance with this ST, the total number of virtual servers is unlimited. However, a subscriber cannot create more than 15 servers, as the total limit on the number of VPS configurations (offers) that the customer can select is 2+3+10=15. Still, please keep in mind that the limits can be overridden in a service plan based on this ST.