Skip to content

Commit ad32ad4

Browse files
committed
Improve ONTAP benchmark protocol selection
1 parent 436cf62 commit ad32ad4

6 files changed

Lines changed: 29 additions & 36 deletions

File tree

‎private-cicd/benchmark/ontap/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ real lab IPs/credentials or run output.
102102

103103
`run.py` is the entry point. Protocols, checkpoints, and concurrency levels
104104
come from `config.yaml` (`ontap` / `benchmark` for pools, `vm_bench` for
105-
VMs). Drop a protocol block to skip it, and edit `sequential_checkpoints` or
105+
VMs). Set `enabled_protocols` under `benchmark` or `vm_bench` to select
106+
`[nfs3]`, `[iscsi]`, or `[nfs3, iscsi]`, and edit `sequential_checkpoints` or
106107
`concurrency_levels` to change the matrix.
107108

108109
Run ids are generated as `RUN_<UTC timestamp>_<4 hex chars>` (for example

‎private-cicd/benchmark/ontap/benchmark_vm_instance_concurrency.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
load_config,
7575
make_cloudstack_client,
7676
RawLogger,
77-
report_failed_creates,
7877
resolve_protocols,
7978
)
8079

@@ -122,7 +121,6 @@ def run_concurrency(client, cfg, protocol_key, run_id, raw_logger, summary_rows,
122121
)
123122
for r in fail:
124123
log.error("%s: %s", r.vm_name, r.error)
125-
report_failed_creates([(r.vm_name, r.vm_id) for r in fail])
126124

127125
log.info("[6.2.2] Parallel DELETE protocol=%s C=%s", protocol_key, len(succ))
128126
t0 = time.perf_counter()

‎private-cicd/benchmark/ontap/benchmark_vm_instance_sequential.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
load_config,
7171
make_cloudstack_client,
7272
RawLogger,
73-
report_failed_creates,
7473
resolve_protocols,
7574
)
7675

