Skip to content

Add PlatformDiskId to VirtualHardDiskProperties - #350

Closed
YuanZh (YuanMSFT) wants to merge 16 commits into
microsoft:mainfrom
YuanMSFT:user/yuanzh/1010
Closed

Add PlatformDiskId to VirtualHardDiskProperties#350
YuanZh (YuanMSFT) wants to merge 16 commits into
microsoft:mainfrom
YuanMSFT:user/yuanzh/1010

Conversation

@YuanMSFT

@YuanMSFT YuanZh (YuanMSFT) commented Oct 11, 2025

Copy link
Copy Markdown
Contributor

wmi PR: microsoft/wmi#179
moc PR: microsoft/moc#400
moc-pkg PR: https://github.com/microsoft/moc-pkg/pull/683
wssdagent PR: https://github.com/microsoft/wssdagent/pull/1430
wssd-sdk-for-go PR: microsoft/wssd-sdk-for-go#335
wssdcloudagent PR: https://github.com/microsoft/wssdcloudagent/pull/1603

Add PlatformDiskId to VirtualHardDiskProperties, which will be used by HciVmVirtualHardDisk and stored in the ARM resource later as UniqueID.

This will help customers use the UniqueID to map the ARM resource to an attached disk. Customers can use the Get-Disk or Get-PhysicalDisk PowerShell cmdlets to retrieve the unique ID of the attached disk inside a Windows guest VM and use it to identify the corresponding ARM resource. For Linux VMs, customers can use lsblk to retrieve the serial number of the attached disk and use it to identify the matching ARM resource by comparing it with the unique ID value in the ARM resource.

For example, a partner building a VM migration solution without a dependency on Active Directory will need to consume this.

@YuanMSFT YuanZh (YuanMSFT) changed the title Add UniqueId to VirtualHardDiskProperties Add PlatformDiskId to VirtualHardDiskProperties Oct 14, 2025
@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp 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

This PR adds a PlatformDiskId field to the VirtualHardDiskProperties structure to help customers map ARM resources to attached disks in VMs. The field will store a unique disk identifier that can be retrieved using PowerShell cmdlets in Windows or lsblk in Linux.

  • Add PlatformDiskId field to VirtualHardDiskProperties struct with appropriate JSON tag
  • Update virtual hard disk conversion functions to handle the new PlatformDiskId field
  • Update test assertions to use t.Error instead of t.Errorf for consistency

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
services/storage/storage.go Adds PlatformDiskId field definition to VirtualHardDiskProperties struct
services/storage/virtualharddisk/virtualharddisk.go Updates conversion functions to handle PlatformDiskId field mapping
services/security/roleassignment/roleassignment_test.go Replaces t.Errorf with t.Error for test error reporting
services/security/role/role_test.go Replaces t.Errorf with t.Error for test error reporting
services/security/identity/identity_test.go Replaces t.Errorf with t.Error for test error reporting
go.mod Updates Go version and dependencies to newer versions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines failed to run 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@YuanMSFT

Copy link
Copy Markdown
Contributor Author

Replaced by #355

@YuanMSFT
YuanZh (YuanMSFT) deleted the user/yuanzh/1010 branch October 25, 2025 03:21
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.

4 participants