Split disallowed flavor policy into monitor and remediation
Some users want the monitoring but not the remediation Partially implements: blueprint policy-library Partial-Bug: 1669948 Change-Id: Id14b2148f6ce41e9ffbd23d403fb4d5ebfb840da
This commit is contained in:
parent
aa1aad9bff
commit
c7e13f4947
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
name: PauseBadFlavors
|
name: BadFlavors
|
||||||
description: "Pause any server using a flavor that is not permitted"
|
description: "Error on any server using a flavor that is not permitted"
|
||||||
rules:
|
rules:
|
||||||
-
|
-
|
||||||
comment: "User should customize this. Permitted flavors."
|
comment: "User should customize this. Permitted flavors."
|
||||||
|
@ -13,5 +13,5 @@ rules:
|
||||||
server_with_bad_flavor(id) :- nova:servers(id=id,flavor_id=flavor_id),
|
server_with_bad_flavor(id) :- nova:servers(id=id,flavor_id=flavor_id),
|
||||||
nova:flavors(id=flavor_id, name=flavor), not permitted_flavor(flavor)
|
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: >
|
||||||
rule: "execute[nova:servers.pause(id)] :- server_with_bad_flavor(id), nova:servers(id,status='ACTIVE')"
|
error(id) :- server_with_bad_flavor(id)
|
|
@ -0,0 +1,12 @@
|
||||||
|
---
|
||||||
|
name: PauseBadFlavors
|
||||||
|
description: "Pause any server using a flavor that is not permitted"
|
||||||
|
depends-on:
|
||||||
|
- BadFlavors
|
||||||
|
rules:
|
||||||
|
-
|
||||||
|
comment: "Remediation: Pause any VM that shows up in the server_with_bad_flavor table"
|
||||||
|
rule: >
|
||||||
|
execute[nova:servers.pause(id)] :-
|
||||||
|
BadFlavors:server_with_bad_flavor(id),
|
||||||
|
nova:servers(id,status='ACTIVE')
|
Loading…
Reference in New Issue