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
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023-2025 simplyblock GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions docker/Dockerfile_base
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ RUN pip3 install setuptools --upgrade
COPY requirements.txt requirements.txt

RUN pip3 install -r requirements.txt

14 changes: 0 additions & 14 deletions docs/talos.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,12 @@ kubectl label namespace simplyblock \
--overwrite
```


Patch the host machine so that OpenEBS could work

Create a machine config patch with the contents below and save as patch.yaml
```
cat > patch.yaml <<'EOF'
machine:
sysctls:
vm.nr_hugepages: "1024"
nodeLabels:
openebs.io/engine: mayastor
kubelet:
extraMounts:
- destination: /var/openebs/local
type: bind
source: /var/openebs/local
options:
- rbind
- rshared
- rw
EOF

talosctl -e <endpoint ip/hostname> -n <node ip/hostname> patch mc -p @patch.yaml
Expand Down
25 changes: 20 additions & 5 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 @@ -459,6 +457,7 @@ def add_cluster(blk_size, page_size_in_blocks, cap_warn, cap_crit, prov_cap_warn
cluster.strict_node_anti_affinity = strict_node_anti_affinity

default_cluster = clusters[0]
cluster.mode = default_cluster.mode
cluster.db_connection = default_cluster.db_connection
cluster.grafana_secret = monitoring_secret if default_cluster.mode == "kubernetes" else default_cluster.grafana_secret
cluster.grafana_endpoint = default_cluster.grafana_endpoint
Expand Down Expand Up @@ -1176,9 +1175,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 All @@ -1191,6 +1194,18 @@ def update_cluster(cluster_id, mgmt_only=False, restart=False, spdk_image=None,
networks=["host"],
constraints=["node.role == manager"]
)

if "app_TasksRunnerLVolSyncDelete" not in service_names:
logger.info("Creating lvol sync delete service")
cluster_docker.services.create(
image=service_image,
command="python simplyblock_core/services/tasks_runner_sync_lvol_del.py",
name="app_TasksRunnerLVolSyncDelete",
mounts=["/etc/foundationdb:/etc/foundationdb"],
env=["SIMPLYBLOCK_LOG_LEVEL=DEBUG"],
networks=["host"],
constraints=["node.role == manager"]
)
logger.info("Done updating mgmt cluster")

elif cluster.mode == "kubernetes":
Expand Down
5 changes: 3 additions & 2 deletions simplyblock_core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def get_config_var(name, default=None):
LVOL_NVME_CONNECT_NR_IO_QUEUES=3
LVOL_NVME_KEEP_ALIVE_TO=10
LVOL_NVME_KEEP_ALIVE_TO_TCP=7
LVOL_NVMF_PORT_START=int(os.getenv('LVOL_NVMF_PORT_START', 9100))
LVOL_NVMF_PORT_ENV = os.getenv("LVOL_NVMF_PORT_START", "")
LVOL_NVMF_PORT_START = int(LVOL_NVMF_PORT_ENV) if LVOL_NVMF_PORT_ENV else 9100
QPAIR_COUNT=32
CLIENT_QPAIR_COUNT=3
NVME_TIMEOUT_US=8000000
Expand Down Expand Up @@ -224,4 +225,4 @@ def get_config_var(name, default=None):

qos_class_meta_and_migration_weight_percent = 25

MIG_PARALLEL_JOBS = 16
MIG_PARALLEL_JOBS = 64
23 changes: 23 additions & 0 deletions simplyblock_core/controllers/tasks_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ def _add_task(function_name, cluster_id, node_id, device_id,
if task_id:
logger.info(f"Task found, skip adding new task: {task_id}")
return False
elif function_name == JobSchedule.FN_LVOL_SYNC_DEL:
task_id = get_lvol_sync_del_task(cluster_id, node_id, function_params['lvol_bdev_name'])
if task_id:
logger.info(f"Task found, skip adding new task: {task_id}")
return False

task_obj = JobSchedule()
task_obj.uuid = str(uuid.uuid4())
Expand Down Expand Up @@ -386,3 +391,21 @@ def get_jc_comp_task(cluster_id, node_id, jm_vuid=0):
if jm_vuid and "jm_vuid" in task.function_params and task.function_params["jm_vuid"] == jm_vuid:
return task.uuid
return False


def add_lvol_sync_del_task(cluster_id, node_id, lvol_bdev_name):
return _add_task(JobSchedule.FN_LVOL_SYNC_DEL, cluster_id, node_id, "",
function_params={"lvol_bdev_name": lvol_bdev_name}, max_retry=10)

def get_lvol_sync_del_task(cluster_id, node_id, lvol_bdev_name=None):
tasks = db.get_job_tasks(cluster_id)
for task in tasks:
if task.function_name == JobSchedule.FN_LVOL_SYNC_DEL and task.node_id == node_id :
if task.status != JobSchedule.STATUS_DONE and task.canceled is False:
if lvol_bdev_name:
if "lvol_bdev_name" in task.function_params and task.function_params["lvol_bdev_name"] == lvol_bdev_name:
return task.uuid
else:
return task.uuid
return False

4 changes: 2 additions & 2 deletions simplyblock_core/env_var
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SIMPLY_BLOCK_COMMAND_NAME=sbcli-dev
SIMPLY_BLOCK_VERSION=19.2.23
SIMPLY_BLOCK_VERSION=19.2.25

SIMPLY_BLOCK_DOCKER_IMAGE=public.ecr.aws/simply-block/simplyblock:main
SIMPLY_BLOCK_DOCKER_IMAGE=public.ecr.aws/simply-block/simplyblock:main-lvol-sync-delete
SIMPLY_BLOCK_SPDK_ULTRA_IMAGE=public.ecr.aws/simply-block/ultra:main-latest

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
1 change: 1 addition & 0 deletions simplyblock_core/models/job_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class JobSchedule(BaseModel):
FN_BALANCING_AFTER_DEV_REMOVE = "balancing_on_dev_rem"
FN_BALANCING_AFTER_DEV_EXPANSION = "balancing_on_dev_add"
FN_JC_COMP_RESUME = "jc_comp_resume"
FN_LVOL_SYNC_DEL = "lvol_sync_del"

canceled: bool = False
cluster_id: str = ""
Expand Down
1 change: 0 additions & 1 deletion simplyblock_core/models/storage_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class StorageNode(BaseNodeObject):
hublvol: HubLVol = None # type: ignore[assignment]
active_tcp: bool = True
active_rdma: bool = False
lvol_sync_del_queue: List[str] = []

def rpc_client(self, **kwargs):
"""Return rpc client to this node
Expand Down
14 changes: 7 additions & 7 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 @@ -922,7 +922,7 @@ def distr_migration_status(self, name):
params = {"name": name}
return self._request("distr_migration_status", params)

def distr_migration_failure_start(self, name, storage_ID, qos_high_priority=False, job_size=1024, jobs=4):
def distr_migration_failure_start(self, name, storage_ID, qos_high_priority=False, job_size=64, jobs=64):
params = {
"name": name,
"storage_ID": storage_ID,
Expand All @@ -935,7 +935,7 @@ def distr_migration_failure_start(self, name, storage_ID, qos_high_priority=Fals
params["jobs"] = jobs
return self._request("distr_migration_failure_start", params)

def distr_migration_expansion_start(self, name, qos_high_priority=False, job_size=1024, jobs=4):
def distr_migration_expansion_start(self, name, qos_high_priority=False, job_size=64, jobs=64):
params = {
"name": name,
}
Expand Down
5 changes: 0 additions & 5 deletions simplyblock_core/scripts/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ dependencies:
version: "25.18.0"
repository: "https://prometheus-community.github.io/helm-charts"
condition: monitoring.enabled
- name: openebs
version: 3.9.0
repository: https://openebs.github.io/charts
alias: openebs
condition: openebs.enabled
- name: ingress-nginx
version: 4.10.1
repository: "https://kubernetes.github.io/ingress-nginx"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: hostpath.csi.k8s.io
labels:
app.kubernetes.io/instance: hostpath.csi.k8s.io
app.kubernetes.io/part-of: csi-driver-host-path
app.kubernetes.io/name: hostpath.csi.k8s.io
app.kubernetes.io/component: csi-driver
spec:
# Supports persistent and ephemeral inline volumes.
volumeLifecycleModes:
- Persistent
- Ephemeral
# To determine at runtime which mode a volume uses, pod info and its
# "csi.storage.k8s.io/ephemeral" entry are needed.
podInfoOnMount: true
# No attacher needed.
attachRequired: false
storageCapacity: false
# Kubernetes may use fsGroup to change permissions and ownership
# of the volume to match user requested fsGroup in the pod's SecurityPolicy
fsGroupPolicy: File

Loading