Reputation: 2404
I have $500 to spend in Azure credits. I noticed that the SSD costs to much, So I want to switch from an SSD disk to an HDD disk. I was wondering if I switch will my data be lost? I apologize for the poor grammar in this question. Please comment if you need me to make my question more clear.
Upvotes: 1
Views: 5180
Reputation: 2522
You can convert VM OS disk from Premium SSD disk to Standard HDD disk.
Your data won't be lost.
Configuration example from Azure Portal:
Configuration example using 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://learn.microsoft.com/en-us/azure/virtual-machines/windows/convert-disk-storage
Upvotes: 2