You can use cloud assistance commands to perform routine tasks for ECS instances. These tasks include fast execution of automatic maintenance scripts, process polling, resetting of user password, installation and uninstallation of software, application update, and patch installation. Command types can either be Bat or PowerShell for Windows, or Shell for Linux.
- Within an Alibaba Cloud region, you can create at most 100 cloud assistant commands.
- A script cannot exceed 16 KB after Base64 encoding.
To create a command on the ECS Console, take the following steps:
- Log on to the ECS console.
- In the left-side navigation pane, select Cloud Assistant.
- Select a region.
- Click Create Command, and in the right-side pop-up window.
- Input a command name, such as HelloECS.
- Input a command description, such as 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.
- Modify 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. The execution paths of Bat and PowerShell commands are by default set to the directory where the cloud assistant client is stored, such as
C:\ProgramData\aliyun\assist\$(version). Shell commands are by default in the
- Set the maximum timeout time (in seconds) for commands in an instance. The default value is set to 3600s. When a command you created cannot be run for some reason, the command times out. After the command times out, the command process will be forcibly terminated.
- After confirming the command, click OK.
You can also use the ESC API CreateCommand to create a cloud assistant command.