Skip to content

Commit 8395e72

Browse files
committed
Address ONTAP benchmark review comments
1 parent 2b4070e commit 8395e72

15 files changed

Lines changed: 831 additions & 427 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
# ONTAP scale benchmark
20+
21+
- Refer to the scale matrix from `README.md` and `USAGE.md` only.
22+
- Protocols, checkpoints, and concurrency levels live in `config.yaml`. `run.py` is the entry point. Do not add a CLI flag for a field that already exists in config.
23+
- Use `benchmark_support` for run ids, resource names, `mean_seconds`, and logging. Sequential and concurrency scripts must use the same helpers and the same log format. Do not hand-roll a second average or a second logger.
24+
- Run ids are letters, digits, and underscores. Storage pool names disallow `-`. VM hostnames disallow `_`; `format_vm_name` / `vm_name_token` are the only rewrite, and cleanup must use them so created VMs are the ones deleted.
25+
- Cleanup must stay inside the configured name prefix, zone, cluster (pools), and storage provider. Do not delete a resource just because its name contains a short substring.

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

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -100,51 +100,52 @@ real lab IPs/credentials or run output.
100100

101101
## Running
102102

103-
```bash
104-
# Sanity-check either script/config without hitting a real management server:
105-
python3 benchmark_storage_pool_sequential.py --config config.yaml --dry-run
106-
python3 benchmark_storage_pool_concurrency.py --config config.yaml --dry-run
103+
`run.py` is the entry point. Protocols, checkpoints, and concurrency levels
104+
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
106+
`concurrency_levels` to change the matrix.
107107

108-
# Sequential scale matrix, both protocols, up to config's sequential_checkpoints:
109-
python3 benchmark_storage_pool_sequential.py --config config.yaml
108+
Run ids are generated as `RUN_<UTC timestamp>_<4 hex chars>` (for example
109+
`RUN_20260927_081500_a1b2`). Letters, digits, and underscores only: a hyphen
110+
is rewritten to `_` because it is embedded in the storage pool name. Reuse
111+
one id across sequential and concurrency when you want a single report.
110112

111-
# Sequential scale matrix, NFS3 only:
112-
python3 benchmark_storage_pool_sequential.py --config config.yaml --protocol nfs3
113+
```bash
114+
# Sanity-check without hitting a real management server:
115+
python3 run.py --test storage-pool-sequential --config config.yaml --dry-run
116+
python3 run.py --test storage-pool-concurrency --config config.yaml --dry-run
113117

114-
# Concurrency matrix, both protocols, up to config's concurrency_levels (e.g. 30):
115-
python3 benchmark_storage_pool_concurrency.py --config config.yaml
118+
# Sequential scale matrix, using the protocols and checkpoints in config.yaml:
119+
python3 run.py --test storage-pool-sequential --config config.yaml
116120

117-
# Concurrency matrix, iSCSI only, overriding the levels to run:
118-
python3 benchmark_storage_pool_concurrency.py --config config.yaml --protocol iscsi --levels 2,5,10,20,30
121+
# Concurrency matrix, using config.yaml's concurrency_levels:
122+
python3 run.py --test storage-pool-concurrency --config config.yaml
119123

120-
# Use the SAME --run-id across both scripts to combine 5.1.x + 6.1.x into one
121-
# summary_<run_id>.csv / report (run sequential first, review it, then decide
122-
# whether to proceed with concurrency under the same run id):
123-
python3 benchmark_storage_pool_sequential.py --config config.yaml --run-id RUN-0001
124-
python3 benchmark_storage_pool_concurrency.py --config config.yaml --run-id RUN-0001
124+
# Same --run-id across both tests to combine 5.1.x + 6.1.x into one report.
125+
# Run sequential first, review it, then decide on concurrency:
126+
python3 run.py --test storage-pool-sequential --config config.yaml --run-id RUN_20260927_081500_a1b2
127+
python3 run.py --test storage-pool-concurrency --config config.yaml --run-id RUN_20260927_081500_a1b2
125128
```
126129

127-
At the end of a real run each script automatically checks for and deletes any
128-
storage pool whose name still contains the run id (safety net for pools that
129-
were created but never got torn down because of a mid-run crash). Pass
130-
`--skip-cleanup` to disable that and inspect the pools yourself.
130+
At the end of a real run each script deletes leftover pools from that run id.
131+
The sweep only deletes pools that match this config's name prefix, name
132+
pattern, zone, cluster, and storage provider, so other pools in a shared zone
133+
are left alone. Pass `--skip-cleanup` to inspect the pools yourself.
131134

132-
If a run crashes hard (script killed, network partition, etc.) and left
133-
pools behind, recover with either script's `--cleanup-only` (they share the
134-
same cleanup logic):
135+
If a run crashes and leaves pools behind:
135136

136137
```bash
137-
# Deletes every pool whose name contains "bench_ontap" (the default prefix)
138-
python3 benchmark_storage_pool_sequential.py --config config.yaml --cleanup-only
138+
# Deletes benchmark pools for this config's pool_name_prefix (still provider/zone/cluster scoped):
139+
python3 run.py --test storage-pool-sequential --config config.yaml --cleanup-only
139140

