Enabling integration

Prerequisites

1. Install the CloudBlue connector on a dedicated RHEL 9 virtual machine.

CloudBlue Connect configuration file

To ensure the smooth connection of the CloudBlue Connect API with Virtuozzo Infrastructure, adjust the config.yaml file and start the cloudblue-connector service.

1. Copy the config-logging.json config from the example. No further adjustments are required for this file.

1
cp /etc/cloudblue-connector/connector-logger-example.json /etc/cloudblue-connector/connector-logger.json

2. Copy the main configuration file example as your config.yaml file:

1
cp /etc/cloudblue-connector/config-example.yaml /etc/cloudblue-connector/config.yaml

The default configuration file looks as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
api:
  cloudblue:
    url: "https://api.connect.cloud.im/public/v1"
    vendorKey: "ApiKey YOUR_API_KEY"
    distributorKey: "ApiKey YOUR_API"
  vhi:
    url: "https://[KEYSTONE_URL]:5000/v3"
    username: "vstorage-service-user"
    password: "PASSWORD"
    domain: "Default"
    project: "admin"
    verify: false
  vap:
    url: "https://app.vap.virtuozzo.com"
    token: "YOUR_TOKEN"
  onapp:
    url: "https://onapp.com"
    username: "admin@example.com"
    token: "YOUR_TOKEN"
appConfig:
  daemon:
    interval: 30
    timeout: 3600
  rootPathUsage: "/var/lib/cloudblue-connector/usage"
  connectorDbPath: "/var/lib/cloudblue-connector/connector_db.sqlite3"
  dataRetentionPeriod: 0
  marketplaces:
    - "MP-0000"
  contracts:
    - "CRD-00000-00000-00000"

  products:
    PRD-000-000-001:
      approveTemplate: "TL-613-866-807"
      name: "pVHI"
      type: "vhi"
      reportUsage: true
      reportUnitsIn: "GB"
      reportUsageAutoAccept: true
      reportPeriod: "daily"
      uploadImages: true
      paidImages:
        img1: "UUID"
        img2: "UUID"
        img3: "UUID"
    PRD-000-000-002:
      approveTemplate: "TL-989-070-904"
      name: "VHS7-OnApp-Cloud"
      type: "onapp"
      bucketId: 1
      userRoleId: 2
      groupId: 17
      reportUsage: true
      reportUsageAutoAccept: false
      reportPeriod: "daily"

3. Change the default parameters in the /etc/cloudblue-connector/config.yaml configuration file:

3.1. In the api cloudblue section, set the following parameters:

  • url: Specify the CloudBlue Connect API endpoint URL. You can copy the API endpoint URL from the Integrations > API page.

CloudBlue API endpoint

  • vendorKey and distributorKey: Specify the API key for secure interaction with the CloudBlue Connect API. To generate this key, go to the Integrations > Tokens page and click Create token. Once, the token is created, copy the API key on the token details page.

CloudBlue API key

Note: For security reasons, it is recommended to comment out this line and set the key using the CLI tool, as described in step4.

3.2. In the api vhi section, set the following parameters:

  • url: Replace [KEYSTONE_URL] with the public IP address or domain name of your Virtuozzo Infrastructure cluster.
  • username: Keep the default vstorage-service-user user name.
  • password: Specify the password of the vstorage-service-user user. You can copy this password from the /etc/kolla/admin-openrc.sh file. If this file does not exist, generate it by running:
1
su - vstoradmin -c "kolla-ansible post-deploy"
Note: For security reasons, it is recommended to comment out this line and set the password using the CLI tool, as described in step4.
  • domain: Keep the Default domain.
  • project: Keep the admin project.
  • verify: Keep the false value. If you have a valid SSL certificate, you can change this parameter to true.

3.3. In the appConfig section, set the following parameters:

  • interval: Specify the interval for processing fulfillments and usage data. The default value is 30 seconds.
  • timeout: Specify the timeout for one cycle of processing fulfillments and usage data. The default value is 3600 seconds (one hour).
  • dataRetentionPeriod: Specify the number of days a subscription remains active after cancellation. Set 0 to disable data retention.
  • marketplaces: Specify a list of marketplace IDs or leave empty.
  • contracts: Specify a list of contract IDs or leave empty.

3.4. In the products section, set the following parameters:

  • Replace PRD-000-000-001 with your product ID. You can copy the product ID from the Products > General page.

CloudBlue product ID

  • approveTemplate: Specify the template ID that is used for your product when fulfillment is confirmed or cancelled. You can copy the template ID from the Products > Embedding > Approved Templates page.

CloudBlue template ID

  • name: Specify your product name.
  • type: Keep the vhi type.
  • reportUsage: Change to false if you are using the reservation resource model.
  • reportUnitsIn: Specify units for usage reports. Supported values are MB and GB.
  • reportUsageAutoAccept: Change to false if you want to disable automatic acceptance of usage reports. Note that this parameter works only if distributorKey is set.
  • reportPeriod: Specify the reporting period. Supported values are hourly, daily, andmonthly.
  • uploadImages: Change to false if you want to disable image upload.
  • paidImages: Specify a list of chargeable images in the following format: <image_name>: "<image_uuid>". The image name must be the same as you specified when creating an image item, as described in Creating products. You can copy the image UUID from the Virtuozzo Infrastructure admin panel.

CloudBlue image UUID

4. For security reasons, it is recommended to set sensitive data, such as keys and passwords, using the cloudblue-connector auth set command. Use the --service option to specify the service name (cloudblue or vhi) for which to set the password. If omitted, the passwords will be set for both services. For example:

1
cloudblue-connector auth set --service vhi

To view your passwords, use the cloudblue-connector auth list command.

5. To secure the configuration files, change the file permissions as follows:

1
2
chmod 600 /etc/cloudblue-connector/config.yaml
chmod 600 /etc/cloudblue-connector/connector-logger.json

6. Enable and start the cloudblue-connector service:

1
2
systemctl enable cloudblue-connector.service
systemctl start cloudblue-connector.service

What’s next: