Skip to content

Add AMLFS expansion job commands - #3344

Open
Rebecca (Makar) McHugh (rebecca-makar) wants to merge 1 commit into
mainfrom
remakar/amlfs-expansion
Open

Add AMLFS expansion job commands#3344
Rebecca (Makar) McHugh (rebecca-makar) wants to merge 1 commit into
mainfrom
remakar/amlfs-expansion

Conversation

@rebecca-makar

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds create, get/list, and delete commands for Azure Managed Lustre expansion jobs so users can increase filesystem storage capacity and monitor expansion progress.

The change includes:

  • ARM service integration and AOT-safe response serialization.
  • Command registration, consolidated-tool mappings, command documentation, and end-to-end prompts.
  • Unit tests and recorded lifecycle tests.
  • Test-resource permissions required by the HPC Cache Resource Provider to inject expansion NICs.

Official Azure CLI reference: https://learn.microsoft.com/cli/azure/amlfs/expansion?view=azure-cli-latest

GitHub issue number?

N/A

Validation

  • Managed Lustre test project build succeeded with no warnings.
  • All 226 Managed Lustre tests passed in playback mode.
  • Expansion create, get/list, completion polling, and delete were exercised against live Azure resources.
  • Test recordings were published as Azure.Mcp.Tools.ManagedLustre.Tests_72f369d8cc.

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Azure Managed Lustre (AMLFS) expansion job support to the ManagedLustre toolset, enabling users to create, query/list, and delete expansion jobs to resize filesystem capacity, with accompanying serialization, docs, consolidated-tool mappings, and tests.

Changes:

  • Added fs expansion {create|get|delete} commands (options, models, command registration) plus AOT-safe JSON serialization entries.
  • Extended ManagedLustreService/IManagedLustreService with expansion job ARM operations and model mapping.
  • Updated docs (azmcp-commands.md, e2eTestPrompts.md), consolidated tool mappings, changelog entry, and recorded/live test coverage & sanitizers.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.ManagedLustre/tests/test-resources.bicep Updates test infra (subnet outbound behavior, AMLFS zone, adds RP Reader role assignment).
tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/ManagedLustreCommandTests.cs Updates sanitization and adds recorded lifecycle coverage for expansion jobs.
tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ExpansionJob/ExpansionJobGetCommandTests.cs Unit tests for get/list expansion jobs.
tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ExpansionJob/ExpansionJobDeleteCommandTests.cs Unit tests for deleting expansion jobs.
tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ExpansionJob/ExpansionJobCreateCommandTests.cs Unit tests for creating expansion jobs.
tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/assets.json Updates recordings tag for published test proxy assets.
tools/Azure.Mcp.Tools.ManagedLustre/src/Services/ManagedLustreService.cs Implements expansion job create/get/list/delete and maps SDK resource to response model.
tools/Azure.Mcp.Tools.ManagedLustre/src/Services/IManagedLustreService.cs Adds expansion job methods to service contract.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/ManagedLustreOptionDescriptions.cs Adds option descriptions for expansion job name and new size.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ExpansionJob/ExpansionJobGetOptions.cs New options for get/list expansion jobs.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ExpansionJob/ExpansionJobDeleteOptions.cs New options for deleting an expansion job.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ExpansionJob/ExpansionJobCreateOptions.cs New options for creating an expansion job.
tools/Azure.Mcp.Tools.ManagedLustre/src/Models/ExpansionJob.cs Adds response model types for expansion job payloads.
tools/Azure.Mcp.Tools.ManagedLustre/src/ManagedLustreSetup.cs Registers expansion commands and command group (fs expansion).
tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/ManagedLustreJsonContext.cs Registers expansion command results/models for source-generated JSON serialization.
tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ExpansionJob/ExpansionJobGetCommand.cs New command implementation for get/list expansion jobs.
tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ExpansionJob/ExpansionJobDeleteCommand.cs New command implementation for deleting expansion jobs.
tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ExpansionJob/ExpansionJobCreateCommand.cs New command implementation for creating expansion jobs.
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Maps new tools into consolidated “get/create/manage” groupings and updates description.
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds E2E prompts for expansion create/get/list/delete tools.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents the new azmcp managedlustre fs expansion command set.
servers/Azure.Mcp.Server/changelog-entries/remakar-amlfs-expansion-jobs.yml Changelog entry for the new expansion job feature.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/Azure.Mcp.Tools.ManagedLustre/src/Services/ManagedLustreService.cs Outdated
Comment thread tools/Azure.Mcp.Tools.ManagedLustre/tests/test-resources.bicep
Add create, get, and delete operations for AMLFS expansion jobs, including command registration, documentation, recorded lifecycle tests, and required test-resource permissions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| managedlustre_fs_expansion_create | Create an expansion job to increase the storage capacity of the Azure Managed Lustre filesystem <filesystem_name> to <new_size_tib> TiB in resource group <resource_group_name> | none |
| managedlustre_fs_expansion_get | Get the details of expansion job <job_name> for the Azure Managed Lustre filesystem <filesystem_name> in resource group <resource_group_name> | none |
| managedlustre_fs_expansion_get | List all expansion jobs for the Azure Managed Lustre filesystem <filesystem_name> in resource group <resource_group_name> | none |
| managedlustre_fs_expansion_delete | Delete the expansion job <job_name> for the Azure Managed Lustre filesystem <filesystem_name> in resource group <resource_group_name> | none |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: keep the prompts in alphabetical order

Comment on lines +20 to +24
Required options:
- filesystem-name: The name of the AMLFS filesystem
- new-size: The new storage capacity in TiB after expansion
- resource-group: The resource group containing the filesystem
- subscription: The subscription containing the filesystem

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information should be known to the agent via the tool input schema definition, I don't think we need to include this in the tool's description.

Comment on lines +42 to +51
await _service.DeleteExpansionJobAsync(
options.Subscription!,
options.ResourceGroup,
options.FilesystemName,
options.ExpansionJobName,
options.Tenant,
options.RetryPolicy,
cancellationToken);

context.Response.Results = ResponseResult.Create(new(options.ExpansionJobName, "Deleted"), ManagedLustreJsonContext.Default.ExpansionJobDeleteResult);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more recent pattern in these types of operations is for the service to return a bool to indicate if anything was deleted and the response message to be handled accordingly. Ex, don't fail when nothing is deleted but do mention that nothing was deleted.


namespace Azure.Mcp.Tools.ManagedLustre.Models;

public class ExpansionJob

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: make all these records as they're simple response models.

Comment on lines +27 to +30
private List<HeaderRegexSanitizer>? _headerRegexSanitizers;
private List<BodyKeySanitizer>? _bodyKeySanitizers;
private List<GeneralRegexSanitizer>? _generalRegexSanitizers;
private List<UriRegexSanitizer>? _uriRegexSanitizers;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server-Azure.Mcp Azure.Mcp.Server tools-managedlustre Azure Managed Lustre

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants