Share via


Read (GET) a VirtualHardDisk [SPFSDK][VMMREF]

 

Applies To: Windows Azure Pack

Gets a VirtualHardDisk [SPFSDK][VMMREF] entity or a set of entities by using the HTTP GET operation.

Here is a list of examples related to this collection operation.

  • Example: Get a specific VirtualHardDisk object

  • Example: Get all VirtualHardDisk objects

  • Example: Get all VirtualHardDisk objects of a virtual machine

Request

For more information about returning multiple entities, see Common GET HTTP Info.

For more information about the placeholders used in the URI, see URL placeholders.

Method

Request URI

HTTP Version

GET

https://{server-name}:{auth-port}/{subscription-id}/services/systemcenter/vmm/VirtualHardDisks(ID=Guid'[value]',StampId=Guid'[value]')

HTTP/1.1

GET

https://{server-name}:{auth-port}/{subscription-id}/services/systemcenter/vmm/VirtualHardDisks

HTTP/1.1

Request URI Parameters

This table only applies when reading a specific entity.

URI Parameter

Description

ID

[Edm.Guid] The identifier of the entity.

StampId

[Edm.Guid] The identifier of the stamp that restricts the query.

Request Headers

This operation does not use any non-standard request headers.

For more information about the common request headers used by this operation, see Common HTTP request information.

Request Body

None

Response

Response Codes

This operation does not return any non-standard OData response codes. If successful, it will return code 200 OK.

Response Headers

This operation does not use any non-standard response headers.

For more information about the common response headers used by this operation, see Common HTTP response information.

Response Body

The response body will contain either (depending on the request headers) an XML or JSON encoded VirtualHardDisk [SPFSDK][VMMREF] entity or entities. Here is the response body of a single entity.

{
  "odata.metadata": "https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/$metadata#VirtualHardDisks/@Element",
  "Accessibility": "Internal",
  "AddedTime": "2014-05-06T16:38:13.733-07:00",
  "Description": "",
  "Directory": null,
  "Enabled": true,
  "ID": "f373b056-0aa6-4882-a05d-1876227fd439",
  "JobGroupId": null,
  "MaximumSize": "32212254720",
  "ModifiedTime": "2014-06-11T16:40:21.9490175-07:00",
  "Name": "SCX-2k3.vhd",
  "Owner": {
    "UserName": null,
    "RoleName": null,
    "RoleID": null
  },
  "OwnerSid": null,
  "ParentDiskId": null,
  "SharePath": null,
  "Size": "2928402432",
  "State": "Normal",
  "VHDType": "DynamicallyExpanding",
  "VMId": null,
  "TemplateId": null,
  "StampId": "56ebc6dc-f63c-46e2-8438-2967e0ad83bc",
  "FamilyName": null,
  "Release": null,
  "CloudId": null,
  "HostVolumeId": null,
  "IsOrphaned": false,
  "IsResourceGroup": null,
  "LibraryGroup": "",
  "LibraryShareId": "00000000-0000-0000-0000-000000000000",
  "Location": null,
  "Namespace": null,
  "ReleaseTime": null,
  "SANCopyCapable": false,
  "Type": null,
  "VirtualizationPlatform": "HyperV",
  "OperatingSystem": "Unknown",
  "OperatingSystemInstance": {
    "Name": "Unknown",
    "Description": "Virtual Machine Manager was unable to determine the operating system for this object.",
    "Version": null,
    "Architecture": "x86",
    "Edition": null,
    "OSType": "Other",
    "ProductType": null
  },
  "OperatingSystemId": null,
  "Tag": []
}

Example: Get all VirtualHardDisk objects

This example reads all the virtual hard disks available to the authenticated tenant.

For more information about how to get started with using the code examples provided in this programming guide, see Program in Visual Studio with the Windows Azure Pack IaaS Resource Provider [SPFSDK].

var vhds = vmmService.VirtualHardDisks.ToList();

HTTP Request

GET https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/VirtualHardDisks HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8
DataServiceUrlConventions: KeyAsSegment
User-Agent: Microsoft ADO.NET Data Services
Authorization: Bearer {ENCODED AUTHENTICATION TOKEN}
x-ms-principal-id: tenant@fabrikam.com
Host: contoso.com:30005

HTTP Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 4392
Content-Type: application/json; odata=minimalmetadata; streaming=true; charset=utf-8
Server: Microsoft-IIS/8.5
X-Content-Type-Options: nosniff
request-id: 5fbd8ef2-63e6-0000-647e-c15fe663cf01
DataServiceVersion: 3.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Thu, 12 Jun 2014 01:10:54 GMT

