Skip to content

[moc] Add CopyVmcFiles RPC for brownfield mocguestagent → VMC migration#433

Merged
pathuang-sia merged 1 commit intomicrosoft:mainfrom
pathuang-sia:users/pathuang/install-vmc
Apr 29, 2026
Merged

[moc] Add CopyVmcFiles RPC for brownfield mocguestagent → VMC migration#433
pathuang-sia merged 1 commit intomicrosoft:mainfrom
pathuang-sia:users/pathuang/install-vmc

Conversation

@pathuang-sia
Copy link
Copy Markdown
Contributor

@pathuang-sia pathuang-sia commented Apr 27, 2026

Summary

Adds a new CopyVmcFiles RPC to the VirtualMachineAgent service in both mocguestagent and mochostagent to support the brownfield guest agent migration from mocguestagent to 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 UpdateAgent RPC, which ships agent bytes host→guest in the same direction. Both new request messages carry:

  • VmcBinary — VMC executable bytes
  • PublicCertificate — VMC public cert bytes
  • InstallScript — install script bytes
  • VmcVersion — optional, for logging/idempotency

The host-side request additionally carries the existing VirtualMachine message for VM identity (matching VirtualMachineRunCommandRequest etc.).

The host-side message names use the VirtualMachine* prefix (VirtualMachineCopyVmcFilesRequest/Response) to match the existing convention on mochostagent.VirtualMachineAgent (VirtualMachineRunCommandRequest, VirtualMachineRepairGuestAgentRequest, etc.). The guest-side messages are unprefixed, matching the convention on mocguestagent.VirtualMachineAgent (UpdateAgentRequest, etc.).

The trigger to actually run the install (COMMANDID_INSTALL_VMC) reuses the existing RunCommand plumbing — no new RPC needed for that.

Files changed

  • rpc/mocguestagent/compute/virtualmachine/moc_mocguestagent_virtualmachine.proto — guest-facing RPC + messages
  • rpc/mochostagent/compute/virtualmachine/moc_mochostagent_virtualmachine.proto — host-facing RPC + messages
  • rpc/mocguestagent/compute/moc_mocguestagent_virtualmachine.pb.go — regenerated
  • rpc/mochostagent/compute/moc_mochostagent_virtualmachine.pb.go — regenerated

Testing

./gen.sh runs 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/moc itself with this PR alone.

Related

Implements the proto piece of the wssdagent-side brownfield migration plumbing tracked in the azlocal-overlay design doc (docs/gantry-upgrade/guest-agent-migration-design.md).

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>
@pathuang-sia pathuang-sia changed the title Add CopyVmcFiles RPC for brownfield mocguestagent → VMC migration [moc] Add CopyVmcFiles RPC for brownfield mocguestagent → VMC migration Apr 28, 2026
@pathuang-sia
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@pathuang-sia pathuang-sia merged commit f8d7e19 into microsoft:main Apr 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants