Updated on 2024-06-28 GMT+08:00

Packages

The Packages page displays all existing packages. You can create packages, and create and execute package installation and uninstallation tasks. For details about created tasks, see Tasks. Each package supports up to 20 versions. Each user can create up to 1000 package versions.

Creating a Package

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Automation (Retiring). The Automation page is displayed.
  3. In the navigation pane, choose Packages. On the displayed page, click Create Package.
  4. Set parameters by referring to Table 1.

    Figure 1 Creating a package
    Table 1 Parameters for creating a package

    Category

    Parameter

    Description

    -

    Package Name

    Name of a package.

    Enter up to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

    -

    Version

    Version of the software. Enter the actual value.

    -

    Enterprise Project

    Select the enterprise project to which the package belongs.

    -

    Timeout Duration

    Timeout duration of a package installation or uninstallation task.

    -

    Storage Path

    Enter the path for storing the package distributed to the ECS.

    -

    Description

    Description of the package. Enter up to 128 characters.

    Source Files

    OBS Region

    Region where the OBS bucket resides. Select a region from the drop-down list.

    OBS Bucket

    OBS bucket where the package is located. Select a bucket from the drop-down list.

    OBS Path

    Enter the path of an OBS object. Before obtaining an OBS object, choose Settings > Access Credentials to set an access credential.

    To copy an OBS object path, perform the following steps:

    1. Click Go to OBS and go to the Objects page.
    2. Select a desired object from the object list on the right and click Copy Path in the Operation column.
      • If Copy Path is not directly displayed, choose More > Copy Path in the Operation column.
      • If a folder is displayed in the Name column, click the folder to expand the object list, select an object, and copy the path.

    Platform

    Platform on which the package runs. Currently, only Linux is supported.

    Operation

    After the source file information is added, click Add. You can also edit or delete an added source file.

    -

    Platform

    Platform on which the software runs. Currently, only Linux is supported.

    Script Type

    Install

    Script for installing the software. Enter up to 1000 characters. Separate commands by ";", "&&", or "||".

    After the input, click Check for High-Risk Commands to check the script content. High-risk commands undergo regular expression verification. If the verification fails, risks may occur. For details about high-risk commands, see Table 1.

    Uninstall

    Script for uninstalling software. Enter up to 1000 characters. Separate commands by ";", "&&", or "||".

    After the input, click Check for High-Risk Commands to check the script content. High-risk commands undergo regular expression verification. If the verification fails, risks may occur. For details about high-risk commands, see Table 1.

    Execution Policy

    Batch Release

    Specifies whether to enable batch release. By default, this function is disabled.

    Instances for Each Batch

    Number of instances on which tasks can be executed at the same time.

    Interval

    Interval for executing each batch of tasks.

    Review

    Review

    Specifies whether to enable manual review. By default, this function is disabled.

    You can only modify the review configuration by modifying the atomic service card in the tool market.

    Reviewer

    After manual review is enabled, you need to select a reviewer.

    Alternatively, create a topic and add a subscription on the SMN console to notify a reviewer.

  5. Click Save.

Executing an Installation or Uninstallation Task

After a package is created, install or uninstall it as required. Script execution depends on the UniAgent capability. You need to ensure that the UniAgent has been installed and is running on the ECS where the script is to be executed.

  1. In the navigation pane, choose Packages. On the Packages page, locate the target package and click Install or Uninstall in the Operation column.
  2. On the package installation or uninstallation page, select an OS account from the Execution Account drop-down list.
  3. Select target instances.

    1. Click Add. The instance selection page is displayed.
    2. For Instance Type, the default value is ECS. For Method, the default value is Specific. For details about the methods, see Table 2.
      Figure 2 Adding instances
      Table 2 Selection method description

      Selection Method

      Description

      Specific

      Enter search criteria and select instances from the instance list. By default, instances are searched by name.

      By filter

      • Enter filter attributes and values to search for instances.
      • If there are multiple filter criteria, the search is performed based on the AND relationship.
      • This method also takes effect for instances added later.

      By tag

      • Set tag keys and values, and specify one or more tags to select instances.
      • If there are multiple tags, the search is performed based on the AND relationship.
      • This method also takes effect for instances added later.

      From CMDB

      Enter search criteria or keywords and select instances from CMDB. There are two types of nodes:

      • Static: Select an ECS under a specified CMDB application.
      • Dynamic: Select a node in the CMDB application to dynamically obtain ECSs under the node. This method also takes effect for instances added later.
    3. Click OK.

  4. Click Execute. On the task execution page that is displayed, view the task execution status.

    You can also click Save. The created task is displayed on the task management page for subsequent task execution or other operations.

More Operations

After a package is created, you can go to its details page and view the basic information, status, number of tasks referenced by scheduled O&M, number of tasks referenced by standard O&M, and version list of the file package. You can also perform the operations listed in Table 3.

Table 3 Related operations

Operation

Description

Creating a version

Click Create Version in the upper right corner.

Modifying the package information

Click Modify in the upper right corner to modify parameters.

Installing or uninstalling a package

Locate the target version and click Install Package or Uninstall Package in the Operation column.

Copying and creating a package version

Locate the target version and click Copy and Create in the Operation column to copy the content of one version for creating another version.

Releasing a version

Locate the target version and click Release in the Operation column.

Modifying a version

Locate the target version, click Modify in the Operation column, and modify information such as the version, file source, and platform.

Deleting a version

Locate the target version and click Delete in the Operation column.