Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregated rules consumed by Castellum #5361

Merged
merged 6 commits into from
Sep 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# vim: set ft=yaml:

groups:
- name: castellum_manila
rules:

# Case one: old provision style, where snapshot reserve is allocated AS PART OF the target share size and snapshot reserver percentage is 5.
# The logical space reporting/enforcement is always disabled for them.
# Share size = netapp_volume_total_bytes + netapp_volume_snapshot_reserved_bytes
# Share usage = netapp_volume_used_bytes
- record: netapp_volume_provision_case_one
expr: netapp_volume_percentage_snapshot_reserve{share_id!="", volume=~"share.*"} / 5 == 1

- record: manila_share_size_bytes_for_castellum
expr: netapp_volume_provision_case_one * (netapp_volume_total_bytes + netapp_volume_snapshot_reserved_bytes)

- record: manila_share_used_bytes_for_castellum
expr: netapp_volume_provision_case_one * netapp_volume_used_bytes

# We don't monitor the minimal size in particular for shares in case one, they trun to other cases once resized.
- record: manila_share_minimal_size_bytes_for_castellum
expr: netapp_volume_provision_case_one * (netapp_volume_total_bytes + netapp_volume_snapshot_reserved_bytes)

# Case two: new provision style and logical space is NOT enabled
# New provision style means snapshot reserve is allocated IN ADDTION TO share size, and sanpshot reserve percentage is 50
# To avoid snapshot spill, share's minimal size must be larger than the snapshot used size.
# Share size = netapp_volume_total_bytes
# Share usage = netapp_volume_used_bytes
# Share minimal size = max(netapp_volume_total_bytes, netapp_volume_snapshot_used_bytes)
- record: netapp_volume_provision_case_two
expr: (netapp_volume_percentage_snapshot_reserve{share_id!="", volume=~"share.*"} / 50 == 1) * (1 + netapp_volume_is_space_enforcement_logical == 1)
majewsky marked this conversation as resolved.
Show resolved Hide resolved

- record: manila_share_size_bytes_for_castellum
expr: netapp_volume_provision_case_two * netapp_volume_total_bytes

- record: manila_share_used_bytes_for_castellum
expr: netapp_volume_provision_case_two * netapp_volume_used_bytes

- record: manila_share_minimal_size_bytes_for_castellum
expr: netapp_volume_provision_case_two * on (share_id) group_left max({__name__=~"netapp_volume_total_bytes|netapp_volume_snapshot_used_bytes"}) by (share_id)

# Case three: new provision style and logical space enabled
# To avoid snapshot spill, share's minimal size must be larger than the snapshot used size.
# Share size = netapp_volume_total_bytes
# Share usage = netapp_volume_logical_used_bytes
# Share minimal size = max(netapp_volume_total_bytes, netapp_volume_snapshot_used_bytes)
- record: netapp_volume_provision_case_three
expr: (netapp_volume_percentage_snapshot_reserve{share_id!="", volume=~"share.*"} / 50 == 1) * (netapp_volume_is_space_enforcement_logical == 1)

- record: manila_share_size_bytes_for_castellum
expr: netapp_volume_provision_case_three * netapp_volume_total_bytes

- record: manila_share_used_bytes_for_castellum
expr: netapp_volume_provision_case_three * netapp_volume_logical_used_bytes

- record: manila_share_minimal_size_bytes_for_castellum
expr: netapp_volume_provision_case_three * on (share_id) group_left max({__name__=~"netapp_volume_total_bytes|netapp_volume_snapshot_used_bytes"}) by (share_id)