{"odata.metadata":"https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/$metadata#VirtualHardDisks","value":[{"Accessibility":"Public","AddedTime":"2014-01-15T15:33:27.167-08:00","Description":"","Directory":"\\\\vmm.contoso.com\\MSSCVMMLibrary\\VHDs","Enabled":false,"ID":"1ce04abd-1536-4794-a12b-0109af28ff19","JobGroupId":null,"MaximumSize":"42949672960","ModifiedTime":"2014-06-11T17:11:01.353-07:00","Name":"9200_Server_ServerStandard_en-US.vhdx","Owner":{"UserName":null,"RoleName":null,"RoleID":null},"OwnerSid":null,"ParentDiskId":null,"SharePath":"\\\\vmm.contoso.com\\MSSCVMMLibrary\\VHDs\\9200_Server_ServerStandard_en-US.vhdx","Size":"8426356736","State":"Missing","VHDType":"DynamicallyExpanding","VMId":null,"TemplateId":null,"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","FamilyName":"64-bit edition of Windows Server 2012 Standard","Release":"1.0.0.0","CloudId":null,"HostVolumeId":null,"IsOrphaned":false,"IsResourceGroup":null,"LibraryGroup":"","LibraryShareId":"018f4b4c-d873-4a26-947d-6cd9264c2b66","Location":"\\\\vmm.contoso.com\\MSSCVMMLibrary\\VHDs\\9200_Server_ServerStandard_en-US.vhdx","Namespace":"Global","ReleaseTime":"2014-01-23T13:41:21.487-08:00","SANCopyCapable":false,"Type":null,"VirtualizationPlatform":"Unknown","OperatingSystem":"64-bit edition of Windows Server 2012 Standard","OperatingSystemInstance":{"Name":"64-bit edition of Windows Server 2012 Standard","Description":"64-bit edition of Windows Server 2012 Standard","Version":"6.2","Architecture":"amd64","Edition":"Standard","OSType":"Windows","ProductType":"VER_NT_SERVER"},"OperatingSystemId":null,"Tag":["WindowsServer2012"]},{"Accessibility":"Public","AddedTime":"2014-01-15T14:33:26.52-08:00","Description":"","Directory":"\\\\vmm.contoso.com\\MSSCVMMLibrary\\VHDs","Enabled":true,"ID":"5f506bd8-61d7-4273-81ac-0f2fa79c2910","JobGroupId":null,"MaximumSize":"64424509440","ModifiedTime":"2014-01-16T13:19:11.653-08:00","Name":"Blank Disk - Large.vhd","Owner":{"UserName":null,"RoleName":null,"RoleID":null},"OwnerSid":null,"ParentDiskId":null,"SharePath":"\\\\vmm.contoso.com\\MSSCVMMLibrary\\VHDs\\Blank Disk - Large.vhd","Size":"125440","State":"Normal","VHDType":"DynamicallyExpanding","VMId":null,"TemplateId":null,"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","FamilyName":"DataDisk01","Release":"1.0.0.0","CloudId":null,"HostVolumeId":null,"IsOrphaned":false,"IsResourceGroup":null,"LibraryGroup":"","LibraryShareId":"018f4b4c-d873-4a26-947d-6cd9264c2b66","Location":"\\\\vmm.contoso.com\\MSSCVMMLibrary\\VHDs\\Blank Disk - Large.vhd","Namespace":"Global","ReleaseTime":"2014-01-15T15:23:23.137-08:00","SANCopyCapable":false,"Type":null,"VirtualizationPlatform":"Unknown","OperatingSystem":"Unknown","OperatingSystemInstance":{"Name":"Unknown","Description":"Virtual Machine Manager was unable to determine the operating system for this object.","Version":null,"Architecture":"x86","Edition":null,"OSType":"Other","ProductType":null},"OperatingSystemId":null,"Tag":[]},{"Accessibility":"Public","AddedTime":"2014-01-27T11:29:00.797-08:00","Description":"","Directory":"\\\\vmm.contoso.com\\MSSCVMMLibrary\\VHDs","Enabled":true,"ID":"e0a82263-9c74-459e-9a46-17c7d2d54cc3","JobGroupId":null,"MaximumSize":"42949672960","ModifiedTime":"2014-01-27T11:29:29.983-08:00","Name":"wa.cent6.v0.x64.vhd","Owner":{"UserName":null,"RoleName":null,"RoleID":null},"OwnerSid":null,"ParentDiskId":null,"SharePath":"\\\\vmm.contoso.com\\MSSCVMMLibrary\\VHDs\\wa.cent6.v0.x64.vhd","Size":"1875395584","State":"Normal","VHDType":"DynamicallyExpanding","VMId":null,"TemplateId":null,"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","FamilyName":"CentOS Linux 6 (64-bit)","Release":"1.0.0.0","CloudId":null,"HostVolumeId":null,"IsOrphaned":false,"IsResourceGroup":null,"LibraryGroup":"","LibraryShareId":"018f4b4c-d873-4a26-947d-6cd9264c2b66","Location":"\\\\vmm.contoso.com\\MSSCVMMLibrary\\VHDs\\wa.cent6.v0.x64.vhd","Namespace":"Global","ReleaseTime":"2014-01-27T11:29:29.873-08:00","SANCopyCapable":false,"Type":null,"VirtualizationPlatform":"Unknown","OperatingSystem":"CentOS Linux 6 (64 bit)","OperatingSystemInstance":{"Name":"CentOS Linux 6 (64 bit)","Description":"CentOS Linux 6 (64 bit)","Version":null,"Architecture":"amd64","Edition":null,"OSType":"Linux","ProductType":null},"OperatingSystemId":null,"Tag":["CentOSLinux6"]}]}

