本文介绍了如何获取存储在Azure资源管理器中的已捕获VM映像的URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据现有VM安装的sysprep捕获在Azure RM中创建新的VM.那就是:

I am trying to create a new VM in Azure RM based on the sysprepped capture of an existing VM installation. That is:

$urlOfCapturedImage = <I cannot find this>

...

$vm = Set-AzureRmVMOSDisk -VM $vm -Name $osDiskName -VhdUri $newOsDiskUri `
        -CreateOption fromImage -SourceImageUri $urlOfCapturedImage -Windows

New-AzureRmVM -ResourceGroupName $resourceGroupName -Location $location -VM $vm

我当前的问题是为存储的VM映像找到正确的URL,因为它似乎没有作为VHD Blob存储在我的存储帐户中.相反,我在图片类别中找到了它,并提供了以下有限信息:

My current problem is finding the correct URL for the stored VM image, since it doesn't appear to be stored as a VHD blob in my storage account. Instead, I find it in the Images category, with the following, limited information:

我尝试使用以下URL/URI,但是它们都不起作用:

I have tried using the following URL/URIs, but none of them work:

https://<storage-account-name>.blob.core.windows.net/system/Microsoft.Compute/Images/jira-7-sysprep-20170724133831.vhd

/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/images/jira-7-sysprep-20170724133831

有人知道如何为我的VM映像获取正确的URL吗?还是仅仅是我完全使用了错误的方法?

Does anyone know how to get the proper URL for my VM image? Or could it simply be that I am using the wrong method altogether?

推荐答案

对于Azure VM映像,VHD由Azure管理,您无法获取URL.

For a Azure VM image, the VHD is managed by Azure, you could not get the URL.

您的命令用于从存储帐户创建VM.如果要从映像创建VM,则可以使用以下命令从自定义映像创建VM.

Your command is used for create VM from storage account. If you want to create VM from image, you could use the following command to create a VM from custom image.

$image = Get-AzureRmImage `
    -ImageName myImage `
    -ResourceGroupName myResourceGroupImages

# Here is where we specify that we want to create the VM from and image and provide the image ID
$vmConfig = Set-AzureRmVMSourceImage -VM $vmConfig -Id $image.Id

$vmConfig = Add-AzureRmVMNetworkInterface -VM $vmConfig -Id $nic.Id

New-AzureRmVM `
    -ResourceGroupName myResourceGroupFromImage `
    -Location EastUS `
    -VM $vmConfig

有关此的更多信息,请参考此链接.

More information about this please refer to this link.

这篇关于如何获取存储在Azure资源管理器中的已捕获VM映像的URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 18:49