[moc] Add CopyVmcFiles RPC for brownfield mocguestagent → VMC migration#433
Merged
pathuang-sia merged 1 commit intomicrosoft:mainfrom Apr 29, 2026
Merged
Conversation
Adds CopyVmcFiles to the mocguestagent and mochostagent VirtualMachineAgent services to support copying the VMC binary, public certificate, and installation script from the Hyper-V host into a guest VM as part of the brownfield guest agent migration (mocguestagent → VMC). Modeled after UpdateAgent for the host→guest byte-shipping pattern. Host-side messages use the VirtualMachine* prefix to match existing convention (VirtualMachineRunCommandRequest, etc.). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
blairurish
approved these changes
Apr 29, 2026
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
dhavalpopat
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
CopyVmcFilesRPC to theVirtualMachineAgentservice in bothmocguestagentandmochostagentto support the brownfield guest agent migration frommocguestagentto VMC.The RPC ships the VMC binary, public certificate, and installation script bytes from the Hyper-V host into a guest VM. This is the proto piece of the wssdagent-side plumbing for the migration; the wssdagent server/client implementation will land in a separate PR consuming the bindings generated here.
Design
Modeled after the existing
UpdateAgentRPC, which ships agent bytes host→guest in the same direction. Both new request messages carry:VmcBinary— VMC executable bytesPublicCertificate— VMC public cert bytesInstallScript— install script bytesVmcVersion— optional, for logging/idempotencyThe host-side request additionally carries the existing
VirtualMachinemessage for VM identity (matchingVirtualMachineRunCommandRequestetc.).The host-side message names use the
VirtualMachine*prefix (VirtualMachineCopyVmcFilesRequest/Response) to match the existing convention onmochostagent.VirtualMachineAgent(VirtualMachineRunCommandRequest,VirtualMachineRepairGuestAgentRequest, etc.). The guest-side messages are unprefixed, matching the convention onmocguestagent.VirtualMachineAgent(UpdateAgentRequest, etc.).The trigger to actually run the install (
COMMANDID_INSTALL_VMC) reuses the existingRunCommandplumbing — no new RPC needed for that.Files changed
rpc/mocguestagent/compute/virtualmachine/moc_mocguestagent_virtualmachine.proto— guest-facing RPC + messagesrpc/mochostagent/compute/virtualmachine/moc_mochostagent_virtualmachine.proto— host-facing RPC + messagesrpc/mocguestagent/compute/moc_mocguestagent_virtualmachine.pb.go— regeneratedrpc/mochostagent/compute/moc_mochostagent_virtualmachine.pb.go— regeneratedTesting
./gen.shruns clean.go build ./rpc/...succeeds.The RPC is not wired up in any server or client yet — that lands in the wssdagent PRs that consume this. No behavioral change in
microsoft/mocitself with this PR alone.Related
Implements the proto piece of the wssdagent-side brownfield migration plumbing tracked in the
azlocal-overlaydesign doc (docs/gantry-upgrade/guest-agent-migration-design.md).