Example: Get a specific VirtualHardDisk object

This example reads a specific virtual hard disk by identifier.

For more information about how to get started with using the code examples provided in this programming guide, see Program in Visual Studio with the Windows Azure Pack IaaS Resource Provider [SPFSDK].

Guid stampId = new Guid("56ebc6dc-f63c-46e2-8438-2967e0ad83bc");
Guid vhdId = new Guid("f373b056-0aa6-4882-a05d-1876227fd439");

var vhd = vmmService.VirtualHardDisks.Where(d => d.StampId == stampId && d.ID == vhdId).First();

HTTP Request

GET https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/VirtualHardDisks(StampId=guid'56ebc6dc-f63c-46e2-8438-2967e0ad83bc',ID=guid'f373b056-0aa6-4882-a05d-1876227fd439') HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8
DataServiceUrlConventions: KeyAsSegment
User-Agent: Microsoft ADO.NET Data Services
Authorization: Bearer {ENCODED AUTHENTICATION TOKEN}
x-ms-principal-id: tenant@fabrikam.com
Host: contoso.com:30005

HTTP Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 1292
Content-Type: application/json; odata=minimalmetadata; streaming=true; charset=utf-8
Server: Microsoft-IIS/8.5
X-Content-Type-Options: nosniff
request-id: 5fbd8ef2-63e6-0000-d87d-c15fe663cf01
DataServiceVersion: 3.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Thu, 12 Jun 2014 00:26:48 GMT

{"odata.metadata":"https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/$metadata#VirtualHardDisks/@Element","Accessibility":"Internal","AddedTime":"2014-05-06T16:38:13.733-07:00","Description":"","Directory":null,"Enabled":true,"ID":"f373b056-0aa6-4882-a05d-1876227fd439","JobGroupId":null,"MaximumSize":"32212254720","ModifiedTime":"2014-06-11T16:40:21.9490175-07:00","Name":"SCX-2k3.vhd","Owner":{"UserName":null,"RoleName":null,"RoleID":null},"OwnerSid":null,"ParentDiskId":null,"SharePath":null,"Size":"2928402432","State":"Normal","VHDType":"DynamicallyExpanding","VMId":null,"TemplateId":null,"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","FamilyName":null,"Release":null,"CloudId":null,"HostVolumeId":null,"IsOrphaned":false,"IsResourceGroup":null,"LibraryGroup":"","LibraryShareId":"00000000-0000-0000-0000-000000000000","Location":null,"Namespace":null,"ReleaseTime":null,"SANCopyCapable":false,"Type":null,"VirtualizationPlatform":"HyperV","OperatingSystem":"Unknown","OperatingSystemInstance":{"Name":"Unknown","Description":"Virtual Machine Manager was unable to determine the operating system for this object.","Version":null,"Architecture":"x86","Edition":null,"OSType":"Other","ProductType":null},"OperatingSystemId":null,"Tag":[]}

Example: Get all VirtualHardDisk objects of a virtual machine

