Skip to content

Commit

Permalink
fix for etcd min disk size (#356)
Browse files Browse the repository at this point in the history
* fix for etcd min disk size

* fix doc and tests

---------

Co-authored-by: Gevorg-Khachatryaan <Gevorg1050.1>
Co-authored-by: alaa-bish <[email protected]>
  • Loading branch information
Gevorg-Khachatryan-97 and alaa-bish authored Jun 13, 2023
1 parent 01811fd commit c29f02c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions plugins/module_utils/karbon/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def validate_resources(resources, resource_type):
min_cpu = 4
min_memory = 8
min_disk_size = 120
min_etcd_disk_size = 40
err = "{0} cannot be less then {1}"
if (
resource_type == "master"
Expand All @@ -176,6 +177,10 @@ def validate_resources(resources, resource_type):
return None, err.format("cpu", min_cpu)
if resources["memory_gb"] < min_memory:
return None, err.format("memory_gb", min_memory)
if resources["disk_gb"] < min_disk_size:
return None, err.format("disk_gb", min_disk_size)
if resource_type == "etcd":
if resources["disk_gb"] < min_etcd_disk_size:
return None, err.format("disk_gb", min_etcd_disk_size)
else:
if resources["disk_gb"] < min_disk_size:
return None, err.format("disk_gb", min_disk_size)
return resources, None
2 changes: 1 addition & 1 deletion plugins/modules/ntnx_karbon_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
default: 4
disk_gb:
type: int
description: Size of local storage for each VM on the PE cluster in GiB.
description: Size of local storage for each VM on the PE cluster in GiB and the minimum size is 40 GIB.
default: 120
memory_gb:
type: int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
num_instances: 1
cpu: 4
memory_gb: 8
disk_gb: 120
disk_gb: 40
masters:
num_instances: 1
cpu: 4
Expand Down

0 comments on commit c29f02c

Please sign in to comment.