Skip to content

Commit ce585af

Browse files
authored
Merge pull request Azure#4725 from jagilber/issue4706
fix issue Azure#4706 Add-AzureRmServiceFabricNodeType fails with error The…
2 parents a42ab05 + 110c3b0 commit ce585af

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/AddAzureRmServiceFabricNodeType.cs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -483,19 +483,28 @@ private string GetStorageRandomName()
483483

484484
private VirtualMachineScaleSetStorageProfile GetStorageProfile(VirtualMachineScaleSetStorageProfile existingProfile)
485485
{
486-
var vhds = CreateStorageAccount().Select(a => string.Concat(a.PrimaryEndpoints.Blob, "vhd")).ToList();
486+
var osDisk = new VirtualMachineScaleSetOSDisk()
487+
{
488+
Caching = existingProfile.OsDisk.Caching,
489+
OsType = existingProfile.OsDisk.OsType,
490+
CreateOption = existingProfile.OsDisk.CreateOption
491+
};
492+
493+
if(existingProfile.OsDisk.ManagedDisk != null)
494+
{
495+
osDisk.ManagedDisk = existingProfile.OsDisk.ManagedDisk;
496+
}
497+
else
498+
{
499+
osDisk.Image = existingProfile.OsDisk.Image;
500+
osDisk.Name = existingProfile.OsDisk.Name;
501+
osDisk.VhdContainers = CreateStorageAccount().Select(a => string.Concat(a.PrimaryEndpoints.Blob, "vhd")).ToList();
502+
}
503+
487504
return new VirtualMachineScaleSetStorageProfile()
488505
{
489506
ImageReference = existingProfile.ImageReference,
490-
OsDisk = new VirtualMachineScaleSetOSDisk()
491-
{
492-
Caching = existingProfile.OsDisk.Caching,
493-
OsType = existingProfile.OsDisk.OsType,
494-
Image = existingProfile.OsDisk.Image,
495-
Name = existingProfile.OsDisk.Name,
496-
CreateOption = existingProfile.OsDisk.CreateOption,
497-
VhdContainers = vhds
498-
}
507+
OsDisk = osDisk
499508
};
500509
}
501510

0 commit comments

Comments
 (0)