《企业运维之弹性计算原理与实践》——第六章 OOS 与总结——第六章(下):运维编排 OOS 案例(1)

本文涉及的产品
系统运维管理,不限时长
简介: 《企业运维之弹性计算原理与实践》——第六章 OOS 与总结——第六章(下):运维编排 OOS 案例(1)

第六章(下):运维编排 OOS 案例


视频地址

https://developer.aliyun.com/learning/course/1039/detail/15320


一、 OOS 案例 1:告警驱动自动清理磁盘


架构说明

配置告警触当磁盘动到机器中

行的删除log 件。

告警触磁盘文件的能。


image.png


共模中的磁盘磁盘具体操作如


1) 进入 OOS 控制台,选择公共模版,找到清理磁盘模版,单击进入。


image.png


2) 查看 YAML 文件。


FormatVersion: OOS-2019-06-01
Description:
 en: Schedule to clean up disks
 zh-cn: 定时清理磁盘
 name-en: Cleanup Disks
 name-zh-cn: 清理磁盘
 categories:
 - time_trigger
 - application_manage
 - computenest
Parameters:
 timerTrigger: #定时处理
 Type: Json
 Label:
 en: TimerTrigger
 zh-cn: 定时类型
 AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
 regionId:
 Type: String
 Label:
 en: RegionId
 zh-cn: 地域 ID
 AssociationProperty: RegionId
 Default: '{{ ACS::RegionId }}'
 targets:
 Type: Json
 Label:
 en: TargetInstance 
 zh-cn: 目标实例
 AssociationProperty: Targets
 AssociationPropertyMetadata:
 ResourceType: ALIYUN::ECS::Instance
 RegionId: regionId
 cleanUpInfos: #清理数据配置
 Description:
 en: 'Format: 
3d|/root/log/|*.log,3h|/root/log/|*.access,30m|C:\Users\Administrator\log\|*.log.'
 zh-cn: 格式:3d|/root/log/|*.log,3h|/root/log/|*.access,30m|C:\Users\Administrator\log\|*.log
 Label:
 en: CleanUpRule
 zh-cn: 磁盘清理规则
 Type: String
 AssociationProperty: ALIYUN::OOS::Component::CleanUpInfo
 rateControl:
 Label:
 en: RateControl
 zh-cn: 任务执行的并发比率
 Type: Json
 AssociationProperty: RateControl
 Default:
 Mode: Concurrency
 MaxErrors: 0
 Concurrency: 10
 OOSAssumeRole:
 Label:
 en: OOSAssumeRole
 zh-cn: OOS 扮演的 RAM 角色
 Type: String
 Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks: #定义执行动作
 - Name: timerTrigger
 Action: ACS::TimerTrigger
 Description:
 en: Triggers a task as scheduled by specifying type and expression
 zh-cn: 通过指定触发类型和表达式按计划触发任务
 Properties:
 Type:
 Fn::Select:
 - type
 - '{{timerTrigger}}'
 Expression:
 Fn::Select:
 - expression 
 - '{{timerTrigger}}'
 EndDate:
 Fn::Select:
 - endDate
 - '{{ timerTrigger }}'
 TimeZone:
 Fn::Select:
 - timeZone
 - '{{ timerTrigger }}'
 - Name: getInstance
 Description:
 en: Views the ECS instances
 zh-cn: 获取 ECS 实例
 Action: ACS::SelectTargets
 Properties:
 ResourceType: ALIYUN::ECS::Instance
 RegionId: '{{ regionId }}'
 Filters:
 - '{{ targets }}'
 Outputs:
 instanceIds:
 Type: List
 ValueSelector: Instances.Instance[].InstanceId
 - Name: cleanUpDisk
 Action: ACS::ECS::CleanUpDisk
 Description:
 en: Execute cloud assistant command to clean up disk
 zh-cn: 执行云助手命令清理磁盘
 Properties:
 regionId: '{{ regionId }}'
 instanceId: '{{ ACS::TaskLoopItem }}'
 cleanUpInfos: '{{ cleanUpInfos }}'
 Loop:
 RateControl: '{{ rateControl }}'
 Items: '{{ getInstance.instanceIds }}'
 Outputs:
 commandOutputs:
 AggregateType: Fn::ListJoin
 AggregateField: commandOutput
 Outputs:
 commandOutput:
 Type: String
 ValueSelector: commandOutput
