ocs_ci.workloads package

Submodules

ocs_ci.workloads.vdbench module

class ocs_ci.workloads.vdbench.VdbenchWorkload(pvc, vdbench_config_file, namespace=None, image=None)

Bases: object

Vdbench workload implementation supporting both Block and Filesystem PVCs.

This class provides comprehensive Vdbench workload automation with support for: - User-provided PVC with configurable access modes - Vdbench configuration from YAML files using Jinja2 templates - Dynamic scaling operations - Pause/resume functionality - Error handling and logging

Parameters:
  • pvc (OCS) – PVC object to attach the workload to

  • vdbench_config_file (str) – Path to YAML configuration file for Vdbench

  • namespace (str, optional) – Kubernetes namespace (defaults to PVC namespace)

  • image (str, optional) – Container image for Vdbench workload

cleanup_workload()

Clean up all resources associated with the Vdbench workload.

This includes deployments, ConfigMaps, and temporary files.

Returns:

True if cleanup was successful, False otherwise

Return type:

bool

get_all_deployment_pod_logs()

Get logs from all pods belonging to the Vdbench workload deployment.

Returns:

Combined log output from all related pods

Return type:

str

get_workload_status()

Get current status of the Vdbench workload.

Returns:

Workload status information

Return type:

dict

pause_workload()

Pause the Vdbench workload by scaling to 0 replicas.

Raises:

UnexpectedBehaviour – If pause operation fails

resume_workload()

Resume the Vdbench workload by scaling back to previous replica count.

Raises:

UnexpectedBehaviour – If resume operation fails

scale_down_pods(desired_count)

Scale down the Vdbench workload to the desired number of replicas.

Parameters:

desired_count (int) – Target number of replicas

Raises:

UnexpectedBehaviour – If scaling operation fails

scale_up_pods(desired_count)

Scale up the Vdbench workload to the desired number of replicas.

Parameters:

desired_count (int) – Target number of replicas

Raises:

UnexpectedBehaviour – If scaling operation fails

start_workload()

Start the Vdbench workload by creating ConfigMap and Deployment.

Raises:

Exception – If workload fails to start or pods don’t become ready

stop_workload()

Stop the Vdbench workload by deleting the deployment.

Raises:

UnexpectedBehaviour – If stop operation fails

Module contents