탐색 건너뛰기

Azure DevTest Labs: Changes in exporting custom image VHD files

2017년 5월 31일 수요일

When you select to create custom images from a virtual machine, Azure DevTest Labs now generates the following instead of VHD files:

This allows Sysprep'ed/deprovisioned custom images to support data disks in addition to the OS disk through a single image. It also enables hundreds of new VMs by using your custom image without the need to copy or manage any storage accounts. The change also improves the performance and reliability of creating custom images from lab VMs.

When you need to export custom image VHD files for distribution, use these steps:

  1. Apply the Sysprep artifact (for a Windows VM) or deprovision the artifact (for a Linux VM) to your target lab VM. Skip this step if you need a non-Sysprep'ed/deprovisioned custom image.
  2. Export the VHD file directly from the VM OS disk.

You can export the VHD file from the Azure portal or through APIs.

To export the VHD file from the portal:

  1. Locate the Compute VM resource from the lab VM and open the Compute VM blade.
  2. Select Disks from the SETTINGS menu.
  3. Select the OS disk on the Disks blade.
  4. If it's a managed disk, select Export button on top of the disk blade. Otherwise, the VHD URI is shown at the bottom of the page.

To export the VHD file from a managed VM OS disk through automation, try the following sample in PowerShell:

  $DTLVMID = "/subscriptions/" + $subscriptionID + "/resourcegroups/" + $labRgName + "/providers/microsoft.devtestlab/labs/" + $labName + "/virtualmachines/" + $labVmName

  $DTLVM = Get-AzureRmResource -ResourceId $DTLVMID

  $ComputeID = Get-AzureRmVM | Where-Object -FilterScript {$_.Id -eq $DTLVM.Properties.computeId}

  $mdiskURL = (Grant-AzureRmDiskAccess -ResourceGroupName $ComputeID.ResourceGroupName -DiskName $ComputeID.StorageProfile.OsDisk.Name -Access Read -DurationInSecond 3600).AccessSAS

Grant-AzureRmDiskAccess is what gives you a valid URL for the VHD.

체험 계정

Azure 크레딧 $200을 얻고 인기 서비스를 12개월 간 체험해 보세요.

시작

Visual Studio

구독자는 매년 최대 $1800 상당의 Azure 서비스를 이용할 수 있습니다.

지금 활성화

스타트업

Microsoft for Startups에 참가하고 Azure 서비스를 체험해 보세요.

자세한 정보