This example reads all virtual hard disks of a specific virtual machine. This involves querying the VirtualMachines collection for a specific virtual machine, while expanding the VirtualDVDDrives property. With this property expanded, the virtual machine object fills the property with the virtual hard disks associated with the virtual machine.

For more information about how to get started with using the code examples provided in this programming guide, see Program in Visual Studio with the Windows Azure Pack IaaS Resource Provider [SPFSDK].

Guid stampId = new Guid("56ebc6dc-f63c-46e2-8438-2967e0ad83bc");
Guid vmId = new Guid("ee9fb3ed-c2f1-4ed5-9597-0a30c69d17f8");

var vhds = vmmService.VirtualMachines.Expand("VirtualHardDisks").Where(v => v.StampId == stampId && v.ID == vmId).First().VirtualHardDisks.ToList();

HTTP Request

GET https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/VirtualMachines(StampId=guid'56ebc6dc-f63c-46e2-8438-2967e0ad83bc',ID=guid'ee9fb3ed-c2f1-4ed5-9597-0a30c69d17f8')?$expand=VirtualHardDisks HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8
DataServiceUrlConventions: KeyAsSegment
User-Agent: Microsoft ADO.NET Data Services
Authorization: Bearer {ENCODED AUTHENTICATION TOKEN}
x-ms-principal-id: tenant@fabrikam.com
Host: contoso.com:30005

HTTP Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 5511
Content-Type: application/json; odata=minimalmetadata; streaming=true; charset=utf-8
Server: Microsoft-IIS/8.5
X-Content-Type-Options: nosniff
request-id: 5fbd8ef2-63e6-0000-067e-c15fe663cf01
DataServiceVersion: 3.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Thu, 12 Jun 2014 00:39:52 GMT

