Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To run a Plugin on a VM, you’ll need to install the HCP agent. You can install the HCP agent on the VM using a Blueprint or the Free-from wizard.

Refer to these sections to:

...

  1. Log in to your HCP portal account.

  2. Click Service Orchestration and navigate to Appstore > Plugins > Click New > Select the Plugin Type from the drop-down list.

  3. Enter these details in your Script Plugin dialog:

    1. Provide a Name for your pluginPlugin.

    2. Click +Advance Configuration and enter these details:

      1. Enter a plugin Version.

      2. Enter a brief description of your new Script Plugin.

      3. Select the License from the drop-down list.

      4. Enter the Timeout for your plugin Plugin in seconds.

      5. Enter the following in the Scripts text-box:
        #!/bin/bash
        [1] Use the script below to update your packages:

        Code Block
        languagebash
        echo "Updating OS packages"
        sudo apt-get update && sudo apt-get upgrade -y || yum update -y 
        echo "Ping Test to Google DNS Server" 
        ping $IP_ADDRESS -c 8|
      6. If you want to add conditions for your Script Plugin run:

        1. Click Arguments+

        2. Enter the argument Key and its Value.
          Example:
          Key: IP_ADDRESS Value: 8.8.8.8

    3. To entitle users to your pluginPlugin, select: 

      • Only Me: if you do not want anyone to access your pluginPlugin.

      • Everyone: if you want to share your plugin Plugin with everyone.

      • Groups & Users: if you want to share the plugin Plugin with specific users or groups.

        1. Enter the first three alphabets of the username in the Users drop-down and select the username.

        2. Type the first three alphabets of the Group Name in the Groups drop-down and select the group name.

  4. Click Save Changes.

  5. Once you create your Plugin, the HCP portal will create a unique REFERENCE ID for the same.
    Example: Q5G9A

Note

  • [1] The HCP portal will replace all occurrences of:

    • $IP_ADDRESS in the

    plugin
    • Plugin with the value 8.8.8.8 However, the

  • The HCP portal will ignore

    the

    all occurrences of:

    • ${IP_ADDRESS} in the pluginPlugin

Run

...

your plugin on-demand

...

Users can run Follow these steps to run your plugins on-demand any of their own existing Virtual Machines without the need of connecting to the VM. Use the following steps to run an existing plugin on an existing VM.
Note: Running plugins on an existing VM requires the HyperCloud™ Agent to be installed on the Virtual Machine. The Agent Status must be Connected.

  • Login to the HyperCloud™ Platform with your credentials  Click on Services Orchestration Tab  Services

  • Click on VMs  Locate and click on the target VM.  Click on Plugins Tab

    • In the Add Plugins Drop-Down scroll or search the plugin name  Select the plugin

Note: If the plugin has been created with Arguments, then text fields will appear under the selected plugin.

...

  • To Add more plugins, click on the Add Plugins and scroll or Type and search the name of another plugin

    • For each plugin, click on +Advance Configuration button and provide the following information

      • Valid Exit Codes: These Exit codes will be ignored. If none provided, then the default value is 0.

        • Order: Sequence number to define the order of execution of the plugin.

Note: If no order number is mentioned, all plugins will run at the same time

...

Click on Run Plugin

...

on an existing VM without having to connect to the VM: [1]

  1. Log in to your HCP portal account.

  2. Click on Service Orchestration and navigate to Services > VM > Click open your VM > Click Plugins.

    Image Added
  3. From the Add Plugins drop-down, select your Plugin. [2]

    1. To add more plugins, click Add Plugins and select your Plugin from the drop-down list.

    2. You can provide conditional arguments for each Plugin under +Advance Configuration. Enter the following details under +Advance Configuration:

      1. Valid Exit Codes: when you state a valid exit code, the HCP portal will ignore these codes. If you do not provide an exit code, the HCP portal will substitute it with the default value, which is 0.

      2. Order: this lets you define the sequence for the Order of executing the Plugin. [3]

  4. Click Run Plugin.

  5. Click Timeline Tab and wait for a few minutes to see the

...

Add Plugins to an existing Blueprint

...

  1. status of your run.

Note

  • [1] You’ll need to install the HyperCloud™ Agent on the VM before running a plugin.

    • The Agent Status must be Connected.

  • [2] If your Plugin has conditional arguments, you can view the same under +Advanced Configuration.

  • [3] If you do not provide the Order for executing a plugin, all plugins added to the VM will run simultaneously.

