【问题标题】:Will I lose the data from my disk if I switch from SSD to HDD in a azure VM?如果我在 Azure VM 中从 SSD 切换到 HDD,我会丢失磁盘中的数据吗?
【发布时间】:2021-08-07 06:00:18
【问题描述】:

我有 500 美元可用于 Azure 积分。我注意到 SSD 的成本很高,所以我想从 SSD 磁盘切换到 HDD 磁盘。我想知道如果我切换我的数据会丢失吗?我为这个问题的糟糕语法道歉。如果您需要我让我的问题更清楚,请发表评论。

【问题讨论】:

  • 我觉得你不能改变磁盘类型。你必须创建一个新的,复制到它,然后你可以删除旧的或类似的东西。
  • 哦,我看到了这篇文章:docs.microsoft.com/en-us/azure/virtual-machines/windows/…@Thomas
  • 那么,我错了^^对不起我之前的评论
  • 没关系 ឵឵ ឵឵ ឵឵ ឵឵ ឵឵ ឵឵
  • 如果您想知道如何更改它,请转到磁盘帐户中的大小+性能,您可以更改它。我只是担心它会重新安装操作系统,或删除我的数据

标签: azure scaling azure-vm


【解决方案1】:

您可以将 VM OS 磁盘从 Premium SSD 磁盘转换为 Standard HDD 磁盘。

您的数据不会丢失。

来自 Azure 门户的配置示例:

  1. 从虚拟机列表中选择虚拟机。
  2. 如果 VM 未停止,请选择 VM 概览窗格顶部的停止,然后等待 VM 停止。
  3. 在 VM 窗格中,从菜单中选择磁盘。
  4. 选择要转换的磁盘。
  5. 从菜单中选择配置。
  6. 将帐户类型从原始磁盘类型更改为所需的磁盘类型。

https://www.unixarena.com/2019/12/azure-how-to-convert-disk-from-premium-to-standard-ssd-vice-versa.html/

使用 CLI 的配置示例:

#resource group that contains the managed disk
rgName='yourResourceGroup'

#Name of your managed disk
diskName='yourManagedDiskName'

#Premium capable size 
#Required only if converting from Standard to Premium
size='Standard_DS2_v2'

#Choose between Standard_LRS, StandardSSD_LRS and Premium_LRS based on your scenario
sku='Premium_LRS'

#Get the parent VM Id 
vmId=$(az disk show --name $diskName --resource-group $rgName --query managedBy --output tsv)

#Deallocate the VM before changing the size of the VM
az vm deallocate --ids $vmId 

#Change the VM size to a size that supports Premium storage 
#Skip this step if converting storage from Premium to Standard
az vm resize --ids $vmId --size $size

# Update the SKU
az disk update --sku $sku --name $diskName --resource-group $rgName 

az vm start --ids $vmId 

https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-disk-storage

【讨论】:

    猜你喜欢
    • 2019-01-05
    • 2019-01-16
    • 2015-01-17
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-28
    • 2017-08-10
    相关资源
    最近更新 更多