140-
# Or scope it to one specific run:
141-
python3 benchmark_storage_pool_sequential.py --config config.yaml --cleanup-only RUN_20260722_101500
141+
# Or scope it to one specific run (underscores, not hyphens):
142+
python3 run.py --test storage-pool-sequential --config config.yaml --cleanup-only RUN_20260927_081500_a1b2
142143
```
143144

144145
## Rendering the Confluence-ready report
145146

146147
```bash
147-
python3 render_report.py --run-id RUN-20260722-101500 \
148+
python3 render_report.py --run-id RUN_20260722_101500_a1b2 \
148149
--cloudstack-build 4.23.0.0-SNAPSHOT --ontap-version 9.15.1
149150
```
150151

@@ -182,25 +183,23 @@ matching offerings - it does not create/destroy the pool itself:
182183

183184
```bash
184185
# Sanity-check without hitting a real management server:
185-
python3 benchmark_vm_instance_sequential.py --config config.yaml --dry-run
186-
python3 benchmark_vm_instance_concurrency.py --config config.yaml --dry-run
186+
python3 run.py --test vm-instance-sequential --config config.yaml --dry-run
187+
python3 run.py --test vm-instance-concurrency --config config.yaml --dry-run
187188

188-
# Sequential scale matrix (5.2.1/5.2.2), both protocols:
189-
python3 benchmark_vm_instance_sequential.py --config config.yaml
189+
# Sequential scale matrix (5.2.1/5.2.2), protocols from config.yaml:
190+
python3 run.py --test vm-instance-sequential --config config.yaml
190191

191-
# Concurrency matrix (6.2.1/6.2.2), iSCSI only, custom levels:
192-
python3 benchmark_vm_instance_concurrency.py --config config.yaml --protocol iscsi --levels 1,2,5,10
192+
# Concurrency matrix (6.2.1/6.2.2). Levels come from vm_bench.concurrency_levels:
193+
python3 run.py --test vm-instance-concurrency --config config.yaml
193194

194-
# Both matrices in one invocation, combined into a single summary/report:
195-
python3 benchmark_vm_instance_combined.py --config config.yaml
195+
# Both matrices in one invocation:
196+
python3 run.py --test vm-instance-combined --config config.yaml
196197

197-
# Or run the two standalone scripts under the SAME --run-id to combine them
198-
# instead (lets you review the sequential results before committing to
199-
# concurrency):
200-
python3 benchmark_vm_instance_sequential.py --config config.yaml --run-id RUN-0001
201-
python3 benchmark_vm_instance_concurrency.py --config config.yaml --run-id RUN-0001
198+
# Or run the two tests under the SAME --run-id (underscores only):
199+
python3 run.py --test vm-instance-sequential --config config.yaml --run-id RUN_20260927_081500_a1b2
200+
python3 run.py --test vm-instance-concurrency --config config.yaml --run-id RUN_20260927_081500_a1b2
202201

