Automatic Resource Configuration (autoconf.py)

The automatic resource configuration procedure is performed by means of the autoconf.py script that is included in the application package.

Note: This script does not support software subscription licenses and perpetual software licenses. You can use it only for the configuration of resources of recurring licenses and add-ons.

Prerequisites

For the script, you must prepare a server that meets these requirements:

  • Python 2.7.5 or later is installed.
  • The poaupdater RPM package is installed. You can take this RPM package from the CloudBlue Commerce distribution package or YUM repository that belongs to your version of CloudBlue Commerce (for example, see the DISTRIBUTION_PACKAGE/modules/platform/OS/OS_VERSION/RPMS/ directory).
  • The pyPgSQL-2.5.1 (or higher) Python package is installed.
  • The mx 3.1.1 (or higher) Python package is installed.
  • Connections from the server to the Operations Public API are allowed.
  • Connections from the server to the Billing Public API are allowed.
  • Connections from the server to the APSC are allowed.
  • Connections from the server to the CloudBlue Commerce system database are allowed.

We recommend that you use your Operations Management Node if a suitable version of Python is already installed on it. Otherwise, you must prepare a separate server for the script.

The Initial Resource Configuration

Before running the script, take the following into account:

  • You can use the --prefix option to add a prefix to the names of resource types, service templates, and service plans that are created by the script. For example, if the ABC prefix is specified, the names will start with ABC:. When configuring resources for an application instance, you must specify a prefix that uniquely identifies this application instance.

    For example, for the first application instance use the INST1 prefix, and for the second application instance use the INST2 prefix, and so on.

  • You must not change the names of service templates created with the script. The script relies on these names when it is run for resource reconfiguration.
  • If HTTP authentication is turned on for the CloudBlue Commerce Public API, you must specify the name and password of a CloudBlue Commerce Public API user by using the --oa-api-user and --oa-api-user-password options of the script. We recommend that you specify the name and password of the user that you created during the deployment of the application (see Preparing a CloudBlue Commerce Public API User for details).
  • You can create your custom license types, add-on types, resource types, service templates, and service plans by using the respective JSON files as templates.
  • See Examples of Microsoft 365 Service Plans for Recurring Licenses and Add-ons to obtain a complete example of a resource configuration for recurring licenses and add-ons.
  • The script, in addition to sending log output to the console, writes log output to the log file autoconf_YYYY-MM-DD.log located in the same directory as the script. We recommend that you check the log file after running the script.
  • By default, in all service plans created by the script, the Notification About Service Provisioning parameter is set to Welcome e-mail - Office 365. As a result, customers will receive certain email messages after subscribing to those service plans. The contents of those email messages are defined in the Welcome e-mail - Office 365 system notification template and are the same for both CCP v1 and UX1 for Customers. If you need to customize those email messages, you can either customize that notification template or create your own notification templates for Microsoft 365 service plans. Please refer to the Billing Provider Guide to learn more about notification templates and their configuration.

