Skip to content

Commit 0f3ceed

Browse files
authored
Merge pull request Azure#11389 from hyonholee/march2
[Compute] March release
2 parents 2e7ac09 + fde54ef commit 0f3ceed

29 files changed

+10970
-2194
lines changed

src/Compute/Compute.Test/ScenarioTests/DiskRPTests.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,24 @@ function Test-Disk
3232
$mockkey = 'https://myvault.vault-int.azure-int.net/keys/mockkey/00000000000000000000000000000000';
3333
$mocksecret = 'https://myvault.vault-int.azure-int.net/secrets/mocksecret/00000000000000000000000000000000';
3434
$access = 'Read';
35+
$mockGalleryImageId = '/subscriptions/' + $subId + '/resourceGroups/' + $rgname + '/providers/Microsoft.Compute/galleries/swaggergallery/images/swaggerimagedef/versions/1.0.0';
3536

3637
# Config create test
3738
$diskconfig = New-AzDiskConfig -Location $loc -DiskSizeGB 500 -SkuName UltraSSD_LRS -OsType Windows -CreateOption Empty `
38-
-DiskMBpsReadWrite 8 -DiskIOPSReadWrite 500 -EncryptionType "EncryptionAtRestWithCustomerKey" -DiskEncryptionSetId $encSetId;
39+
-DiskMBpsReadWrite 8 -DiskIOPSReadWrite 500 -EncryptionType "EncryptionAtRestWithCustomerKey" -DiskEncryptionSetId $encSetId `
40+
-DiskIOPSReadOnly 1000 -DiskMBpsReadOnly 10 -MaxSharesCount 5 `
41+
-GalleryImageReference @{Id=$mockGalleryImageId;Lun=2};
42+
3943
Assert-AreEqual "UltraSSD_LRS" $diskconfig.Sku.Name;
4044
Assert-AreEqual 500 $diskconfig.DiskIOPSReadWrite;
4145
Assert-AreEqual 8 $diskconfig.DiskMBpsReadWrite;
4246
Assert-AreEqual $encSetId $diskconfig.Encryption.DiskEncryptionSetId;
4347
Assert-AreEqual "EncryptionAtRestWithCustomerKey" $diskconfig.Encryption.Type;
48+
Assert-AreEqual 1000 $diskconfig.DiskIOPSReadOnly;
49+
Assert-AreEqual 10 $diskconfig.DiskMBpsReadOnly;
50+
Assert-AreEqual 5 $diskconfig.MaxShares;
51+
Assert-AreEqual $mockGalleryImageId $diskconfig.CreationData.GalleryImageReference.Id;
52+
Assert-AreEqual 2 $diskconfig.CreationData.GalleryImageReference.Lun;
4453

4554
$diskconfig = New-AzDiskConfig -Location $loc -Zone "1" -DiskSizeGB 5 -AccountType Standard_LRS -OsType Windows -CreateOption Empty `
4655
-EncryptionSettingsEnabled $true -HyperVGeneration "V1";

src/Compute/Compute.Test/ScenarioTests/GalleryTests.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ function Test-Gallery
325325
Assert-AreEqual 2 $imageConfig.StorageProfile.DataDisks.Count;
326326

327327
$image = New-AzImage -Image $imageConfig -ImageName $imageName -ResourceGroupName $rgname
328-
$targetRegions = @(@{Name='South Central US';ReplicaCount=1},@{Name='East US';ReplicaCount=2},@{Name='Central US'});
328+
$targetRegions = @(@{Name='South Central US';ReplicaCount=1},@{Name='East US';ReplicaCount=2});
329329
$tag = @{test1 = "testval1"; test2 = "testval2" };
330330

331331
New-AzGalleryImageVersion -ResourceGroupName $rgname -GalleryName $galleryName `
@@ -347,9 +347,11 @@ function Test-Gallery
347347
Verify-GalleryImageVersion $version $rgname $galleryImageVersionName $loc `
348348
$image.Id 1 $endOfLifeDate $targetRegions;
349349

350+
$targetRegions = @(@{Name='South Central US';ReplicaCount=1},@{Name='East US';ReplicaCount=2},@{Name='Central US';StorageAccountType="Standard_ZRS"});
351+
350352
Update-AzGalleryImageVersion -ResourceGroupName $rgname -GalleryName $galleryName `
351353
-GalleryImageDefinitionName $galleryImageName -Name $galleryImageVersionName `
352-
-Tag $tag;
354+
-TargetRegion $targetRegions -Tag $tag;
353355