203-
python3 render_report.py --run-id RUN-0001 --raw-prefix raw_ops_vm --summary-prefix summary_vm --report-suffix _vm
202+
python3 render_report.py --run-id RUN_20260927_081500_a1b2 --raw-prefix raw_ops_vm --summary-prefix summary_vm --report-suffix _vm
204203
```
205204

206205
All three scripts share the same `--skip-cleanup` / `--cleanup-only` safety

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

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ cluster IDs, and ONTAP connection details (see inline comments in
7171

7272
| File | Purpose |
7373
|---|---|
74+
| `benchmark_support.py` | Shared run ids, resource names, `mean_seconds`, and the one log format used by every script. |
7475
| `cloudstack_client.py` | Minimal CloudStack HTTP/REST client (session-key login, generic `call()`, automatic `queryAsyncJobResult` polling). Used by every benchmark script. |
7576
| `storage_pool_common.py` | Shared helpers for the storage-pool scripts: `createStoragePool`/`deleteStoragePool` request building, CSV logging (`RawLogger`, `append_summary_csv`), cleanup-by-filter, config loading. |
7677
| `vm_instance_common.py` | Shared helpers for the VM-instance scripts: `deployVirtualMachine`/`destroyVirtualMachine` request building (incl. force-purging data disks and `Destroy`-state volumes so ONTAP space is reclaimed immediately instead of waiting for CloudStack's 24h cleanup delay), CSV logging, cleanup-by-filter, config loading. |
@@ -82,20 +83,25 @@ Reproduces Confluence sections 5.1 (sequential) and 6.1 (concurrency) -
8283

8384
| Script | What it does | Typical command |
8485
|---|---|---|
85-
| `benchmark_storage_pool_sequential.py` | Creates storage pools one at a time (per protocol) up to N=30, then deletes them one at a time, logging every call and reporting checkpoint totals at N = 1, 5, 10, 20, 30. | `python3 benchmark_storage_pool_sequential.py --config config.yaml` |
86-
| `benchmark_storage_pool_concurrency.py` | For each concurrency level C (default 2, 5, 10, 20, 30), creates C pools in parallel via a thread pool, records wall-clock time for the whole batch, then deletes the same C pools in parallel. | `python3 benchmark_storage_pool_concurrency.py --config config.yaml` |
86+
| `run.py` | Entry point. Loads `config.yaml` and runs the test named by `--test`. | `python3 run.py --test storage-pool-sequential --config config.yaml` |
87+
| `benchmark_storage_pool_sequential.py` | Creates storage pools one at a time (per protocol) up to N=30, then deletes them one at a time, logging every call and reporting checkpoint totals at N = 1, 5, 10, 20, 30. | `python3 run.py --test storage-pool-sequential --config config.yaml` |
88+
| `benchmark_storage_pool_concurrency.py` | For each concurrency level C (default 2, 5, 10, 20, 30), creates C pools in parallel via a thread pool, records wall-clock time for the whole batch, then deletes the same C pools in parallel. | `python3 run.py --test storage-pool-concurrency --config config.yaml` |
8789

8890
Common flags (both scripts):
8991

9092
| Flag | Meaning |
9193
|---|---|
92-
| `--config PATH` | Config YAML to use (default `config.yaml`). |
93-
| `--protocol {nfs3,iscsi,both}` | Restrict the run to one protocol (default `both`). |
94-
| `--run-id ID` | Reuse a specific run id (auto-generated otherwise) - use the **same id** across the sequential and concurrency scripts to merge both into one `summary_<run_id>.csv`/report. |
94+
| `--config PATH` | Config YAML to use (default `config.yaml`). Protocols, checkpoints, and concurrency levels are read from here. |
95+
| `--run-id ID` | Reuse a run id. Auto-generated otherwise as `RUN_<UTC timestamp>_<4 hex chars>`. Letters, digits, and underscores only — a hyphen is rewritten to `_` because storage-pool names (and the ONTAP volume behind them) disallow `-`. Use the **same id** across sequential and concurrency to merge one report. |
9596
| `--dry-run` | Simulate timings with no real API calls - use this first to sanity-check your config. |
9697
| `--skip-cleanup` | Skip the automatic post-run sweep for leftover pools from this run id. |
97-
| `--cleanup-only [FILTER]` | Don't run the benchmark - just delete every pool whose name contains `FILTER` (default: config's `pool_name_prefix`) and exit. Use this to recover after a crashed run. |
98-
| `--levels 2,5,10` | *(concurrency script only)* Override the concurrency levels to run instead of the config's `concurrency_levels`. |
98+
| `--cleanup-only [FILTER]` | Don't run the benchmark. Delete pools that match `FILTER` (default: config's `pool_name_prefix`) **and** this config's name pattern, zone, cluster, and storage provider. |
99+
100+
`run.py` also requires `--test`. Protocols, checkpoints, and concurrency levels are not flags; change them in `config.yaml`.
101+
102+
| Flag | Meaning |
103+
|---|---|
104+
| `--test NAME` | Required. `storage-pool-sequential`, `storage-pool-concurrency`, `vm-instance-sequential`, `vm-instance-concurrency`, or `vm-instance-combined`. |
99105

100106
## 4. VM-instance benchmark scripts
101107

@@ -121,13 +127,15 @@ VM getting both a root disk and a data disk on the same tagged pool.
121127

122128
| Script | What it does | Typical command |
123129
|---|---|---|
124-
| `benchmark_vm_instance_sequential.py` | Deploys VMs one at a time (per protocol) up to N=30, then destroys them one at a time, reporting checkpoint totals at N = 1, 2, 5, 10, 20, 30. | `python3 benchmark_vm_instance_sequential.py --config config.yaml` |
125-
| `benchmark_vm_instance_concurrency.py` | For each concurrency level C, deploys C VMs in parallel, records wall-clock time, then destroys the same C VMs in parallel. | `python3 benchmark_vm_instance_concurrency.py --config config.yaml` |
126-
| `benchmark_vm_instance_combined.py` | Runs the sequential matrix immediately followed by the concurrency matrix, under one shared run id, in a single invocation. Use once you already trust your config/environment. | `python3 benchmark_vm_instance_combined.py --config config.yaml` |
130+
| `benchmark_vm_instance_sequential.py` | Deploys VMs one at a time (per protocol) up to N=30, then destroys them one at a time, reporting checkpoint totals at N = 1, 2, 5, 10, 20, 30. | `python3 run.py --test vm-instance-sequential --config config.yaml` |
131+
| `benchmark_vm_instance_concurrency.py` | For each concurrency level C, deploys C VMs in parallel, records wall-clock time, then destroys the same C VMs in parallel. | `python3 run.py --test vm-instance-concurrency --config config.yaml` |
132+
| `benchmark_vm_instance_combined.py` | Runs the sequential matrix immediately followed by the concurrency matrix, under one shared run id, in a single invocation. Use once you already trust your config/environment. | `python3 run.py --test vm-instance-combined --config config.yaml` |
127133

128134
Common flags: same as the storage-pool scripts above (`--config`,
129-
`--protocol`, `--run-id`, `--dry-run`, `--skip-cleanup`, `--cleanup-only
130-
[FILTER]`; `--levels` on the concurrency/combined scripts). Failed
135+
`--run-id`, `--dry-run`, `--skip-cleanup`, `--cleanup-only [FILTER]`).
136+
VM cleanup rewrites `_` in the filter to `-` so it matches the hostname
137+
form of the run id, and it only destroys VMs in the configured zone whose
138+
names match the benchmark prefix and pattern. Failed
131139
`deployVirtualMachine` calls are intentionally **left in place** (not
132140
auto-destroyed) so you can inspect what got left behind - clean them up
133141
with `--cleanup-only` once done.
@@ -136,14 +144,14 @@ with `--cleanup-only` once done.
136144

137145
| Script | What it does | Typical command |
138146
|---|---|---|
139-
| `render_report.py` | Turns a run's `raw_ops_<run_id>.csv` + `summary_<run_id>.csv` into Confluence-ready markdown tables (matches the page's section layout, plus Min/Avg/P95/Max rows for the Results Log). Writes to stdout and to `results/report_<run_id>.md`. | `python3 render_report.py --run-id RUN-0001 --cloudstack-build 4.23.0.0-SNAPSHOT --ontap-version 9.17.1` |
147+
| `render_report.py` | Turns a run's `raw_ops_<run_id>.csv` + `summary_<run_id>.csv` into markdown tables (section layout plus Min/Avg/P95/Max rows for the Results Log). Writes to stdout and to `results/report_<run_id>.md`. | `python3 render_report.py --run-id RUN_20260927_081500_a1b2 --cloudstack-build 4.23.0.0-SNAPSHOT --ontap-version 9.17.1` |
140148

141149
For VM-instance runs (which write `raw_ops_vm_<run_id>.csv` /
142150
`summary_vm_<run_id>.csv` instead of the storage-pool scripts' `raw_ops_`/
143151
`summary_` prefix), pass the matching prefixes:
144152

145153
```bash
146-
python3 render_report.py --run-id RUN-0001 \
154+
python3 render_report.py --run-id RUN_20260927_081500_a1b2 \
147155
--raw-prefix raw_ops_vm --summary-prefix summary_vm --report-suffix _vm
148156
```
149157

0 commit comments

Comments
 (0)