azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

incorrect warning "Since the VM is created using premium storage...."

Open axelgMS opened this issue 9 years ago • 12 comments

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 Since the VM is created using premium storage, existing standard storage account, {0}, is used for boot diagnostics. 459 {0} = existing standard storage account name 460

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();

axelgMS avatar Apr 06 '17 11:04 axelgMS

well , close this issue .. instead of removing the second item , I had commented it out .. and this generated the error

sabbadino avatar Apr 07 '17 06:04 sabbadino

@Sabbadino - your comment might not apply to this issue

axelgMS avatar Apr 07 '17 07:04 axelgMS

@singhkays Hey Kay, would you mind taking a look at this issue?

cormacpayne avatar Apr 10 '17 22:04 cormacpayne

i just add this line on my script before deploy vm;

$stDiagName="StorageAccountNameForDiagnostic" Set-AzureRmVMBootDiagnostics -VM $VirtualMachine -Enable -ResourceGroupName $resourceGroupName -StorageAccountName $stDiagName

martimartin avatar Apr 19 '17 13:04 martimartin

@hyonholee Can you take a look at the logic used to determine this?

singhkays avatar May 12 '17 17:05 singhkays

Thanks much, martimartin! Your suggestion helped.

raakeshn avatar Jul 12 '17 07:07 raakeshn

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?

yobyot avatar Jul 25 '17 20:07 yobyot

+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."

craiglandis avatar Dec 04 '17 21:12 craiglandis

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

smudge202 avatar Feb 09 '18 02:02 smudge202

@nibhat @hyonholee ping

cormacpayne avatar Jul 10 '18 22:07 cormacpayne

@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.

knithinc avatar Jan 09 '19 17:01 knithinc

This is fixed. Otherwise reopen this issue.

RakeshMohanMSFT avatar Jan 04 '23 19:01 RakeshMohanMSFT