{"odata.metadata":"https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/$metadata#VirtualMachines/@Element","VirtualHardDisks":[{"Accessibility":"Internal","AddedTime":"2014-05-06T16:38:13.733-07:00","Description":"","Directory":null,"Enabled":true,"ID":"f373b056-0aa6-4882-a05d-1876227fd439","JobGroupId":null,"MaximumSize":"32212254720","ModifiedTime":"2014-06-11T16:40:21.9490175-07:00","Name":"SCX-2k3.vhd","Owner":{"UserName":null,"RoleName":null,"RoleID":null},"OwnerSid":null,"ParentDiskId":null,"SharePath":null,"Size":"2928402432","State":"Normal","VHDType":"DynamicallyExpanding","VMId":null,"TemplateId":null,"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","FamilyName":null,"Release":null,"CloudId":null,"HostVolumeId":null,"IsOrphaned":false,"IsResourceGroup":null,"LibraryGroup":"","LibraryShareId":"00000000-0000-0000-0000-000000000000","Location":null,"Namespace":null,"ReleaseTime":null,"SANCopyCapable":false,"Type":null,"VirtualizationPlatform":"HyperV","OperatingSystem":"Unknown","OperatingSystemInstance":{"Name":"Unknown","Description":"Virtual Machine Manager was unable to determine the operating system for this object.","Version":null,"Architecture":"x86","Edition":null,"OSType":"Other","ProductType":null},"OperatingSystemId":null,"Tag":[]}],"AddedTime":"2014-05-06T16:38:12.953-07:00","Agent":null,"AllocatedGPU":null,"BackupEnabled":true,"BlockLiveMigrationIfHostBusy":null,"CanVMConnect":true,"CheckpointLocation":null,"CloudId":"d1f15abc-672d-464b-b3bc-376d2087bb8e","ComputerName":"MICROSOF-6F2DDB","ComputerTierId":null,"CostCenter":null,"CPUCount":1,"CPUMax":100,"CPUReserve":0,"CPUType":"3.60 GHz Xeon (2 MB L2 cache)","CPUUtilization":0,"CreationSource":"Temporary Template1fe3eca3-80b2-4cbd-a7b2-5aa361ef6379","CreationTime":"2014-05-06T16:38:12.953-07:00","DataExchangeEnabled":true,"DelayStart":0,"DeployPath":null,"Description":"","DiskIO":0,"Dismiss":null,"DynamicMemoryDemandMB":0,"Enabled":true,"ExcludeFromPRO":false,"ExpectedCPUUtilization":20,"FailedJobID":null,"HasPassthroughDisk":false,"HasSavedState":false,"HasVMAdditions":true,"HeartbeatEnabled":true,"HighlyAvailable":null,"ID":"ee9fb3ed-c2f1-4ed5-9597-0a30c69d17f8","IsFaultTolerant":false,"IsHighlyAvailable":false,"IsUndergoingLiveMigration":false,"LastRestoredCheckpointId":"007f6901-1a11-433d-b0d6-529a97978ad1","LibraryGroup":"","LimitCPUForMigration":false,"LimitCPUFunctionality":false,"VMNetworkAssignments":[],"Location":"","MarkedAsTemplate":false,"Memory":4000,"MemoryAssignedMB":0,"MemoryAvailablePercentage":null,"ModifiedTime":"2014-06-11T16:40:21.9490175-07:00","MostRecentTaskId":"6b6d2a71-f79a-4773-9a4d-35910dcaed39","Name":"Tenent Test Virtual Machine 1","NetworkUtilization":0,"NumLock":null,"OperatingSystem":"Windows Server 2003 Enterprise Edition (32-bit x86)","OperatingSystemInstance":{"Name":"Windows Server 2003 Enterprise Edition (32-bit x86)","Description":"Windows Server 2003 Enterprise Edition (32-bit x86)","Version":"5.2","Architecture":"x86","Edition":"Enterprise","OSType":"Windows","ProductType":"VER_NT_SERVER"},"OperatingSystemShutdownEnabled":true,"Operation":null,"Owner":{"UserName":"tenant@fabrikam.com","RoleName":"tenant@fabrikam.com_86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06","RoleID":"86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06"},"GrantedToList":[],"Path":null,"PerfCPUUtilization":0,"PerfDiskBytesRead":"0","PerfDiskBytesWrite":"0","PerfNetworkBytesRead":"0","PerfNetworkBytesWrite":"0","CPURelativeWeight":null,"Retry":null,"RunGuestAccount":null,"ServiceDeploymentErrorMessage":null,"ServiceId":null,"SharePath":null,"SourceObjectType":"VM Template","StartAction":"TurnOnVMIfRunningWhenVSStopped","StartVM":null,"Status":"PowerOff","StatusString":"Stopped","StopAction":"SaveVM","Tag":"(none)","TimeSynchronizationEnabled":true,"TotalSize":"2928402432","Undo":null,"UndoDisksEnabled":false,"UpgradeDomain":null,"UseCluster":null,"UseLAN":null,"VirtualHardDiskId":null,"VirtualizationPlatform":"HyperV","CapabilityProfile":null,"VMBaseConfigurationId":null,"VMConnection@odata.mediaContentType":"application/x-rdp","VMConfigResource":null,"VMCPath":null,"VMHostName":null,"VMId":"007f6901-1a11-433d-b0d6-529a97978ad1","StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","VMResource":null,"VMResourceGroup":null,"VirtualMachineState":"PowerOff","VMTemplateId":null,"HardwareProfileId":null,"BlockDynamicOptimization":null,"CPULimitForMigration":null,"CPULimitFunctionality":null,"Domain":null,"DynamicMemoryBufferPercentage":null,"DynamicMemoryEnabled":false,"DynamicMemoryMaximumMB":null,"FullName":null,"MemoryWeight":5000,"OrganizationName":null,"DelayStartSeconds":null,"ProductKey":null,"WorkGroup":null,"TimeZone":null,"RunAsAccountUserName":null,"UserName":null,"Password":null,"LocalAdminRunAsAccountName":null,"LocalAdminUserName":null,"LocalAdminPassword":null,"LinuxDomainName":null,"LinuxAdministratorSSHKey":null,"LinuxAdministratorSSHKeyString":null,"CloudVMRoleName":null,"Generation":1,"DeploymentErrorInfo":{"CloudProblem":null,"Code":null,"DetailedCode":null,"DetailedErrorCode":null,"DetailedSource":null,"DisplayableErrorCode":null,"ErrorCodeString":null,"ErrorType":null,"ExceptionDetails":null,"IsConditionallyTerminating":null,"IsDeploymentBlocker":null,"IsMomAlert":null,"IsSuccess":null,"IsTerminating":null,"MessageParameters":null,"MomAlertSeverity":null,"Problem":null,"RecommendedAction":null,"RecommendedActionCLI":null,"ShowDetailedError":null},"NewVirtualNetworkAdapterInput":[],"IsRecoveryVM":false}

See Also

VirtualHardDisks Collection [SPFSDK][VMMREF]
VirtualHardDisk [SPFSDK][VMMREF]