All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-BulkyInstallLogAgent

Last Updated:Sep 08, 2026

Install, upgrade, or uninstall the Simple Log Service agent (Logtail) on multiple Elastic Compute Service (ECS) instances in a batch.

Property

Value

Template name

ACS-ECS-BulkyInstallLogAgent

Template type

Automated

Owner

Alibaba Cloud

Execute Now

Prerequisites

Before you begin, make sure that you have:

  • Target ECS instances that are running and reachable

  • Cloud Assistant installed and running on each target ECS instance (the template uses ACS::ECS::RunCommand to run scripts remotely)

  • Internal network access from the ECS instances to the regional Object Storage Service (OSS) endpoint for downloading the Logtail installer

  • A Resource Access Management (RAM) role with the required permissions, if you use the OOSAssumeRole parameter (see Required permissions)

How it works

The template performs the following steps:

  1. Retrieve target instances -- Selects the ECS instances that match the targets filter by using the ACS::SelectTargets action. The template detects each instance's operating system type (Linux or Windows).

  2. Run OS-specific commands -- Loops over each instance and runs the appropriate script:

    • Linux: Downloads logtail.sh from the internal OSS endpoint and runs it as a shell script (RunShellScript).

    • Windows: Downloads logtail_installer.zip from the internal OSS endpoint, extracts it, and runs logtail_installer.exe as a PowerShell script (RunPowerShellScript).

  3. Return results -- Aggregates command output from all instances into the commandOutput output parameter.

Action modes

The action parameter determines the operation on each instance.

Action

Behavior

install (default)

Installs Logtail. If Logtail is already installed and overwrite is false (default), the template skips the instance and outputs already has LogAgent. Set overwrite to true to reinstall Logtail on instances where it is already present.

upgrade

Upgrades Logtail to the latest version. On Linux, runs logtail.sh upgrade. On Windows, uninstalls the existing agent and reinstalls it.

uninstall

Removes Logtail from the instance. On Linux, runs logtail.sh uninstall. On Windows, runs logtail_installer.exe uninstall.

Existing agent detection

When action is install and overwrite is false, the template checks whether Logtail is already installed by looking for the following paths:

Operating system

Path checked

Linux

/usr/local/ilogtail/app_info.json

Windows (64-bit)

C:\Program Files (x86)\Alibaba\Logtail

Windows (32-bit)

C:\Program Files\Alibaba\Logtail

If the path exists, the template skips the instance.

Input parameters

Parameter

Type

Required

Default

Description

targets

Json

Yes

--

The ECS instances to target. Uses the Targets association property with resource type ALIYUN::ECS::Instance.

regionId

String

No

{{ ACS::RegionId }}

The region where the ECS instances reside. Defaults to the region of the current OOS execution.

action

String

No

install

The operation to perform. Allowed values: install, upgrade, uninstall.

overwrite

Boolean

No

false

Whether to overwrite the existing Logtail agent on an instance. The existing agent is not overwritten by default. Applies only when action is install.

rateControl

Json

No

{"Mode": "Concurrency", "MaxErrors": 0, "Concurrency": 10}

Controls concurrency and error threshold for the batch operation.

OOSAssumeRole

String

No

"" (empty)

The RAM role that OOS assumes to run this template. Leave blank to use the permissions of the current user.

Parameter groups

The OOS console organizes these parameters into the following groups:

Group

Parameters

Configure Parameters

action, overwrite

Select Instances

regionId, targets

Control Options

rateControl, OOSAssumeRole

Rate control settings

The rateControl parameter is a JSON object with the following sub-parameters:

Sub-parameter

Type

Description

Mode

String

The concurrency mode. Set to Concurrency to specify a fixed number of parallel tasks.

Concurrency

Number

The maximum number of instances that the template processes at the same time. Default: 10.

MaxErrors

Number

The maximum number of errors allowed before the template stops processing remaining instances. Default: 0 (stops on the first error).

Default value:

{
  "Mode": "Concurrency",
  "MaxErrors": 0,
  "Concurrency": 10
}

Output parameters

Parameter

Type

Description

commandOutput

String

The aggregated output from commands run on all target instances.

Required permissions

Attach the following policy to the RAM role specified in OOSAssumeRole, or to the RAM user or role that runs the template.

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInstances",
                "ecs:DescribeInvocationResults",
                "ecs:DescribeInvocations",
                "ecs:RunCommand"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

This policy grants the following access:

  • ecs:DescribeInstances -- Query instance details to resolve the targets filter.

  • ecs:RunCommand -- Run shell or PowerShell scripts on the target instances.

  • ecs:DescribeInvocations and ecs:DescribeInvocationResults -- Monitor command status and retrieve output.

  • oos:GetApplicationGroup -- Retrieve application group information when targets are specified by application group.

Cross-OS behavior

The template detects each instance's operating system and runs the corresponding installer script.

Linux

  • Downloads logtail.sh from http://logtail-release-{regionId}.oss-{regionId}-internal.aliyuncs.com/linux64/logtail.sh.

  • On successful installation, outputs the contents of /usr/local/ilogtail/app_info.json.

  • Uses shell script execution (RunShellScript).

Windows

  • Downloads logtail_installer.zip from http://logtail-release-{regionId}.oss-{regionId}-internal.aliyuncs.com/win/logtail_installer.zip.

  • Extracts files to a temporary directory (C:\Users\Administrator\OOSPackages), runs the installer, and cleans up the temporary files.

  • Uses PowerShell script execution (RunPowerShellScript).

  • On Windows, upgrade performs a full uninstall followed by a reinstall.

Troubleshooting

Issue

Possible cause

Solution

Failed to download logtail_installer, Please check your network service.

The ECS instance cannot reach the internal OSS endpoint for the specified region.

Verify that the instance has internal network access to logtail-release-{regionId}.oss-{regionId}-internal.aliyuncs.com.

already has LogAgent

Logtail is already installed and overwrite is false.

Set overwrite to true to reinstall, or use upgrade to update to the latest version.

Command timeout or failure

Cloud Assistant may not be running on the target instance, or the instance may be stopped.

Verify that the instance is in the Running state and that Cloud Assistant is installed and running.

Permission denied errors

The user or OOSAssumeRole role lacks the required permissions.

Attach the RAM policy listed in Required permissions.

Template source

For the full YAML template, see ACS-ECS-BulkyInstallLogAgent.yml on GitHub.