azure - 是否可以将 Azure VM 从托管磁盘转换为非托管磁盘?

标签 azure azure-storage azure-virtual-machine

我已在 Azure 中使用托管磁盘创建了新的 VM。现在我想将其转换为非托管磁盘。有可能吗?

最佳答案

now i want to convert it to Unmanaged disk. Is it Possible?

无法直接将其转换为非托管磁盘。

作为解决方法,我们可以将 VHD 从托管磁盘复制到非托管磁盘,然后使用此 VHD 创建新的虚拟机。

我们可以使用 PowerShell 命令来做到这一点:

$sas = Grant-AzureRmDiskAccess -ResourceGroupName "[ResourceGroupName]" -DiskName "[ManagedDiskName]" -DurationInSecond 3600 -Access Read  
$destContext = New-AzureStorageContext –StorageAccountName "[StorageAccountName]" -StorageAccountKey "[StorageAccountAccessKey]"
$blobcopy=Start-AzureStorageBlobCopy -AbsoluteUri $sas.AccessSAS -DestContainer "[ContainerName]" -DestContext $destContext -DestBlob "[NameOfVhdFileToBeCreated].vhd"

复制完成后,我们就可以使用新的VHD来创建虚拟机了。

这是一个template关于使用现有VHD和现有Vnet创建Azure虚拟机,请引用。

关于azure - 是否可以将 Azure VM 从托管磁盘转换为非托管磁盘?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45566291/

相关文章:

c# - Azure存储错误: "An attempt was made to access a socket in a way forbidden by its access permissions."

Azure DevOps -> 管道 -> 发布 -> 访问 Azure Key Vault Secret -> 嵌套级别 JSON 变量替换/转换

c# - 保存来自不同区域的日期时间值 ASP.NET

asp.net - 与本地机相比,为什么 Azure 上的 SQL Server 数据库从虚拟机的响应速度较慢?

azure - 从 VM 内部确定 VM 位于哪个 Azure 区域

azure - 在 Web 表单应用程序的一页上启用 Azure AD 身份验证

git - 将 git 存储库从一个项目链接到另一个 Azure DevOps 项目

Azure表存储抛出异常: Unable to read data from the transport connection:

azure - 是否始终需要对(Azure Blob 存储)存档层进行补充?

azure - 用于在 blob 容器内创建子目录并向其中插入一些数据的 PowerShell 脚本