Add Plugin to a Blueprint using parameters

...

You can use parameters in blueprints to pass or override the default plugin values in . You can add a plugin . This allows sharing the same plugin with to different blueprints and allows users to customize their deployments as per their choice of parameters.

Configure Your Blueprints to Customize Parameters

To configure Blueprints to customize parameters used by the plugins:

...

Login to the HyperCloud™ Platform with your credentials.

...

Click on Services Orchestration >Select AppStore:

  1. Click on Plugins > Locate the plugin and copy the REFERENCE ID for e.g. Q5G9A

...

your deployments using parameters. Follow these steps to add parameters to your Plugin for an existing blueprint:

  1. Log in to the HCP portal account.

  2. Click Service Orchestration and navigate to AppStore > Plugins > Copy the REFERENCE ID of your Plugin.

  3. Click AppStore and navigate to New > Select Machine Compose Blueprint from the drop-down list.

  4. Enter the following details in your Machine Compose Blueprint dialog:

    1. Enter a Name for the name for new Machine compose blueprintCompose Blueprint.

    2. Enter the brief description to your machine compose blueprintof your Machine Compose Blueprint.

    3. Select the blueprint type Type from the drop-down list.

    4. Add Enter the plugins plugin snippet in the YAML Text text-box as shown below: [1]

      Image Added

    5. Select the Resource poolPool from the drop-down list

    6. Click

    on Services Orchestration  > Select AppStore > Click on the Blueprints > Click on Edit.Refer the YAML Syntax below beginning with plugins:
    Machine:
    region: westus
    group: hg-poc
    image:
    1. Customizable Params + and enter the following details: 

      1. Enter the internal reference to the Plugin.
        Example: Machine.plugins.Q5G9A.arguments.IP_ADDRESS 
        The HCP portal will use this reference to run the Plugin on your VM using the YAML blueprint parameter values.

      2. Enter the Host in the Key text-box. The Key is visible to your HCP user.

      3. Enterthe Value for your Key. If you do not enter a value for your Key, the HCP portal will default the value to 8.8.8.8.

      4. Select the Mandatory check-box to make it compulsory for your HCP users to provide a Key-Value before creating a VM. [2]

      5. Select the Password check-box to ensure that your sensitive data is masked during input and execution.

        Create MachinesImage Added

    2. Click Save Changes

  5. To use these parameters in your blueprint:

    1. Click open your blueprint.

    2. Click Request Params.

    3. Enter the Host value that you provided in Step-f above.

Notes

  • If your parameters are marked mandatory, you’ll need to enter a Key-value before you can create a VM.

  • If you haven’t made your parameters mandatory, the HCP portal will:

    1. Create a VM and,

    2. Execute the Plugin using the default value 8.8.8.8

[1] Sample YAML

Code Block
languageyaml
Machine:
region: westus
group: hg-poc
image: Canonical:UbuntuServer:16.04-LTS

...


instanceType: Standard_D13_v2

...


resourceGroup: hg-dojo-rg

...


network: hg-dojo-vnet1

...


subnet: hg-dojo-vnet1-subnet1

...


securityGroup: hg-dojo-nsg

...


skipAgentInstall: false

...


assignFloatingIP: true

...


publicIPSku: basic

...


password: "{{credentials

...

 | 2c9180876f0dbccb016f4f9d87a66886 }}"

...


count: 1

...


terminationProtection: DISABLED

...


  plugins:

...

  1. Install Packages

  • !plugin
    id: Q5G9A
    order: 1

  • !plugin

  1. Download & Install Security Agent
    id: P5H7K
    order: 2|

...

Copy the plugin ID from the Blueprint below for e.g. Q5G9A

...

Click on the Customizable Params + located under the YAML section or the resource pool as shown below:

...

 

...

The internal reference to the plugin i.e. Machine.plugins.Q5G9A. arguments.IP_ADDRESS will be used to run the plugin on the VM with the value from the blueprint parameters.

...

The external value key Host will visible to the end-user when provisioning the blueprint:

  1. Mandatory Checkbox: User is forced to enter a value before creating a VM

  2. Password Checkbox: Ensure that sensitive data like password field is masked during input and execution.

  3. Value Text Box : 8.8.8.8 will be a default value if parameter is left unmodified i.e. If the mandatory checkbox is not selected and user creates a VM, then the plugin will get executed with the default value of 8.8.8.8