@@ -86,7 +85,6 @@ def run_sequential(client, cfg, protocol_key, run_id, raw_logger, summary_rows,
8685
prefix = vm_cfg["vm_name_prefix"]
8786

8887
created = []
89-
failed = []
9088
create_durations = []
9189
log.info("[5.2.1] Sequential CREATE protocol=%s up to N=%s", protocol_key, max_n)
9290
for i in range(1, max_n + 1):
@@ -100,7 +98,6 @@ def run_sequential(client, cfg, protocol_key, run_id, raw_logger, summary_rows,
10098
create_durations.append(result.duration_sec)
10199
else:
102100
log.error("%s", result.error)
103-
failed.append((name, result.vm_id))
104101
if i in checkpoints:
105102
total = sum(create_durations)
106103
avg = mean_seconds(create_durations)
@@ -117,8 +114,6 @@ def run_sequential(client, cfg, protocol_key, run_id, raw_logger, summary_rows,
117114
if delay:
118115
time.sleep(delay)
119116

120-
report_failed_creates(failed)
121-
122117
total_created = len(created)
123118
log.info("[5.2.2] Sequential DELETE protocol=%s from N=%s remaining", protocol_key, total_created)
124119
if total_created in checkpoints:

‎private-cicd/benchmark/ontap/config.example.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ ontap:
7676

7777
benchmark:
7878
pool_name_prefix: "bench_ontap" # ONTAP volume names disallow "-"; use "_" only
79+
# Select any configured protocols without deleting their ontap blocks.
80+
enabled_protocols: [nfs3, iscsi]
7981
# Checkpoints and concurrency levels are the combinations for a run.
8082
# Change them here.
8183
sequential_checkpoints: [1, 5, 10, 20, 30]
@@ -108,6 +110,8 @@ vm_bench:
108110
# Unattached data disks are deleted only from pools with this name prefix,
109111
# and only when that pool's provider and zone match this config.
110112
cleanup_pool_name_prefix: "bench_vm"
113+
# Select any configured protocols without deleting their offering definitions.
114+
enabled_protocols: [nfs3, iscsi]
111115
sequential_checkpoints: [1, 5, 10, 20]
112116
concurrency_levels: [2, 5, 10]
113117
inter_op_delay_sec: 0

‎private-cicd/benchmark/ontap/storage_pool_common.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,16 @@ def load_config(path):
244244
def resolve_protocols(cfg, requested):
245245
available = list(cfg.get("ontap", {}).keys())
246246
if requested == "both":
247-
return available
247+
enabled = cfg.get("benchmark", {}).get("enabled_protocols", available)
248+
unknown = [protocol for protocol in enabled if protocol not in available]
249+
if unknown:
250+
sys.exit(
251+
f"Unknown config.benchmark.enabled_protocols entries: {unknown} "
252+
f"(available: {available})"
253+
)
254+
if not enabled:
255+
sys.exit("config.benchmark.enabled_protocols must contain at least one protocol")
256+
return enabled
248257
if requested not in available:
249258
sys.exit(f"Protocol '{requested}' not found in config.ontap (available: {available})")
250259
return [requested]

‎private-cicd/benchmark/ontap/vm_instance_common.py‎

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,9 @@ def build_deploy_vm_params(name, infra_cfg, vm_cfg, proto_cfg):
8888

8989
def _extract_vm_id_from_error(error_text):
9090
"""When deployVirtualMachine's async job fails deep in orchestration (for example
91-
an ENOSPC-driven "Unable to orchestrate the start of VM instance" failure),
92-
CloudStack has ALREADY created the VM (and its ROOT/DATA volume records) before
93-
the failure - it just never finished starting it. The job's errortext embeds
94-
that VM's uuid (e.g. '...{"instanceName":"i-2-107-VM", "uuid":"b8f4..."}.'),
95-
so scrape it out here so the leftover VM/volume can at least be identified and
96-
reported for manual inspection (see report_failed_creates()) instead of being
97-
silently invisible."""
91+
an "Unable to orchestrate the start of VM instance" failure), its errortext
92+
can embed the attempted VM's UUID. Preserve that UUID in the raw operation
93+
result even if CloudStack subsequently removes the failed VM."""
9894
if not error_text:
9995
return None
10096
m = _UUID_RE.search(error_text)
@@ -240,25 +236,6 @@ def append_summary_csv(path, rows):
240236
writer.writerows(rows)
241237

242238

243-
def report_failed_creates(failed):
244-
"""Failed deployVirtualMachine calls (for example ENOSPC "Unable to orchestrate
245-
the start of VM instance" failures) still leave a real
246-
VM + ROOT/DATA volume record behind in CloudStack - they just never finished
247-
starting. These are intentionally NOT auto-destroyed here (unlike the
248-
`created` list, which the benchmark itself deletes as part of 5.2.2/6.2.2) so
249-
the leftover VM/volume artifacts stay inspectable afterwards - e.g. via
250-
`listVolumes --state Destroy` on the bench_vm_<protocol> pool - to confirm
251-
exactly what got left behind and why. Clean them up manually (or via
252-
--cleanup-only) once you're done inspecting them."""
253-
log = get_logger()
254-
failed_with_id = [(name, vm_id) for name, vm_id in failed if vm_id]
255-
if not failed_with_id:
256-
return
257-
log.info("%s failed-create VM(s) left in place for inspection (not cleaned up)", len(failed_with_id))
258-
for name, vm_id in failed_with_id:
259-
log.info("left in place: %s (%s)", name, vm_id)
260-
261-
262239
def _vm_name_pattern(prefix):
263240
return re.compile(
264241
rf"^{re.escape(prefix)}-(?:seq|c\d+)-[A-Za-z0-9]+-[A-Za-z0-9-]+-\d{{3}}$"
@@ -368,7 +345,16 @@ def load_config(path):
368345
def resolve_protocols(cfg, requested):
369346
available = list(cfg.get("vm_bench", {}).get("protocols", {}).keys())
370347
if requested == "both":
371-
return available
348+
enabled = cfg.get("vm_bench", {}).get("enabled_protocols", available)
349+
unknown = [protocol for protocol in enabled if protocol not in available]
350+
if unknown:
351+
sys.exit(
352+
f"Unknown config.vm_bench.enabled_protocols entries: {unknown} "
353+
f"(available: {available})"
354+
)
355+
if not enabled:
356+
sys.exit("config.vm_bench.enabled_protocols must contain at least one protocol")
357+
return enabled
372358
if requested not in available:
373359
sys.exit(f"Protocol '{requested}' not found in config.vm_bench.protocols (available: {available})")
374360
return [requested]

0 commit comments

Comments
 (0)