Skip to content

Commit a56794b

Browse files
committed
fix data disks
1 parent 8881af3 commit a56794b

File tree

1 file changed

+30
-29
lines changed

1 file changed

+30
-29
lines changed

src/ResourceManager/Compute/Commands.Compute/Extension/AEM/SetAzureRmVMAEMExtension.cs

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -253,42 +253,43 @@ public override void ExecuteCmdlet()
253253
else
254254
{
255255
this._Helper.WriteWarning("[WARN] Standard Managed Disks are not supported. Extension will be installed but no disk metrics will be available.");
256-
256+
257257
}
258-
continue;
259258
}
260-
261-
var accountName = this._Helper.GetStorageAccountFromUri(disk.Vhd.Uri);
262-
if (!accounts.ContainsKey(accountName))
259+
else
263260
{
264-
var storageKey = this._Helper.GetAzureStorageKeyFromCache(accountName);
265-
accounts.Add(accountName, storageKey);
266-
}
267261

268-
this._Helper.WriteHost("[INFO] Adding configuration for data disk {0}", disk.Name);
269-
var caching = disk.Caching;
270-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.lun." + diskNumber, Value = disk.Lun });
271-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.name." + diskNumber, Value = this._Helper.GetDiskName(disk.Vhd.Uri) });
272-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.caching." + diskNumber, Value = caching });
273-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.account." + diskNumber, Value = accountName });
262+
var accountName = this._Helper.GetStorageAccountFromUri(disk.Vhd.Uri);
263+
if (!accounts.ContainsKey(accountName))
264+
{
265+
var storageKey = this._Helper.GetAzureStorageKeyFromCache(accountName);
266+
accounts.Add(accountName, storageKey);
267+
}
274268

275-
if (this._Helper.IsPremiumStorageAccount(accountName))
276-
{
277-
this._Helper.WriteVerbose("Data Disk {0} Storage Account is a premium account - adding SLAs for disk", diskNumber.ToString());
278-
var sla = this._Helper.GetDiskSLA(disk);
279-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.type." + diskNumber, Value = AEMExtensionConstants.DISK_TYPE_PREMIUM });
280-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.sla.throughput." + diskNumber, Value = sla.TP });
281-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.sla.iops." + diskNumber, Value = sla.IOPS });
282-
this._Helper.WriteVerbose("Done - Data Disk {0} Storage Account is a premium account - adding SLAs for disk", diskNumber.ToString());
269+
this._Helper.WriteHost("[INFO] Adding configuration for data disk {0}", disk.Name);
270+
var caching = disk.Caching;
271+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.lun." + diskNumber, Value = disk.Lun });
272+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.name." + diskNumber, Value = this._Helper.GetDiskName(disk.Vhd.Uri) });
273+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.caching." + diskNumber, Value = caching });
274+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.account." + diskNumber, Value = accountName });
283275

284-
}
285-
else
286-
{
287-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.type." + diskNumber, Value = AEMExtensionConstants.DISK_TYPE_STANDARD });
288-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.connminute." + diskNumber, Value = (accountName + ".minute") });
289-
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.connhour." + diskNumber, Value = (accountName + ".hour") });
290-
}
276+
if (this._Helper.IsPremiumStorageAccount(accountName))
277+
{
278+
this._Helper.WriteVerbose("Data Disk {0} Storage Account is a premium account - adding SLAs for disk", diskNumber.ToString());
279+
var sla = this._Helper.GetDiskSLA(disk);
280+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.type." + diskNumber, Value = AEMExtensionConstants.DISK_TYPE_PREMIUM });
281+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.sla.throughput." + diskNumber, Value = sla.TP });
282+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.sla.iops." + diskNumber, Value = sla.IOPS });
283+
this._Helper.WriteVerbose("Done - Data Disk {0} Storage Account is a premium account - adding SLAs for disk", diskNumber.ToString());
291284

285+
}
286+
else
287+
{
288+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.type." + diskNumber, Value = AEMExtensionConstants.DISK_TYPE_STANDARD });
289+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.connminute." + diskNumber, Value = (accountName + ".minute") });
290+
sapmonPublicConfig.Add(new KeyValuePair() { Key = "disk.connhour." + diskNumber, Value = (accountName + ".hour") });
291+
}
292+
}
292293
diskNumber += 1;
293294
}
294295

0 commit comments

Comments
 (0)