问题描述
我定义了伸缩组配置和实例配置,并将它们合并为一个模板数据。我不知道这样做是否合理。对于某些功能,官员最好使用单独的模板。
{
"disable_rollback": true,"files": {},"parameters": {},"stack_name": "test","template": {
"description": "Example auto scale group,policy and alarm","heat_template_version": "rocky","resources": {
"cpu_alarm_high": {
"properties": {
"aggregation_method": "mean","alarm_actions": [
{
"get_attr": [
"scaleup_policy","alarm_url"
]
}
],"comparison_operator": "gt","description": "Scale up if CPU > 50%","evaluation_periods": 1,"granularity": 300,"metric": "cpu_util","query": {
"list_join": ["",[{"=": {"server_group": {"get_param": "OS::stack_id"}}}]]
},"resource_type": "instance","threshold": 50
},"type": "OS::Aodh::GnocchiAggregationByResourcesAlarm"
},"cpu_alarm_low": {
"properties": {
"aggregation_method": "mean","alarm_actions": [
{
"get_attr": [
"scaledown_policy","comparison_operator": "lt","description": "Scale sown if CPU < 15% for 1 minute","threshold": 15
},"scaledown_policy": {
"properties": {
"adjustment_type": "change_in_capacity","auto_scaling_group_id": {
"get_resource": "scaleup_group"
},"cooldown": 60,"scaling_adjustment": -1
},"type": "OS::Heat::ScalingPolicy"
},"scaleup_group": {
"properties": {
"cooldown": 60,"desired_capacity": 1,"max_size": 3,"min_size": 1,"resource": {
"properties": {
"admin_pass": "xxxxxx","block_device_mapping": [{
"delete_on_termination": "true","device_name": "vda","volume_id": {
"get_resource": "volume"
}
}],"flavor": "99bad899-8d60-468e-b405-30ad33a76077","networks": [
{
"network": "external-net"
}
],"metadata": {
"metering.server_group": {
"get_param": "OS::stack_id"
}
}
},"type": "OS::Nova::Server"
}
},"type": "OS::Heat::AutoScalingGroup"
},"scaleup_policy": {
"properties": {
"adjustment_type": "change_in_capacity","scaling_adjustment": 1
},"volume": {
"properties": {
"image": "trinet-centos76","size": 10
},"type": "OS::Cinder::Volume"
}
},"outputs": {
"scale_up_url": {
"description": "This URL is the webhook to scale up the autoscaling group. You can invoke the scale-up operation by doing an HTTP POST to this URL; no body nor extra headers are needed.","value": {"get_attr": ["scaleup_policy","alarm_url"]}
},"scale_dn_url": {
"description": "This URL is the webhook to scale down the autoscaling group. You can invoke the scale-down operation by doing an HTTP POST to this URL; no body nor extra headers are needed.","value": {"get_attr": ["scaledown_policy","alarm_url"]}
}
}
}
}
可以通过curl命令使用上述json数据来创建堆栈。但是,当警报缩放扩展实例时,热引擎将使用旧实例使用的卷来创建新实例,从而导致无效的卷:接收到无效的输入。 enter image description here。
我觉得我使用热量的方式是错误的,但是没有解决的办法。谁能指出我正确的方向?谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)