@@ -129,7 +129,10 @@ init_scheduler() {
129129}
130130
131131# Default VM resources when not specified in launch_vm
132- DEFAULT_VM_VCPUS=2
132+ # Using 4 vCPUs by default maximizes VM reuse potential:
133+ # - All VMs can run any scenario (no vcpu mismatch)
134+ # - More queuing = more reuse opportunities
135+ DEFAULT_VM_VCPUS=4
133136DEFAULT_VM_MEMORY=4096
134137
135138parse_static_scenario_resources () {
@@ -405,8 +408,8 @@ vm_satisfies_requirements() {
405408
406409 # Get scenario requirements
407410 local req_vcpus req_memory req_disksize req_networks req_fips req_boot_image
408- req_vcpus=$( get_req_value " ${scenario_reqs} " " min_vcpus" " 2 " )
409- req_memory=$( get_req_value " ${scenario_reqs} " " min_memory" " 4096 " )
411+ req_vcpus=$( get_req_value " ${scenario_reqs} " " min_vcpus" " ${DEFAULT_VM_VCPUS} " )
412+ req_memory=$( get_req_value " ${scenario_reqs} " " min_memory" " ${DEFAULT_VM_MEMORY} " )
410413 req_disksize=$( get_req_value " ${scenario_reqs} " " min_disksize" " 20" )
411414 req_networks=$( get_req_value " ${scenario_reqs} " " networks" " default" )
412415 req_fips=$( get_req_value " ${scenario_reqs} " " fips" " false" )
@@ -507,10 +510,9 @@ register_vm() {
507510 cp " ${scenario_reqs} " " ${vm_dir} /state"
508511
509512 # Add vcpus/memory/disksize from min_* values and set status
510- # TODO this should use the defaults, right?
511513 local vcpus memory disksize networks fips boot_image
512- vcpus=$( get_req_value " ${scenario_reqs} " " min_vcpus" " 2 " )
513- memory=$( get_req_value " ${scenario_reqs} " " min_memory" " 4096 " )
514+ vcpus=$( get_req_value " ${scenario_reqs} " " min_vcpus" " ${DEFAULT_VM_VCPUS} " )
515+ memory=$( get_req_value " ${scenario_reqs} " " min_memory" " ${DEFAULT_VM_MEMORY} " )
514516 disksize=$( get_req_value " ${scenario_reqs} " " min_disksize" " 20" )
515517 networks=$( get_req_value " ${scenario_reqs} " " networks" " default" )
516518 fips=$( get_req_value " ${scenario_reqs} " " fips" " false" )
@@ -683,7 +685,7 @@ sort_scenarios_for_reuse() {
683685 local boot_image networks vcpus reuse_score
684686 boot_image=$( get_req_value " ${req_file} " " boot_image" " default" )
685687 networks=$( get_req_value " ${req_file} " " networks" " default" )
686- vcpus=$( get_req_value " ${req_file} " " min_vcpus" " 2 " )
688+ vcpus=$( get_req_value " ${req_file} " " min_vcpus" " ${DEFAULT_VM_VCPUS} " )
687689 reuse_score=$( get_reusability_score " ${boot_image} " " ${networks} " )
688690 # Sort key: reuse_score (asc), boot_image (desc), vcpus (desc)
689691 # Use inverse vcpus (100-vcpus) so ascending sort gives descending vcpus
@@ -995,8 +997,8 @@ dispatch_dynamic_scenarios() {
995997 fi
996998
997999 local min_vcpus min_memory
998- min_vcpus=$( get_req_value " ${req_file} " " min_vcpus" " 2 " )
999- min_memory=$( get_req_value " ${req_file} " " min_memory" " 4096 " )
1000+ min_vcpus=$( get_req_value " ${req_file} " " min_vcpus" " ${DEFAULT_VM_VCPUS} " )
1001+ min_memory=$( get_req_value " ${req_file} " " min_memory" " ${DEFAULT_VM_MEMORY} " )
10001002
10011003 # Try to find compatible free VM
10021004 local vm_name=" "
0 commit comments