congress/library/pause_disallowed_flavors.yaml
Eric Kao 842bafdb7f fix YAML format in library policy
Change-Id: Idaa6782eed8b0e26a9dd55fbf87ae78f650fc22d
2017-07-12 15:53:46 -07:00

17 lines
684 B
YAML

---
name: PauseBadFlavors
description: "Pause any server using a flavor that is not permitted"
rules:
-
comment: "User should customize this. Permitted flavors."
rule: permitted_flavor('m1.tiny')
-
comment: "User should customize this. Permitted flavors."
rule: permitted_flavor('m1.large')
-
rule: >
server_with_bad_flavor(id) :- nova:servers(id=id,flavor_id=flavor_id),
nova:flavors(id=flavor_id, name=flavor), not permitted_flavor(flavor)
-
comment: "Remediation: Pause any VM that shows up in the server_with_bad_flavor table"
rule: "execute[nova:servers.pause(id)] :- server_with_bad_flavor(id), nova:servers(id,status='ACTIVE')"