incorrect warning "Since the VM is created using premium storage...."
Cmdlet(s)
New-AzureRMVM
PowerShell Version
Instructions: to get PowerShell version, type $PSVersionTable and look for the value associated with PSVersion
PSVersion 5.1.14393.953
Module Version
OS Version
Instructions: to get OS version, type $PSversionTable and look for value associated with BuildVersion
BuildVersion 10.0.14393.953
Description
Creating a new VM with Standard storage from an image stored in Standard Storage Account. New-AzureRMVM incorrectly throws a warning about "Premium storage"
WARNING: Since the VM is created using premium storage, existing standard storage account, rg34915313diag932, is used for boot diagnostics.
Debug Output
Instructions: to get Debug Output, set $DebugPreference="Continue" and then execute the cmdlet or script causing the issue
PS C:> New-AzureRmVM -ResourceGroupName $rgName -Location $location -VM $vm -Verbose WARNING: Since the VM is created using premium storage, existing standard storage account, rg34915313diag932, is used for boot diagnostics. VERBOSE: Performing the operation "New" on target "vm-from-image".
RequestId IsSuccessStatusCode StatusCode ReasonPhrase
True OK OK
Script/Steps for Reproduction
Definition is here
457
458
Used here: 221 private string GetOrCreateStorageAccountForBootDiagnostics() 222 { 223 var storageAccountName = GetStorageAccountNameFromStorageProfile(); […] 267 WriteWarning(string.Format(Properties.Resources.UsingExistingStorageAccountForBootDiagnostics, storageAccount.Name)); 268 return storageAccount.PrimaryEndpoints.Blob; 269 }
And looks like it’s thrown when executing the New-AzureRMVM cmdlet and VM doesn’t have a DiagnosticsProfile - code
76 public override void ExecuteCmdlet()
77 {
78 base.ExecuteCmdlet();
79
80 if (this.VM.DiagnosticsProfile == null)
81 {
82 var storageUri = GetOrCreateStorageAccountForBootDiagnostics();
well , close this issue .. instead of removing the second item , I had commented it out .. and this generated the error
@Sabbadino - your comment might not apply to this issue
@singhkays Hey Kay, would you mind taking a look at this issue?
i just add this line on my script before deploy vm;
$stDiagName="StorageAccountNameForDiagnostic" Set-AzureRmVMBootDiagnostics -VM $VirtualMachine -Enable -ResourceGroupName $resourceGroupName -StorageAccountName $stDiagName
@hyonholee Can you take a look at the logic used to determine this?
Thanks much, martimartin! Your suggestion helped.
I'm an Azure newbie and my question is is this warning to be ignored or is it, in fact, stating that some artifacts are being used outside of my storage group my script is creating the VM in? IOW, do I have to clean up something else, outside of the resource group I created the VM in?
+1 - this still repros in the November 2017 release. When I create a Standard_A2 VM without specifying any of the storage details, it creates it as a managed disk in standard storage, but nonetheless throws the warning -
"WARNING: Since the VM is created using premium storage, existing standard storage account, 1404ltsdiag694, is used for boot diagnostics."
Note, when multiple storage accounts are available, the command can default to using a storage account outside of the VM's location, leading to the command failing
$vm = New-AzureRmVM -VM $vmConfig -Location $location -ResourceGroupName $rg
WARNING: Since the VM is created using premium storage, existing standard storage account, randomstorageaccount, is
used for boot diagnostics.
New-AzureRmVM : Long running operation failed with status 'Failed'. Additional Info:'StorageAccount
'randomstorageaccount' associated with VM 'new vm' for boot diagnostics encountered an error. Please look at the
error code for more information about the error.'
ErrorCode: StorageAccountLocationMismatch
ErrorMessage: StorageAccount 'randomstorageaccount' associated with VM 'new vm' for boot diagnostics encountered
an error. Please look at the error code for more information about the error.
StartTime: 09/02/2018 02:12:47
EndTime: 09/02/2018 02:13:05
OperationID: 6f39253d-b1f4-4206-b0a6-968f8810255a
Status: Failed
At line:1 char:7
+ $vm = New-AzureRmVM -VM $vmConfig -Location $location -ResourceGroupN ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmVM], ComputeCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand
@nibhat @hyonholee ping
@hyonholee could you please provide an update on this issue? We have a customer ICM requesting why there is this warning, and would like to get a better understanding of it.
This is fixed. Otherwise reopen this issue.