You can use cloud assistance commands to perform routine tasks for ECS instances, such as execution of automatic maintenance scripts, process polling, resetting of user passwords, installation and removal of software, application updates, and patch installations. Command types can either be Bat or PowerShell for Windows, or Shell for Linux.
- Each Alibaba Cloud region can support up to 100 cloud assistant commands.
- A script cannot exceed 16 KB after being Base64 encoded.
To create a command on the ECS Console, follow these steps:
- Log on to the ECS console.
- In the left-side navigation pane, select Cloud Assistant.
- Select the target region.
- Click Create Command and then perform the following actions:
- Enter a Command Name, for example, HelloECS.
- Enter a Command Description, for example, UserGuide.
- Click the icon, and select command type from the drop-down list. For Windows instances, you can select either Bat or PowerShell. For Linux instances, you must select Shell.
- Enter or paste the contents of your command, such as:
echo hello ECS! echo root:NewPasswd9! | chpasswd echo Remmember your password!
- Determine the Execution Path of the command. By default, the execution paths of Bat and PowerShell commands are set to the directory where the cloud assistant client is stored, such as
C:\ProgramData\aliyun\assist\$(version). Additionally, shell commands are in the
/rootdirectory by default.
- Set the value for the maximum timeout time (in seconds) for commands in an instance. The default value is 3600. If a command times out, the command process will be forcibly terminated.
- Confirm the command details and then click Create.
You can also use the ESC API CreateCommand to create a cloud assistant command.