You can detect whether a stack instance in a stack group differs from its expected configuration or has drifted.
Prerequisites
Background information
When ROS performs drift detection on a stack group, stacks associated with instances in the stack group are also detected for drift. ROS compares the current and expected configuration of each resource within the stack based on the template and specified parameters. If the current configuration differs from the expected configuration, the resource is considered to have drifted.
- A stack and its associated stack instances are considered to have drifted if one or more of its resources have drifted.
- A stack group is considered to have drifted if one or more of its stack instances have drifted.
Drift refers to changes in stack configurations that are not performed by using ROS. Changes directly made by using ROS to individual stacks are not considered drift. These changes do not include changes made to stack groups. For example, assume that you have a stack that is associated with a stack instance in a stack group. If you use ROS to change the stack based on a different template, the stack is not considered to have drifted even if this stack has a different template from other stacks within the same stack group. This is because the stack still matches its expected template and parameter configurations in ROS.
During the drift detection on a stack group, each stack within the stack group is detected for drift. Property values that overwrite the original ones specified in the template are used by ROS for drift detection on the stack. If you perform drift detection directly on stacks associated with stack instances, you cannot view the drift results on the Stack Groups page.
Detect drift in the ROS console
Detect drift by using Alibaba Cloud CLI
You can run the following aliyun ros
commands by using Alibaba Cloud Command Line Interface (Alibaba Cloud CLI) to detect
drift on a stack group.
Command | Description |
---|---|
DetectStackGroupDrift |
Initiates a drift detection operation on a stack group. |
GetStackGroupOperation |
Queries the status of the drift detection operation on a stack group. |
StopStackGroupOperation |
Stops a drift detection operation on a stack group. |
After the drift detection operation is complete, you can use the following subcommands to query the required drift information:
- You can use the
GetStackGroup
subcommand to query detailed information about the stack group, including details about the last completed drift detection operation on the stack group. Information about drift detection operations in progress is not included. - You can use the
ListStackInstances
subcommand to query the list of instances within a stack group as well as the drift status and last drift detection time of each instance. - You can use the
GetStackInstance
subcommand to query detailed information about a specified stack instance, including its drift status and last drift detection time.