Alibaba Cloud Spot Instance Survival Inspection
Background
Since the market price of spot instances fluctuates with supply and demand, it is necessary to specify a bidding model when creating a spot instance. A spot instance can only be successfully created when the real-time market price for the specified instance type is lower than the bid and the inventory is sufficient. Therefore, the inspection of cloud assets' spot instances becomes particularly important. Through inspections, when it is found that a spot instance is about to be released, it will prompt the latest prices of all available zones for the current specification of the spot instance as well as the historical prices of the spot instance and provide appropriate handling suggestions.
Prerequisites
- Offline deployment of DataFlux Func
- Enable the [Script Market] in self-built DataFlux Func(../script-market-basic-usage/)
- Create an API Key for operations in the "TrueWatch" "Management / API Key Management"
- Install the "Self-built Inspection Core Package", "Algorithm Library", and "Self-built Inspection (Alibaba Cloud Spot Instance Survival Detection)" through the "Script Market" in the self-built DataFlux Func
- Write a self-built inspection processing function in the self-built DataFlux Func
- Create a scheduled task (Old version: Automatic Trigger Configuration) for the written function through "Management / Scheduled Tasks (Old version: Automatic Trigger Configuration)" in the self-built DataFlux Func
If you consider using a cloud server for offline deployment of DataFlux Func, please ensure it is deployed with the currently used TrueWatch SaaS in the same operator and region
Configure Inspection
Create a new script set in the self-built DataFlux Func to enable the configuration of Alibaba Cloud Spot Instance Survival Inspection.
Python | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
Start Inspection
After configuring the inspection in DataFlux Func, you can test it by selecting the run()
method directly on the page and running it. After clicking publish, you can view and configure it in the DataFlux Func "Management / Scheduled Tasks".
View Events
The inspection will generate corresponding events based on the status of the current spot instance. When a spot instance about to be released is discovered, Intelligent Inspection will generate relevant events, which can then be viewed in the "Event Center".
Event Details
- Event Overview: Describes the object and content of the abnormal inspection event
- Spot Instance Details: View detailed information about the current instance including instance name, ID, region, availability zone, etc.
- Spot Instance Type Price: View the prices of all available zones under the current specification to assist users in bidding
- Spot Instance Type Historical Price: View the historical prices of the spot instance under different available zones for the current specification to track price changes
- Warm Suggestions: Provide operational suggestions for the current abnormal scenario
Common Issues
1. How to configure the detection frequency of Alibaba Cloud Spot Instance Survival Inspection
- In the self-built DataFlux Func, add
fixed_crontab='*/2 * * * *', timeout=60
in the decorator while writing the self-built inspection processing function, then configure it in "Management / Scheduled Tasks (Old version: Automatic Trigger Configuration)".
2. There may be no abnormal analysis when Alibaba Cloud Spot Instance Survival Inspection is triggered
When there is no abnormal analysis in the inspection report, check the data collection status of the current datakit
.
3. During the inspection process, previously normally running scripts encounter abnormal errors
Update the referenced script sets in the Script Market of DataFlux Func. You can view the update records of the Script Market through the Change Log to facilitate timely updates to the scripts.