- Documentation
Auto Scaling
User Guide
Lifecycle hook
Creating lifecycle hooks
Lifecycle hook
Creating lifecycle hooks
Creating lifecycle hooks
Scenarios
This topic describes how to create a lifecycle hook used to suspend target instances in a scaling group during automatic scaling operations, enabling you to perform required custom actions.
Procedure
- In the top menu bar, select the project and region of the target resource.
- Click the name of the scaling group and select the "Lifecycle hook" tab.
- Click the "Create Lifecycle Hook" button and configure the parameters based on the table below.
- Click "Confirm" to complete the operation.
Operation result
After the lifecycle hook is triggered for a scaling group, select the "Instance Management" tab. Then, you can see that the corresponding instance changes to the "Adding/removal suspended" status. At this point, you can log in to the instance to perform custom operations.
When Cloud assistant is enabled for command execution, you can view the command execution result in the ECS console. For details, refer to Viewing job execution results. - If the command is executed before the lifecycle hook times out, the suspended status of instances ends immediately, and the scaling operation continues based on the "Continue" policy.
- If the command execution times out or fails before the lifecycle hook times out, the suspended status of instances ends immediately, and the scaling operation continues based on the execution policy of the lifecycle hook.
Related document
Last updated: 2026.06.24 17:08:50