Share via


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

 

Applies To: Windows Azure Pack

Gets a VirtualDiskDrive [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 VirtualDiskDrive object

  • Example: Get all VirtualDiskDrive objects

  • Example: Get all VirtualDiskDrive objects for 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/VirtualDiskDrives(ID=Guid'[value]',StampId=Guid'[value]')

HTTP/1.1

GET

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

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 VirtualDiskDrive [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#VirtualDiskDrives/@Element",
  "StampId": "56ebc6dc-f63c-46e2-8438-2967e0ad83bc",
  "ID": "e173da87-7e5a-4a25-817a-f2dc82fab370",
  "Bus": 0,
  "BusType": "IDE",
  "IsVHD": true,
  "LUN": 0,
  "Name": "Windows 2k3",
  "VMId": null,
  "TemplateId": null,
  "ISOId": null,
  "HostDrive": null,
  "ISOLinked": null,
  "Accessibility": "Public",
  "Description": "",
  "AddedTime": "2014-04-30T15:14:31.613-07:00",
  "ModifiedTime": "2014-04-30T15:14:32.38-07:00",
  "Enabled": true,
  "VirtualHardDiskId": "b716d7a8-caba-4c8a-925d-4ec240172175",
  "VolumeType": "BootAndSystem",
  "IDE": null,
  "SCSI": null,
  "FileName": null,
  "Path": null,
  "Size": "2907425792"
}

Example: Get all VirtualDiskDrive objects

This example reads all the virtual disk drives 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 vDiskDrives = vmmService.VirtualDiskDrives.ToList();

HTTP Request

GET https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/VirtualDiskDrives 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: 1810
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-a97a-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: Wed, 11 Jun 2014 20:01:16 GMT

{"odata.metadata":"https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/$metadata#VirtualDiskDrives","value":[{"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","ID":"e173da87-7e5a-4a25-817a-f2dc82fab370","Bus":0,"BusType":"IDE","IsVHD":true,"LUN":0,"Name":"Windows 2k3","VMId":null,"TemplateId":null,"ISOId":null,"HostDrive":null,"ISOLinked":null,"Accessibility":"Public","Description":"","AddedTime":"2014-04-30T15:14:31.613-07:00","ModifiedTime":"2014-04-30T15:14:32.38-07:00","Enabled":true,"VirtualHardDiskId":"b716d7a8-caba-4c8a-925d-4ec240172175","VolumeType":"BootAndSystem","IDE":null,"SCSI":null,"FileName":null,"Path":null,"Size":"2907425792"},{"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","ID":"5dce5cdb-869f-4551-b1c9-b5455b58309a","Bus":0,"BusType":"IDE","IsVHD":true,"LUN":0,"Name":"Tenant VM 1","VMId":null,"TemplateId":null,"ISOId":null,"HostDrive":null,"ISOLinked":null,"Accessibility":"Public","Description":"","AddedTime":"2014-05-01T13:50:39.38-07:00","ModifiedTime":"2014-06-11T09:07:44.4115991-07:00","Enabled":true,"VirtualHardDiskId":"59e74e88-0cde-4020-95a0-9de53a0c46a1","VolumeType":"BootAndSystem","IDE":null,"SCSI":null,"FileName":null,"Path":null,"Size":"2928402432"},{"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","ID":"22ccc731-129b-4baf-b867-e2c5385da842","Bus":0,"BusType":"IDE","IsVHD":true,"LUN":0,"Name":"Tenent Test Virtual Machine 1","VMId":null,"TemplateId":null,"ISOId":null,"HostDrive":null,"ISOLinked":null,"Accessibility":"Public","Description":"","AddedTime":"2014-05-06T16:38:13.703-07:00","ModifiedTime":"2014-06-11T09:07:43.8490708-07:00","Enabled":true,"VirtualHardDiskId":"f373b056-0aa6-4882-a05d-1876227fd439","VolumeType":"BootAndSystem","IDE":null,"SCSI":null,"FileName":null,"Path":null,"Size":"2928402432"}]}

Example: Get a specific VirtualDiskDrive object

This example reads a specific virtual disk drive 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 vddId = new Guid("e173da87-7e5a-4a25-817a-f2dc82fab370");

var vDiskDrive = vmmService.VirtualDiskDrives.Where(d => d.StampId == stampId && d.ID == vddId).First();

HTTP Request

GET https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/VirtualDiskDrives(StampId=guid'56ebc6dc-f63c-46e2-8438-2967e0ad83bc',ID=guid'e173da87-7e5a-4a25-817a-f2dc82fab370') 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: 694
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-897a-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: Wed, 11 Jun 2014 19:55:13 GMT

{"odata.metadata":"https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/$metadata#VirtualDiskDrives/@Element","StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","ID":"e173da87-7e5a-4a25-817a-f2dc82fab370","Bus":0,"BusType":"IDE","IsVHD":true,"LUN":0,"Name":"Windows 2k3","VMId":null,"TemplateId":null,"ISOId":null,"HostDrive":null,"ISOLinked":null,"Accessibility":"Public","Description":"","AddedTime":"2014-04-30T15:14:31.613-07:00","ModifiedTime":"2014-04-30T15:14:32.38-07:00","Enabled":true,"VirtualHardDiskId":"b716d7a8-caba-4c8a-925d-4ec240172175","VolumeType":"BootAndSystem","IDE":null,"SCSI":null,"FileName":null,"Path":null,"Size":"2907425792"}

Example: Get all VirtualDiskDrive objects for a virtual machine

This example reads all virtual disk drives 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 disk drives 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 vDiskDrives = vmmService.VirtualMachines.Expand("VirtualDiskDrives").Where(v => v.StampId == stampId && v.ID == vmId).First().VirtualDiskDrives.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=VirtualDiskDrives 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: 4931
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-677b-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: Wed, 11 Jun 2014 21:14:18 GMT

{"odata.metadata":"https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/$metadata#VirtualMachines/@Element","VirtualDiskDrives":[{"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","ID":"22ccc731-129b-4baf-b867-e2c5385da842","Bus":0,"BusType":"IDE","IsVHD":true,"LUN":0,"Name":"Tenent Test Virtual Machine 1","VMId":null,"TemplateId":null,"ISOId":null,"HostDrive":null,"ISOLinked":null,"Accessibility":"Public","Description":"","AddedTime":"2014-05-06T16:38:13.703-07:00","ModifiedTime":"2014-06-11T09:07:43.85-07:00","Enabled":true,"VirtualHardDiskId":"f373b056-0aa6-4882-a05d-1876227fd439","VolumeType":"BootAndSystem","IDE":null,"SCSI":null,"FileName":null,"Path":null,"Size":"2928402432"}],"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-11T09:07:43.85-07:00","MostRecentTaskId":"12a7c03d-3d46-44bd-95b0-121bfa709938","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":-1,"PerfDiskBytesRead":"-1","PerfDiskBytesWrite":"-1","PerfNetworkBytesRead":"-1","PerfNetworkBytesWrite":"-1","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

VirtualDiskDrives Collection [SPFSDK][VMMREF]
VirtualDiskDrive [SPFSDK][VMMREF]
Create (POST) a VirtualDiskDrive [SPFSDK][VMMREF]
Delete (DELETE) a VirtualDiskDrive [SPFSDK][VMMREF]