354356
$version = Get-AzGalleryImageVersion -ResourceGroupName $rgname -GalleryName $galleryName `
355357
-GalleryImageDefinitionName $galleryImageName -Name $galleryImageVersionName;

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.GalleryTests/TestGallery.json

Lines changed: 10738 additions & 2127 deletions
Large diffs are not rendered by default.

src/Compute/Compute/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
- Additional information about change #1
2020
-->
2121
## Upcoming Release
22+
* Add the following parameters to New-AzDiskConfig cmdlet:
23+
- DiskIOPSReadOnly, DiskMBpsReadOnly, MaxSharesCount, GalleryImageReference
24+
* Allow Encryption property to Target parameter of New-AzGalleryImageVersion cmdlet.
25+
* Fix tempDisk issue for Set-AzVmss -Reimage and Invoke-AzVMReimage cmdlets.
2226
* Set-AzVMAEMExtension, Get-AzVMAEMExtension, Remove-AzVMAEMExtension, Update-AzVMAEMExtension: Add support for new SAP Extension
2327
* Fix errors in examples of help document
2428
* Show the exact string value for VM PowerState in the table format.

src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,27 @@ public partial class NewAzureRmDiskConfigCommand : Microsoft.Azure.Commands.Reso
7777
[Parameter(
7878
Mandatory = false,
7979
ValueFromPipelineByPropertyName = true)]
80-
public int DiskIOPSReadWrite { get; set; }
80+
public long DiskIOPSReadWrite { get; set; }
8181

8282
[Parameter(
8383
Mandatory = false,
8484
ValueFromPipelineByPropertyName = true)]
85-
public int DiskMBpsReadWrite { get; set; }
85+
public long DiskMBpsReadWrite { get; set; }
86+
87+
[Parameter(
88+
Mandatory = false,
89+
ValueFromPipelineByPropertyName = true)]
90+
public long DiskIOPSReadOnly { get; set; }
91+
92+
[Parameter(
93+
Mandatory = false,
94+
ValueFromPipelineByPropertyName = true)]
95+
public long DiskMBpsReadOnly { get; set; }
96+
97+
[Parameter(
98+
Mandatory = false,
99+
ValueFromPipelineByPropertyName = true)]
100+
public int MaxSharesCount { get; set; }
86101

87102
[Parameter(
88103
Mandatory = false,
@@ -104,6 +119,11 @@ public partial class NewAzureRmDiskConfigCommand : Microsoft.Azure.Commands.Reso
104119
ValueFromPipelineByPropertyName = true)]
105120
public ImageDiskReference ImageReference { get; set; }
106121

122+
[Parameter(
123+
Mandatory = false,
124+
ValueFromPipelineByPropertyName = true)]
125+
public ImageDiskReference GalleryImageReference { get; set; }
126+
107127
[Parameter(
108128
Mandatory = false,
109129
ValueFromPipelineByPropertyName = true)]
@@ -203,6 +223,15 @@ private void Run()
203223
vCreationData.ImageReference = this.ImageReference;
204224
}
205225

226+
if (this.IsParameterBound(c => c.GalleryImageReference))
227+
{
228+
if (vCreationData == null)
229+
{
230+
vCreationData = new CreationData();
231+
}
232+
vCreationData.GalleryImageReference = this.GalleryImageReference;
233+
}
234+
206235
if (this.IsParameterBound(c => c.SourceUri))
207236
{
208237
if (vCreationData == null)
@@ -303,8 +332,11 @@ private void Run()
303332
OsType = this.IsParameterBound(c => c.OsType) ? this.OsType : (OperatingSystemTypes?)null,
304333
HyperVGeneration = this.IsParameterBound(c => c.HyperVGeneration) ? this.HyperVGeneration : null,
305334
DiskSizeGB = this.IsParameterBound(c => c.DiskSizeGB) ? this.DiskSizeGB : (int?)null,
306-
DiskIOPSReadWrite = this.IsParameterBound(c => c.DiskIOPSReadWrite) ? this.DiskIOPSReadWrite : (int?)null,
307-
DiskMBpsReadWrite = this.IsParameterBound(c => c.DiskMBpsReadWrite) ? this.DiskMBpsReadWrite : (int?)null,
335+
DiskIOPSReadWrite = this.IsParameterBound(c => c.DiskIOPSReadWrite) ? this.DiskIOPSReadWrite : (long?)null,
336+
DiskMBpsReadWrite = this.IsParameterBound(c => c.DiskMBpsReadWrite) ? this.DiskMBpsReadWrite : (long?)null,
337+
DiskIOPSReadOnly = this.IsParameterBound(c => c.DiskIOPSReadOnly) ? this.DiskIOPSReadOnly : (long?)null,
338+
DiskMBpsReadOnly = this.IsParameterBound(c => c.DiskMBpsReadOnly) ? this.DiskMBpsReadOnly : (long?)null,
339+
MaxShares = this.IsParameterBound(c => c.MaxSharesCount) ? this.MaxSharesCount : (int?)null,
308340
Location = this.IsParameterBound(c => c.Location) ? this.Location : null,
309341
Tags = this.IsParameterBound(c => c.Tag) ? this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value) : null,
310342
Sku = vSku,

src/Compute/Compute/Generated/Gallery/GalleryDeleteMethod.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public override void ExecuteCmdlet()
9595
Position = 1,
9696
Mandatory = true,
9797
ValueFromPipelineByPropertyName = true)]
98+
[ResourceNameCompleter("Microsoft.Compute/galleries", "ResourceGroupName")]
9899
public string Name { get; set; }
99100

100101
[Parameter(

src/Compute/Compute/Generated/GalleryImage/GalleryImageDeleteMethod.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,27 @@ public override void ExecuteCmdlet()
4848
{
4949
string resourceGroupName;
5050
string galleryName;
51-
string galleryImageName;
51+
string galleryImageDefinitionName;
5252
switch (this.ParameterSetName)
5353
{
5454
case "ResourceIdParameter":
5555
resourceGroupName = GetResourceGroupName(this.ResourceId);
56-
galleryName = GetResourceName(this.ResourceId, "Microsoft.Compute/Galleries", "Images");
57-
galleryImageName = GetInstanceId(this.ResourceId, "Microsoft.Compute/Galleries", "Images");
56+
galleryName = GetResourceName(this.ResourceId, "Microsoft.Compute/galleries", "images");
57+
galleryImageDefinitionName = GetInstanceId(this.ResourceId, "Microsoft.Compute/galleries", "images");
5858
break;
5959
case "ObjectParameter":
6060
resourceGroupName = GetResourceGroupName(this.InputObject.Id);
61-
galleryName = GetResourceName(this.InputObject.Id, "Microsoft.Compute/Galleries", "Images");
62-
galleryImageName = GetInstanceId(this.InputObject.Id, "Microsoft.Compute/Galleries", "Images");
61+
galleryName = GetResourceName(this.InputObject.Id, "Microsoft.Compute/galleries", "images");
62+
galleryImageDefinitionName = GetInstanceId(this.InputObject.Id, "Microsoft.Compute/galleries", "images");
6363
break;
6464
default:
6565
resourceGroupName = this.ResourceGroupName;
6666
galleryName = this.GalleryName;
67-
galleryImageName = this.Name;
67+
galleryImageDefinitionName = this.Name;
6868
break;
6969
}
7070

71-
var result = GalleryImagesClient.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName).GetAwaiter().GetResult();
71+
var result = GalleryImagesClient.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageDefinitionName).GetAwaiter().GetResult();
7272
PSOperationStatusResponse output = new PSOperationStatusResponse
7373
{
7474
StartTime = this.StartTime,

src/Compute/Compute/Generated/GalleryImageVersion/GalleryImageVersionCreateOrUpdateMethod.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,15 @@ public override void ExecuteCmdlet()
132132
galleryImageVersion.PublishingProfile.TargetRegions = new List<TargetRegion>();
133133
foreach (var t in this.TargetRegion)
134134
{
135-
galleryImageVersion.PublishingProfile.TargetRegions.Add(new TargetRegion((string)t["Name"], (int?)t["ReplicaCount"], (string)t["StorageAccountType"]));
135+
var target = new TargetRegion()
136+
{
137+
Name = (string)t["Name"],
138+
RegionalReplicaCount = (int?)t["ReplicaCount"],
139+
StorageAccountType = (string)t["StorageAccountType"],
140+
Encryption = (t["Encryption"] == null) ? (EncryptionImages)t["Encryption"] : null
141+
};
142+
143+
galleryImageVersion.PublishingProfile.TargetRegions.Add(target);
136144
}
137145
}
138146

@@ -319,7 +327,15 @@ public override void ExecuteCmdlet()
319327
galleryImageVersion.PublishingProfile.TargetRegions = new List<TargetRegion>();
320328
foreach (var t in this.TargetRegion)
321329
{
322-
galleryImageVersion.PublishingProfile.TargetRegions.Add(new TargetRegion((string)t["Name"], (int?)t["ReplicaCount"]));
330+
var target = new TargetRegion()
331+
{
332+
Name = (string)t["Name"],
333+
RegionalReplicaCount = (int?)t["ReplicaCount"],
334+
StorageAccountType = (string)t["StorageAccountType"],
335+
Encryption = (t["Encryption"] == null) ? (EncryptionImages)t["Encryption"] : null
336+
};
337+
338+
galleryImageVersion.PublishingProfile.TargetRegions.Add(target);
323339
}
324340
}
325341

src/Compute/Compute/Generated/GalleryImageVersion/GalleryImageVersionDeleteMethod.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,31 @@ public override void ExecuteCmdlet()
4848
{
4949
string resourceGroupName;
5050
string galleryName;
51-
string galleryImageName;
51+
string galleryImageDefinitionName;
5252
string galleryImageVersionName;
5353
switch (this.ParameterSetName)
5454
{
5555
case "ResourceIdParameter":
5656
resourceGroupName = GetResourceGroupName(this.ResourceId);
57-
galleryName = GetResourceName(this.ResourceId, "Microsoft.Compute/Galleries", "Images", "Versions");
58-
galleryImageName = GetInstanceId(this.ResourceId, "Microsoft.Compute/Galleries", "Images", "Versions");
59-
galleryImageVersionName = GetVersion(this.ResourceId, "Microsoft.Compute/Galleries", "Images", "Versions");
57+
galleryName = GetResourceName(this.ResourceId, "Microsoft.Compute/galleries", "images", "versions");
58+
galleryImageDefinitionName = GetInstanceId(this.ResourceId, "Microsoft.Compute/galleries", "images", "versions");
59+
galleryImageVersionName = GetVersion(this.ResourceId, "Microsoft.Compute/galleries", "images", "versions");
6060
break;
6161
case "ObjectParameter":
6262
resourceGroupName = GetResourceGroupName(this.InputObject.Id);
63-
galleryName = GetResourceName(this.InputObject.Id, "Microsoft.Compute/Galleries", "Images", "Versions");
64-
galleryImageName = GetInstanceId(this.InputObject.Id, "Microsoft.Compute/Galleries", "Images", "Versions");
65-
galleryImageVersionName = GetVersion(this.InputObject.Id, "Microsoft.Compute/Galleries", "Images", "Versions");
63+
galleryName = GetResourceName(this.InputObject.Id, "Microsoft.Compute/galleries", "images", "versions");
64+
galleryImageDefinitionName = GetInstanceId(this.InputObject.Id, "Microsoft.Compute/galleries", "images", "versions");
65+
galleryImageVersionName = GetVersion(this.InputObject.Id, "Microsoft.Compute/galleries", "images", "versions");
6666
break;
6767
default:
6868
resourceGroupName = this.ResourceGroupName;
6969
galleryName = this.GalleryName;
70-
galleryImageName = this.GalleryImageDefinitionName;
70+
galleryImageDefinitionName = this.GalleryImageDefinitionName;
7171
galleryImageVersionName = this.Name;
7272
break;
7373
}
7474

75-
var result = GalleryImageVersionsClient.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).GetAwaiter().GetResult();
75+
var result = GalleryImageVersionsClient.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageDefinitionName, galleryImageVersionName).GetAwaiter().GetResult();
7676
PSOperationStatusResponse output = new PSOperationStatusResponse
7777
{
7878
StartTime = this.StartTime,

src/Compute/Compute/Generated/Models/ComputeAutoMapperProfile.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,6 @@ private static void Initialize()
9292
cfg.CreateMap<FROM.Snapshot, TO.PSSnapshotList>();
9393
cfg.CreateMap<TO.PSSnapshotList, TO.PSSnapshot>();
9494
cfg.CreateMap<TO.PSSnapshot, TO.PSSnapshotList>();
95-
cfg.CreateMap<FROM.VirtualMachineScaleSet, TO.PSVirtualMachineScaleSetList>()
96-
.ForMember(c => c.Zones, o => o.Condition(r => (r.Zones != null)));
97-
cfg.CreateMap<TO.PSVirtualMachineScaleSetList, TO.PSVirtualMachineScaleSet>()
98-
.ForMember(c => c.Zones, o => o.Condition(r => (r.Zones != null)));
99-
cfg.CreateMap<TO.PSVirtualMachineScaleSet, TO.PSVirtualMachineScaleSetList>()
100-
.ForMember(c => c.Zones, o => o.Condition(r => (r.Zones != null)));
10195
cfg.CreateMap<FROM.VirtualMachineScaleSet, TO.PSVirtualMachineScaleSetList>()
10296
.ForMember(c => c.Zones, o => o.Condition(r => (r.Zones != null)));
10397
cfg.CreateMap<TO.PSVirtualMachineScaleSetList, TO.PSVirtualMachineScaleSet>()
@@ -194,7 +188,6 @@ private static void Initialize()
194188
.ForMember(c => c.Type, o => o.MapFrom(r => r.Type1));
195189
cfg.CreateMap<TO.PSVirtualMachineScaleSetExtension, FROM.VirtualMachineScaleSetExtension>()
196190
.ForMember(c => c.Type1, o => o.MapFrom(r => r.Type));
197-
198191
});
199192
_mapper = config.CreateMapper();
200193
}

src/Compute/Compute/Generated/Models/PSDisk.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ public string ResourceGroupName
4141
}
4242

4343
public string ManagedBy { get; set; }
44+
public IList<string> ManagedByExtended { get; set; }
4445
public DiskSku Sku { get; set; }
45-
public System.Collections.Generic.IList<string> Zones { get; set; }
46+
public IList<string> Zones { get; set; }
4647
public DateTime? TimeCreated { get; set; }
4748
public OperatingSystemTypes? OsType { get; set; }
4849
public string HyperVGeneration { get; set; }
@@ -53,9 +54,13 @@ public string ResourceGroupName
5354
public EncryptionSettingsCollection EncryptionSettingsCollection { get; set; }
5455
public string ProvisioningState { get; set; }
5556
public long? DiskIOPSReadWrite { get; set; }
56-
public int? DiskMBpsReadWrite { get; set; }
57+
public long? DiskMBpsReadWrite { get; set; }
58+
public long? DiskIOPSReadOnly { get; set; }
59+
public long? DiskMBpsReadOnly { get; set; }
5760
public string DiskState { get; set; }
5861
public Encryption Encryption { get; set; }
62+
public int? MaxShares { get; set; }
63+
public IList<ShareInfoElement> ShareInfo { get; set; }
5964
public string Id { get; set; }
6065
public string Name { get; set; }
6166
public string Type { get; set; }

src/Compute/Compute/Generated/Models/PSDiskUpdate.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ public partial class PSDiskUpdate
3131
public int? DiskSizeGB { get; set; }
3232
public EncryptionSettingsCollection EncryptionSettingsCollection { get; set; }
3333
public long? DiskIOPSReadWrite { get; set; }
34-
public int? DiskMBpsReadWrite { get; set; }
34+
public long? DiskMBpsReadWrite { get; set; }
35+
public long? DiskIOPSReadOnly { get; set; }
36+
public long? DiskMBpsReadOnly { get; set; }
37+
public int? MaxShares { get; set; }
3538
public Encryption Encryption { get; set; }
3639
public IDictionary<string, string> Tags { get; set; }
3740
public DiskSku Sku { get; set; }

src/Compute/Compute/Generated/Models/PSHostGroup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public string ResourceGroupName
4242

4343
public int PlatformFaultDomainCount { get; set; }
4444
public IList<SubResourceReadOnly> Hosts { get; set; }
45-
public System.Collections.Generic.IList<string> Zones { get; set; }
45+
public IList<string> Zones { get; set; }
4646
public string Id { get; set; }
4747
public string Name { get; set; }
4848
public string Type { get; set; }

0 commit comments

Comments
 (0)