@@ -88,13 +88,9 @@ def build_deploy_vm_params(name, infra_cfg, vm_cfg, proto_cfg):
8888
8989def _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-
262239def _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):
368345def 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