To configure resources for recurring licenses and add-ons for the first time, perform these steps:

  1. Prepare the CSP Deployment Assistant tool:

    1. Download the latest file of the CSP Deployment Assistant tool from https://www.dropbox.com/sh/flvexj79k532lma/AADVZXXgraLg7DbQilkqYnf1a?dl=0 to your workstation (Office365DeploymentAssistant.x.x.x.xlsx).
    2. Run the CSP Deployment Assistant tool.
  2. Prepare the autoconf.py script:

    1. Upload the Microsoft 365 application package to the server that you prepared.
    2. Unpack the package and extract the contents of the O365-Import.zip file.
    3. Go to the directory where the contents of the extracted O365-Import.zip file are located.
    4. Unpack the simplejson-2.3.2.tar file.
    5. Go to the simplejson-2.3.2 directory.
    6. Execute the python setup.py install command.
    7. Return to the parent directory.

    Important: If you use a separate server for the script, not your Operations Management Node, set the corresponding values for the __dbhost, __dbname, __dbuser, __dbpass, __apihost parameters in the api_entry.py file.

  3. Create the following files using the instructions of the CSP Deployment Assistant tool:

    • CustomLicenseTypes.json (see the tab CSPLicenseTypes.json of the CSP Deployment Assistant tool)
    • CustomResourceCategories.json (see the tab CustomResourceCategories.json of the CSP Deployment Assistant tool)
    • CustomSalesCategories.json (see the tab CustomSalesCategories.json of the CSP Deployment Assistant tool)
    • CustomServicePlans.json (see the tab CSPServicePlans.json of the CSP Deployment Assistant tool)

    Place these files in the directory where the autoconf.py script is prepared.

    Note: We recommend that you check these files using a JSON validation tool. For example, you can use http://jsonlint.com/.

  4. Obtain the application instance ID of the required Microsoft 365 application instance:

    1. In the Provider Control Panel, go to Services > Applications and open the APS Connectors tab.
    2. In the list of applications, click the Microsoft 365 application.
    3. Select the Instances tab.
    4. Write down the identifier of the required instance.
  5. Specify the prepared application instance ID in the CSP Deployment Assistant tool.
  6. Execute the first command provided in the CSP Deployment Assistant tool to create add-on types, license types, resource types, and a service template for recurring licenses and add-ons. For example:

    python autoconf.py --license-types-json CustomLicenseTypes.json --resource-categories-json CustomResourceCategories.json --sales-categories-json CustomSalesCategories.json --service-plans-json CustomServicePlans.json --o365-app-instance-id 1

  7. Prepare a service plan that will be used as a template for service plans of recurring licenses and add-ons. Make sure that the following preconditions are satisfied:

    • This service plan is based on the service template created in the previous step.
    • This service plan has one subscription period (1 Year).
    • The Service Terms property of this service plan is set to Microsoft 365 (Recurring Licenses and Add-ons). See Creating Service Terms for Recurring Licenses and Add-ons for details.
    • The Auto-Renewal property of this service plan is enabled and configured.

    Write down the service plan ID of this service plan.

  8. Specify the prepared service plan ID of the template service plan in the CSP Deployment Assistant tool.
  9. Execute the second command provided in the CSP Deployment Assistant tool to create resource categories, sales categories, and service plans for recurring licenses and add-ons. For example:

    python autoconf.py --license-types-json CustomLicenseTypes.json --resource-categories-json CustomResourceCategories.json --sales-categories-json CustomSalesCategories.json --service-plans-json CustomServicePlans.json --o365-app-instance-id 1 --pba-stub-plan-id 100000 --langs en,de,fr

  10. Include the PBA resource type in the service template created earlier. The resource limit must be set to Unlimited.

    Note: You must include the PBA resource type if you need integration between the application UI for CCP v1 and Billing. This integration enables customers to adjust limits on recurring licenses and upgrade these licenses in CCP v1 on the application screen at Microsoft 365 > Licenses. If you do not need this integration, do not include the resource type in the service template.

  11. The application has its own wizard for linking domains with the Microsoft 365 service, so the step "Select Domain" in the system wizard "Buy New Service" is unnecessary. If you want to remove this step, remove the DomainID service parameter from the service template created by the script.
  12. Adjust the Microsoft 365 A1 service plan created by the script:

    1. Rename the service plan from its original name to Microsoft 365 A1 (1 license).
    2. Set Auto-Renewal to Disabled.
    3. Make sure that the duration of the subscription period is set to 6 Years.
    4. In the subscription period, set Setup Fee to 1 * <price per Microsoft 365 A1 license>, and then set Recurring Fee to 0.00.
    5. In the resource rate, set Inc. Amount, Min Amount, and Max Amount to 1.
    6. In the resource rate, set Setup Fee and Recurring Fee to 0.00.
    7. As quantity upgrades are not supported for subscriptions to the Microsoft 365 A1 recurring license, create several copies of the service plan for different included amounts (Microsoft 365 A1 (2 license), Microsoft 365 A1 (3 license), and so on). In each copy, in its subscription period, set Setup Fee to <number of included licenses> * <price per Microsoft 365 A1 license>; in its resource rate, set Inc. Amount, Min Amount, and Max Amount to <number of included licenses>.
  13. Check the properties of the created service plans.

Resource Reconfiguration

It is possible to run the script many times for existing installations of the application. For instance, you can create custom configuration files that contain new recurring licenses and add-ons, and run the script for your installation that contains already configured resources of recurring licenses and add-ons. In this case, the script does the following:

  1. It creates license types for new recurring licenses.
  2. It creates add-on types for new add-on recurring licenses.
  3. It updates the lists of possible upgrades for all license types.
  4. It updates the lists of parent recurring licenses for all add-on types.
  5. It creates resource types for new recurring licenses and add-ons.
  6. It updates the corresponding service template.
  7. It creates service plans for new recurring licenses.
  8. It updates the lists of allowed upgrades of service plans that contain resources of recurring licenses.

Note: If you used a prefix for the initial resource configuration of an application instance, you must use the same prefix for resource reconfiguration of that application instance. To view the prefix of resource types, service templates, and service plans that were created for a specific application instance, you can use this command: python autoconf.py --o365-app-instance-id <id> --search-prefix.