Reputation: 1592
I am trying to create a VM using AZ PowerShell but I get an error.
New-AzVM : Using a client owned (un-managed) storage account for boot diagnostics is not supported for VMs.
ErrorCode: OperationNotAllowed
ErrorMessage: Using a client owned (un-managed) storage account for boot diagnostics is not supported for VMs.
ErrorTarget:
StatusCode: 409
ReasonPhrase: Conflict
OperationID :
+ New-AzVM -ResourceGroupName $primaryResourceGroupName -Locati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzVM], ComputeCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand
I am wondering
Upvotes: 0
Views: 261
Reputation: 4923
To more specific to your ask
1 . how to check if my storage account is managed or unmanaged
Run the following cmd
to check whether the VM OS DISK is managed or unmanaged :
(get-azurermvm -ResourceGroupName NAME -Name yourvm).StorageProfile.OsDisk
Here is the sample screenshot with unmanaged disk VM .
2.how to make the storage account to be managed?
Now we need to stop the VM to convert Unmanaged to managed disk
Run the below cmd to STOP the VM
$rgName = "myResourceGroup"
$vmName = "myVM"
Stop-AzVM -ResourceGroupName $rgName -Name $vmName -Force
Then Run this cmd to convert to Managed disk
ConvertTo-AzVMManagedDisk -ResourceGroupName $rgName -VMName $vmName
Here are the reference output of successfully converted :
For more information please refer this MS DOC: Create VM & Convert Single Instance VM
Upvotes: 1