Expand [SPFSDK][VMMREF]
Applies To: Windows Azure Pack
The Expand operation expands the size of the virtual disk drive. This operation is considered an Action. For more information about how OData operations work, see OData Operations.
Request
Method |
Request URI |
HTTP Version |
---|---|---|
POST |
https://{server-name}:{auth-port}/{subscription-id}/services/systemcenter/vmm/{entity-uri}/Expand |
HTTP/1.1 |
Note
This OData operation requires the request URL to point to an instance of the VirtualDiskDrive [SPFSDK][VMMREF] entity. For more information, see Identify an entity through the URL. This entity type is usually provided by the VirtualDiskDrives Collection [SPFSDK][VMMREF].
Behavior
The following table describes how this operation behaves.
Setting |
Value |
---|---|
Is composable? |
False |
Has side effects? |
True |
Requires an entity instance? |
True |
Return type |
None |
Results belong to an entity set? |
None |
Parameters
Because this operation is an Action, parameters are passed in the body of the request as a JSON object. For more information about how OData operations work, see OData Operations
Name |
Type |
Nullable |
Description |
---|---|---|---|
VirtualHardDiskSizeGB |
Edm.Int32 |
False |
The requested size of the virtual disk drive in gigabytes. |
Example: Expand a virtual disk drive
The following code example expands an existing VHD to 400GB. It demonstrates how to build a URI to this action, and provide the parameter in the body.
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");
// Get the drive we want to expand
var vdd = vmmService.VirtualMachines.Expand("VirtualDiskDrives").Where(v => v.StampId == stampId && v.ID == vmId).First().VirtualDiskDrives.First();
// Build a URI that identifies the specific drive, and uses the Expand action.
Uri expandActionUri = new Uri(string.Format("{0}(StampId=guid'{1}',ID=guid'{2}')/Expand", vmmService.VirtualDiskDrives.RequestUri, vdd.StampId, vdd.ID), UriKind.Absolute);
// Create the parameter object to be sent in the body of the action request.
System.Data.Services.Client.BodyOperationParameter parameter = new System.Data.Services.Client.BodyOperationParameter("VirtualHardDiskSizeGB", 400);
// Run the action.
vmmService.Execute(expandActionUri, "POST", new System.Data.Services.Client.OperationParameter[] { parameter });
HTTP Request
POST https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/VirtualDiskDrives(StampId=guid'56ebc6dc-f63c-46e2-8438-2967e0ad83bc',ID=guid'22ccc731-129b-4baf-b867-e2c5385da842')/Expand HTTP/1.1
DataServiceVersion: 3.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
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
Content-Length: 29
Expect: 100-continue
{"VirtualHardDiskSizeGB":400}
HTTP Response
HTTP/1.1 204 No Content
Cache-Control: no-cache
Content-Length: 0
Server: Microsoft-IIS/8.5
x-ms-request-id: b935b4c5-8b9a-4974-9c47-021aae796572
X-Content-Type-Options: nosniff
request-id: 5fbd8ef2-63e6-0000-19d4-c15fe663cf01
DataServiceVersion: 1.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Tue, 17 Jun 2014 15:57:27 GMT