Skip to content

Commit 52d35e8

Browse files
ankitsharma-99Ankit Sharma
andauthored
Enable DiskSpdExecutor to run read-only diskspd workloads on raw physical disks (#683)
* Added raw/bare disk I/O support via RawDiskTarget parameter * added SetDiskSanPolicy dependency to the profile to mark disks readable * Added raw HDD disk support with auto-discovery of disks. * added functional tests, updated profile and added documentation for diskspd on raw disk scenario. * updated the profile name * removed rawindex parameter and added diskindex parameter (supported through diskfilter) * remove the new profile from the open source repo and add to internal repo. * spacing issues * up version --------- Co-authored-by: Ankit Sharma <ankitshar@microsoft.com>
1 parent 138dce1 commit 52d35e8

7 files changed

Lines changed: 946 additions & 16 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.1
1+
3.2.2

src/VirtualClient/VirtualClient.Actions.FunctionalTests/TestDependencies.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace VirtualClient.Actions
55
{
66
using System;
7+
using System.Collections.Generic;
78
using System.IO;
89
using System.Reflection;
910
using Microsoft.Extensions.DependencyInjection;
@@ -39,13 +40,44 @@ static TestDependencies()
3940
/// <summary>
4041
/// Creates a <see cref="ProfileExecutor"/> for the workload profile provided (e.g. PERF-IO-FIO-STRESS.json).
4142
/// </summary>
42-
public static ProfileExecutor CreateProfileExecutor(string profile, IServiceCollection dependencies, bool dependenciesOnly = false)
43+
/// <param name="profile">The name of the workload profile file (e.g. PERF-IO-DISKSPD.json).</param>
44+
/// <param name="dependencies">Service dependencies required by the profile executor.</param>
45+
/// <param name="dependenciesOnly">True to execute only profile dependencies, not actions.</param>
46+
/// <param name="parameterOverrides">
47+
/// Optional parameter overrides applied to every non-disk-fill action in the profile after inlining
48+
/// (e.g. <c>new Dictionary&lt;string, IConvertible&gt; {{ "DiskFilter", "DiskIndex:6,7" }}</c>).
49+
/// Useful for testing scenarios that would normally be driven by CLI <c>--parameters</c>.
50+
/// </param>
51+
public static ProfileExecutor CreateProfileExecutor(
52+
string profile,
53+
IServiceCollection dependencies,
54+
bool dependenciesOnly = false,
55+
IDictionary<string, IConvertible> parameterOverrides = null)
4356
{
4457
ExecutionProfile workloadProfile = ExecutionProfile.ReadProfileAsync(Path.Combine(TestDependencies.ProfileDirectory, profile))
4558
.GetAwaiter().GetResult();
4659

4760
workloadProfile.Inline();
4861

62+
if (parameterOverrides?.Count > 0)
63+
{
64+
foreach (ExecutionProfileElement action in workloadProfile.Actions)
65+
{
66+
// Do not apply overrides to disk-fill actions — DiskFill is incompatible with
67+
// DiskIndex: targeting and would fail validation if both are set.
68+
bool isDiskFill = action.Parameters.TryGetValue("DiskFill", out IConvertible df)
69+
&& bool.TryParse(df?.ToString(), out bool dfValue) && dfValue;
70+
71+
if (!isDiskFill)
72+
{
73+
foreach (KeyValuePair<string, IConvertible> kvp in parameterOverrides)
74+
{
75+
action.Parameters[kvp.Key] = kvp.Value;
76+
}
77+
}
78+
}
79+
}
80+
4981
ComponentSettings settings = new ComponentSettings
5082
{
5183
ExitWait = TimeSpan.Zero

0 commit comments

Comments
 (0)