Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions docker/Dockerfile_base
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ RUN pip3 install setuptools --upgrade
COPY requirements.txt requirements.txt

RUN pip3 install -r requirements.txt

RUN rm -rf /usr/share/terminfo/
20 changes: 11 additions & 9 deletions simplyblock_core/cluster_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ def create_cluster(blk_size, page_size_in_blocks, cli_pass,

cluster.write_to_db(db_controller.kv_store)

qos_controller.add_class("Default", 100, cluster.get_id())

cluster_events.cluster_create(cluster)

mgmt_node_ops.add_mgmt_node(dev_ip, mode, cluster.uuid)
Expand Down Expand Up @@ -639,11 +637,11 @@ def cluster_activate(cl_id, force=False, force_lvstore_create=False) -> None:

if cluster.is_qos_set():
for node in db_controller.get_storage_nodes_by_cluster_id(cl_id):
if node.status == StorageNode.STATUS_ONLINE:
logger.info(f"Setting Alcemls QOS weights on node {node.get_id()}")
ret = node.rpc_client().alceml_set_qos_weights(qos_controller.get_qos_weights_list(cl_id))
if node.status in [StorageNode.STATUS_ONLINE, StorageNode.STATUS_DOWN]:
logger.info(f"Setting Disribs QOS weights on node {node.get_id()}")
ret = node.rpc_client().distrib_set_qos_weights(qos_controller.get_qos_weights_list(cl_id))
if not ret:
logger.error(f"Failed to set Alcemls QOS on node: {node.get_id()}")
logger.error(f"Failed to set Disribs QOS on node: {node.get_id()}")

if not cluster.cluster_max_size:
cluster = db_controller.get_cluster_by_id(cl_id)
Expand Down Expand Up @@ -1176,9 +1174,13 @@ def update_cluster(cluster_id, mgmt_only=False, restart=False, spdk_image=None,
for service in cluster_docker.services.list():
if image_parts in service.attrs['Spec']['Labels']['com.docker.stack.image'] or \
"simplyblock" in service.attrs['Spec']['Labels']['com.docker.stack.image']:
logger.info(f"Updating service {service.name}")
service.update(image=service_image, force_update=True)
service_names.append(service.attrs['Spec']['Name'])
if service.name == "app_CachingNodeMonitor":
logger.info(f"Removing service {service.name}")
service.remove()
else:
logger.info(f"Updating service {service.name}")
service.update(image=service_image, force_update=True)
service_names.append(service.attrs['Spec']['Name'])

if "app_SnapshotMonitor" not in service_names:
logger.info("Creating snapshot monitor service")
Expand Down
17 changes: 12 additions & 5 deletions simplyblock_core/controllers/qos_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from simplyblock_core.db_controller import DBController
from simplyblock_core.models.cluster import Cluster
from simplyblock_core.models.qos import QOSClass
from simplyblock_core.models.storage_node import StorageNode

logger = logging.getLogger()
db = DBController()
Expand Down Expand Up @@ -34,11 +35,6 @@ def add_class(name: str, weight: int, cluster_id: str) -> bool:
logger.error("cluster_id is required")
return False

cluster = db.get_cluster_by_id(cluster_id)
if cluster.status != Cluster.STATUS_UNREADY:
logger.error(f"cluster must be in state UNREADY, current status is {cluster.status}")
return False

qos_classes = db.get_qos(cluster_id)
if len(qos_classes) >= 7:
logger.error("Can not add more than 6 qos classes")
Expand All @@ -60,6 +56,17 @@ def add_class(name: str, weight: int, cluster_id: str) -> bool:
qos_class.weight = weight
qos_class.write_to_db()

cluster = db.get_cluster_by_id(cluster_id)
if cluster.status in [Cluster.STATUS_ACTIVE, Cluster.STATUS_READONLY, Cluster.STATUS_DEGRADED]:
logger.error(f"cluster status is {cluster.status}, applying qos")
weighs_list = get_qos_weights_list(cluster_id)
for node in db.get_storage_nodes_by_cluster_id(cluster_id):
if node.status in [StorageNode.STATUS_ONLINE, StorageNode.STATUS_DOWN]:
logger.info(f"Setting Disribs QOS weights on node {node.get_id()}")
ret = node.rpc_client().distrib_set_qos_weights(weighs_list)
if not ret:
logger.error(f"Failed to set Disribs QOS on node: {node.get_id()}")

return True


Expand Down
2 changes: 1 addition & 1 deletion simplyblock_core/env_var
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SIMPLY_BLOCK_COMMAND_NAME=sbcli-dev
SIMPLY_BLOCK_VERSION=19.2.23
SIMPLY_BLOCK_VERSION=19.2.24

SIMPLY_BLOCK_DOCKER_IMAGE=public.ecr.aws/simply-block/simplyblock:main
SIMPLY_BLOCK_SPDK_ULTRA_IMAGE=public.ecr.aws/simply-block/ultra:main-latest
Expand Down
2 changes: 1 addition & 1 deletion simplyblock_core/models/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Cluster(BaseModel):
distr_npcs: int = 0
enable_node_affinity: bool = False
grafana_endpoint: str = ""
mode: str = ""
mode: str = "docker"
grafana_secret: str = ""
contact_point: str = ""
ha_type: str = "single"
Expand Down
12 changes: 6 additions & 6 deletions simplyblock_core/rpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,11 @@ def create_lvol(self, name, size_in_mib, lvs_name, lvol_priority_class=0, ndcs=0
"clear_method": "unmap",
"lvol_priority_class": lvol_priority_class,
}
# if ndcs or npcs:
# params.update({
# 'ndcs' : ndcs,
# 'npcs' : npcs,
# })
if ndcs or npcs:
params.update({
'ndcs' : ndcs,
'npcs' : npcs,
})
return self._request("bdev_lvol_create", params)

def delete_lvol(self, name, del_async=False):
Expand Down Expand Up @@ -1189,7 +1189,7 @@ def bdev_lvol_remove_from_group(self, group_id, lvol_name_list):
}
return self._request("bdev_lvol_remove_from_group", params)

def alceml_set_qos_weights(self, qos_weights):
def distrib_set_qos_weights(self, qos_weights):
params = {
"qos_weights": qos_weights,
}
Expand Down
12 changes: 6 additions & 6 deletions simplyblock_core/storage_node_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,10 +1259,10 @@ def add_node(cluster_id, node_addr, iface_name,data_nics_list,

# set qos values if enabled
if cluster.is_qos_set():
logger.info("Setting Alcemls QOS weights")
ret = rpc_client.alceml_set_qos_weights(qos_controller.get_qos_weights_list(cluster_id))
logger.info("Setting Disribs QOS weights")
ret = rpc_client.distrib_set_qos_weights(qos_controller.get_qos_weights_list(cluster_id))
if not ret:
logger.error("Failed to set Alcemls QOS")
logger.error("Failed to set Disribs QOS")
return False

logger.info("Connecting to remote devices")
Expand Down Expand Up @@ -1869,10 +1869,10 @@ def restart_storage_node(

# set qos values if enabled
if cluster.is_qos_set():
logger.info("Setting Alcemls QOS weights")
ret = rpc_client.alceml_set_qos_weights(qos_controller.get_qos_weights_list(snode.cluster_id))
logger.info("Setting Disribs QOS weights")
ret = rpc_client.distrib_set_qos_weights(qos_controller.get_qos_weights_list(snode.cluster_id))
if not ret:
logger.error("Failed to set Alcemls QOS")
logger.error("Failed to set Disribs QOS")
return False

logger.info("Connecting to remote devices")
Expand Down
Loading