Outputs:
 commandOutputs: 
 Type: List
 Value: '{{ cleanUpDisk.commandOutputs }}'
Metadata:
 ALIYUN::OOS::Interface:
 ParameterGroups:
 - Parameters:
 - timerTrigger
 Label:
 default:
 zh-cn: 清理时间
 en: The time of cleanup disk
 - Parameters:
 - cleanUpInfos
 Label:
 default:
 zh-cn: 设置规则
 en: The rule of cleanup disk
 - Parameters:
 - regionId
 - targets
 Label:
 default:
 zh-cn: 选择实例
 en: Select ECS Instances
 - Parameters:
 - rateControl
 - OOSAssumeRole
 Label:
 default:
 zh-cn: 高级选项
 en: Control Options 

《企业运维之弹性计算原理与实践》——第六章 OOS 与总结——第六章(下):运维编排 OOS 案例(2) https://developer.aliyun.com/article/1231367?groupCode=supportservice



《企业运维之弹性计算原理与实践》——第六章 OOS 与总结——第六章(下):运维编排 OOS 案例(2) https://developer.aliyun.com/article/1231367?groupCode=supportservice

相关文章
|
4月前
|
弹性计算 运维 安全
带你读《云上自动化运维宝典》——如何使用OOS有效进行云上自动化运维(2)
带你读《云上自动化运维宝典》——如何使用OOS有效进行云上自动化运维(2)
272 1
|
4月前
|
弹性计算 运维 监控
带你读《云上自动化运维宝典》——如何使用OOS有效进行云上自动化运维(1)
带你读《云上自动化运维宝典》——如何使用OOS有效进行云上自动化运维(1)
290 0
|
11月前
|
运维 监控 Linux
云计算运维工程师简历怎么写?带简历案例
云计算运维工程师简历怎么写?带简历案例
1169 0
|
3月前
|
运维 监控
如何使用OOS有效进行云上自动化运维
OOS(运维编排服务)是一种云上自动化运维工具,可以帮助你有效进行云资源的管理和维护。以下是如何使用OOS有效进行云上自动化运维的一些建议: 1. **利用自动化能力**:OOS提供了批量操作、
|
1月前
|
弹性计算 运维 监控
通过阿里云OOS“快速设置”快速配置多地域运维任务
阿里云OOS的快速设置功能助力用户简便配置多地域运维任务,如云监控安装、配置收集与补丁扫描,定时开关机,周期性带宽升级,实现自动化管理,确保配置一致性,提升运维效率。
|
2月前
|
人工智能 运维 自然语言处理
|
4月前
|
弹性计算 运维 安全
如何使用OOS有效进行云上自动化运维
阿里云弹性计算团队十三位产品专家和技术专家共同分享云上运维深度实践,详细阐述如何利用CloudOps工具实现运维提效、弹性降本。
134118 220
|
4月前
|
存储 运维 容灾
带你读《云上自动化运维宝典》——一文详解云上跨可用区容灾解决方案和异地多活能力建设最佳案例(3)
带你读《云上自动化运维宝典》——一文详解云上跨可用区容灾解决方案和异地多活能力建设最佳案例(3)
183 0
|
4月前
|
人工智能 运维 应用服务中间件
Awk使用案例总结(运维必会)
Awk使用案例总结(运维必会)
|
4月前
|
弹性计算 运维 容灾
带你读《云上自动化运维宝典》——一文详解云上跨可用区容灾解决方案和异地多活能力建设最佳案例(1)
带你读《云上自动化运维宝典》——一文详解云上跨可用区容灾解决方案和异地多活能力建设最佳案例(1)
245 1

热门文章

最新文章