Enabled boot Diagnostics for all VM sizes by default.

Fixed issue where, boot diagnostics were not enabled for DS, GS series
VM sizes.
This commit is contained in:
Shital Savekar 2017-03-22 16:02:44 +05:30
Родитель 793c4e823a
Коммит 04d48d4d0d
1 изменённых файлов: 20 добавлений и 8 удалений

Просмотреть файл

@ -356,6 +356,7 @@ else
{
LogMsg "Using ARM Storage Account : $StorageAccountName"
}
$bootDiagnosticsSA = "icadiagnostic$RGRandomNumber"
LogMsg "Using API VERSION : $apiVersion"
$ExistingVnet = $null
if ($RGXMLData.ARMVnetName -ne $null)
@ -598,6 +599,22 @@ Set-Content -Value "$($indents[0]){" -Path $jsonFile -Force
Add-Content -Value "$($indents[2])}," -Path $jsonFile
LogMsg "Added New Storage Account $StorageAccountName.."
}
#endregion
#region New ARM Bood Diagnostic Account
Add-Content -Value "$($indents[2]){" -Path $jsonFile
Add-Content -Value "$($indents[3])^apiVersion^: ^2015-06-15^," -Path $jsonFile
Add-Content -Value "$($indents[3])^type^: ^Microsoft.Storage/storageAccounts^," -Path $jsonFile
Add-Content -Value "$($indents[3])^name^: ^$bootDiagnosticsSA^," -Path $jsonFile
Add-Content -Value "$($indents[3])^location^: ^[variables('location')]^," -Path $jsonFile
Add-Content -Value "$($indents[3])^properties^:" -Path $jsonFile
Add-Content -Value "$($indents[3]){" -Path $jsonFile
Add-Content -Value "$($indents[4])^accountType^: ^Standard_LRS^" -Path $jsonFile
Add-Content -Value "$($indents[3])}" -Path $jsonFile
Add-Content -Value "$($indents[2])}," -Path $jsonFile
LogMsg "Added boot diagnostic Storage Account $bootDiagnosticsSA.."
#endregion
#region virtualNetworks
@ -1176,18 +1193,15 @@ foreach ( $newVM in $RGXMLData.VirtualMachine)
#endregion
#region Enable boot dignostics.
if (!($StorageAccountType -imatch "Premium_LRS"))
{
Add-Content -Value "$($indents[4])," -Path $jsonFile
Add-Content -Value "$($indents[4])^diagnosticsProfile^: " -Path $jsonFile
Add-Content -Value "$($indents[4]){" -Path $jsonFile
Add-Content -Value "$($indents[5])^bootDiagnostics^: " -Path $jsonFile
Add-Content -Value "$($indents[5]){" -Path $jsonFile
Add-Content -Value "$($indents[6])^enabled^: true," -Path $jsonFile
Add-Content -Value "$($indents[6])^storageUri^: ^[reference(resourceId('$StorageAccountRG', 'Microsoft.Storage/storageAccounts', '$StorageAccountName'), '2015-06-15').primaryEndpoints['blob']]^" -Path $jsonFile
Add-Content -Value "$($indents[6])^storageUri^: ^[reference(resourceId('$RGName', 'Microsoft.Storage/storageAccounts', '$bootDiagnosticsSA'), '2015-06-15').primaryEndpoints['blob']]^" -Path $jsonFile
Add-Content -Value "$($indents[5])}" -Path $jsonFile
Add-Content -Value "$($indents[4])}" -Path $jsonFile
}
#endregion
Add-Content -Value "$($indents[3])}" -Path $jsonFile
@ -1483,19 +1497,17 @@ if ( ($numberOfVMs -eq 1) -and !$EnableIPv6 -and !$ForceLoadBalancerForSingleVM
#region Enable boot dignostics.
if (!($StorageAccountType -imatch "Premium_LRS"))
{
Add-Content -Value "$($indents[4])," -Path $jsonFile
Add-Content -Value "$($indents[4])^diagnosticsProfile^: " -Path $jsonFile
Add-Content -Value "$($indents[4]){" -Path $jsonFile
Add-Content -Value "$($indents[5])^bootDiagnostics^: " -Path $jsonFile
Add-Content -Value "$($indents[5]){" -Path $jsonFile
Add-Content -Value "$($indents[6])^enabled^: true," -Path $jsonFile
Add-Content -Value "$($indents[6])^storageUri^: ^[reference(resourceId('$StorageAccountRG', 'Microsoft.Storage/storageAccounts', '$StorageAccountName'), '2015-06-15').primaryEndpoints['blob']]^" -Path $jsonFile
Add-Content -Value "$($indents[6])^storageUri^: ^[reference(resourceId('$RGName', 'Microsoft.Storage/storageAccounts', '$bootDiagnosticsSA'), '2015-06-15').primaryEndpoints['blob']]^" -Path $jsonFile
Add-Content -Value "$($indents[5])}" -Path $jsonFile
Add-Content -Value "$($indents[4])}" -Path $jsonFile
LogMsg "Added Diagnostics Profile."
} #endregion
#endregion
Add-Content -Value "$($indents[3])}" -Path $jsonFile