11. Click Save Changes

12. Click on the Blueprint Click on Request Params

Note: What parameters are marked as mandatory, user must enter a value to be able to Create Virtual Machine.

...

This completes the steps to provision a VM using blueprints and use plugins to run automation once the VM is deployed successfully.

Overview

Users can add plugins to an existing blueprint by appending the blueprint YAML with the plugin YAML values.

Add Plugin Your Existing Blueprint


  -!plugin
  # Install Packages
  id: Q5G9A
  order: 1
  -!plugin
  # Download & Install Security Agent
  id: P5H7K
  order: 2

Add Plugin to a blueprint without using parameters

...

You can add a plugin to a blueprint by appending the plugin YAML values to the blueprint YAML. To add a plugin to an existing MACHINE_COMPOSE Blueprint YAML:

  1. Login to the HyperCloud™ Platform with your credentials

  2. Click on Services Orchestration >Select AppStore:

    1. Click on Plugins > Locate the plugin and copy the REFERENCE ID for e.g. Q5G9A

  3. Click on AppStore > Click on New > Select the Log in to your HCP portal account.

  4. Click Service Orchestration and navigate to AppStore > Plugins > Copy your plugin REFERENCE ID.

  5. Navigate to AppStore > Click New > Select Machine Compose Blueprint from the drop-down list.

  6. Enter the following details in your the Machine Compose Blueprint dialog:

    1. Enter the name a Name for the your new Machine compose blueprintCompose Blueprint.

    2. Enter the a brief description to your machine compose blueprintDescription of your Machine Compose Blueprint.

    3. Select the blueprint type Type from the drop-down list.

    4. Enter the plugin snippet for your plugin in the YAML Text text-box. (Refer to table 1.) [1]

    5. Select the Resource poolPool from the drop-down list.

    6. Enter Select the cost profilesCost Profile.

    7. Enter the following details into your Entitled To entitle users to your existing blueprint, select: 

      • Only Me: If this template is not meant to be shared if you do not want anyone to access your blueprint.

      • Everyone: If this template is to be shared with everyone in the Tenantif you want to share your blueprint with everyone.

      • Groups & Users: if the template is to be shared you want to share the blueprint with specific users or groups.

        1. Enter the first three alphabets of the username in the Users drop-down and select the username.

        2. Type the first three alphabets of the Group Name in the Groups drop-down and select the group name.

        3. If you are a Cloud Administrator, you can select All Tenants

        (Only available to Cloud Admins): if the template is to be shared with all
        1. to share your template with all the HCP tenants.

    Click on 
    1. Click Save

    Change
    1. Changes.

  7. Once you’ve created the plugin on your existing blueprintconfigured your plugin parameters, you can go ahead and create your Virtual Machine ( VM). To create a Follow these steps to create your VM:

    1. Click Blueprintopen your blueprint.

    2. Click Create Machine.

  8. Once

...

  1. your VM

...

  1. is

...

  1. provisioned

...

  1. :

    1. The HyperCloudTM Agent will be automatically installed and,

    2. All the plugins in the blueprint are executed in the

...

    1. Order defined in the Blueprint YAML.

Note

  • plugins: indicates the start of all plugins.

Table number 1.1[1] Sample YAML

Code Block
languageyaml
Machine:

...


region: westus

...


group: hg-poc

...


image: Canonical:UbuntuServer:16.04-LTS

...


instanceType: Standard_D13_v2

...


resourceGroup: hg-dojo-rg

...


network: hg-dojo-vnet1

...


subnet: hg-dojo-vnet1-subnet1

...


securityGroup: hg-dojo-nsg

...


skipAgentInstall: false

...


assignFloatingIP: true

...


publicIPSku: basic

...


password: "{{credentials | 2c9180876f0dbccb016f4f9d87a66886 }}"

...


count: 1

...


terminationProtection:

...

2c9180876f0dbccb016f4f9d87a66886 }}"
count: 1
terminationProtection: DISABLED
plugins:

  1. Install Packages

  • !plugin
    id: Q5G9A
    order: 1

  • !plugin

...

 DISABLED

  plugins:
  -!plugin
  # Install Packages
  id: Q5G9A
  order: 1
  -!plugin
  # Download & Install Security Agent
  id: P5H7K
  order: 2