Skip to content

Commit

Permalink
Migrate ElasticSan from generation to main (#26130)
Browse files Browse the repository at this point in the history
* Move ElasticSan to main

* Add change log

---------

Co-authored-by: azure-powershell-bot <[email protected]>
Co-authored-by: Lei jin <[email protected]>
  • Loading branch information
3 people committed Sep 19, 2024
1 parent 789536d commit 1552e99
Show file tree
Hide file tree
Showing 127 changed files with 3,203 additions and 1,626 deletions.
6 changes: 3 additions & 3 deletions src/ElasticSan/ElasticSan.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ For information on how to develop for `Az.ElasticSan`, see [how-to.md](how-to.md
``` yaml
# Please specify the commit id that includes your features to make sure generated codes stable.
commit: 9770615578c920dad8cb6fce33d79c7e112824c0
commit: 72c69a0cf561d41ae99fe6810c426a874d3a8372
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/elasticsan.json
- $(repo)/specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2024-05-01/elasticsan.json

# Normally, title is the service name
title: ElasticSan
Expand Down Expand Up @@ -143,7 +143,7 @@ directive:
subject: ^VolumeGroup$
hide: true
- where:
verb: New
verb: ^New$|^Update$
subject: Volume
parameter-name: ManagedByResourceId
hide: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "elasticSans/volumegroups/snapshots",
"apiVersion": "2023-01-01",
"apiVersion": "2024-05-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "elasticSans/volumegroups/volumes",
"apiVersion": "2023-01-01",
"apiVersion": "2024-05-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "elasticSans/volumegroups",
"apiVersion": "2023-01-01",
"apiVersion": "2024-05-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "elasticSans",
"apiVersion": "2023-01-01",
"apiVersion": "2024-05-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ function New-AzElasticSanVolumeGroup {
[System.String]
# Type of encryption
${Encryption},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
[System.Boolean]
# A boolean indicating whether or not Data Integrity Check is enabled
${EnforceDataIntegrityCheckForIscsi},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
Expand Down Expand Up @@ -234,6 +240,10 @@ function New-AzElasticSanVolumeGroup {
$null = $PSBoundParameters.Remove('IdentityUserAssignedIdentityId')
}

if (($PSBoundParameters.ContainsKey("EnforceDataIntegrityCheckForIscsi") -eq $false) -or ($PSBoundParameters.EnforceDataIntegrityCheckForIscsi -eq $true)) {
Write-Warning "This needs CRC32C to be set on header and data digests on the client for all the connections from the client to the volumes in this volume group. You can do this by connecting to the volumes from the client using multi-session scripts generated in portal connect flow or from documentation, which contain steps to set CRC32C on header and data digests. Do not enable CRC protection on the volume group if you are using Fedora or its downstream Linux distributions such as RHEL, CentOS etc. as data digests are not supported on them. If you enable this flag for those distributions, connectivity to the volumes will fail. Refer to https://learn.microsoft.com/en-us/azure/storage/elastic-san/elastic-san-create?tabs=azure-portal for more information."
}

Az.ElasticSan.internal\New-AzElasticSanVolumeGroup @PSBoundParameters
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ function Update-AzElasticSanVolumeGroup {
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
[System.Boolean]
# A boolean indicating whether or not Data Integrity Check is enabled
${EnforceDataIntegrityCheckForIscsi},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerManagedKey")]
Expand Down Expand Up @@ -246,7 +252,7 @@ function Update-AzElasticSanVolumeGroup {
break
}
Default {
$volumeGroupProperties = AZ.ElasticSan\Get-AzElasticSanVolumeGroup -Nam $Name -ResourceGroupName $ResourceGroupName -ElasticSanName $ElasticSanName
$volumeGroupProperties = AZ.ElasticSan\Get-AzElasticSanVolumeGroup -Name $Name -ResourceGroupName $ResourceGroupName -ElasticSanName $ElasticSanName
break
}
}
Expand All @@ -261,6 +267,10 @@ function Update-AzElasticSanVolumeGroup {
}
$null = $PSBoundParameters.Remove('IdentityUserAssignedIdentityId')
}

if ($PSBoundParameters.ContainsKey("EnforceDataIntegrityCheckForIscsi") -and ($PSBoundParameters.EnforceDataIntegrityCheckForIscsi -eq $true)) {
Write-Warning "This needs CRC32C to be set on header and data digests on the client for all the connections from the client to the volumes in this volume group. You can do this by disconnecting the volumes from the client and reconnecting using multi-session scripts generated in portal connect flow or from documentation, which contain steps to set CRC32C on header and data digests. Do not enable CRC protection on the volume group if you are using Fedora or its downstream Linux distributions such as RHEL, CentOS etc. as data digests are not supported on them. If you enable this flag for those distributions, connectivity to the volumes will fail. Refer to https://learn.microsoft.com/en-us/azure/storage/elastic-san/elastic-san-create?tabs=azure-portal for more information."
}
Az.ElasticSan.internal\Update-AzElasticSanVolumeGroup @PSBoundParameters
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ New-AzElasticSanVolumeGroup -ResourceGroupName myresourcegroup -ElasticSanName m
```

```output
Encryption : EncryptionAtRestWithPlatformKey
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan/volumegroups/myvolumegroup
Name : myvolumegroup
NetworkAclsVirtualNetworkRule : {/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/subnet1, /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/subnet2}
ProtocolType : iSCSI
ProvisioningState : Succeeded
SystemDataCreatedAt : 9/19/2022 7:05:47 AM
SystemDataCreatedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
SystemDataCreatedByType : Application
SystemDataLastModifiedAt : 9/19/2022 7:05:47 AM
SystemDataLastModifiedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
SystemDataLastModifiedByType : Application
Type : Microsoft.ElasticSan/ElasticSans
Encryption : EncryptionAtRestWithPlatformKey
EnforceDataIntegrityCheckForIscsi : True
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan/volumegroups/myvolumegroup
Name : myvolumegroup
NetworkAclsVirtualNetworkRule : {/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/subnet1, /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/subnet2}
ProtocolType : iSCSI
ProvisioningState : Succeeded
SystemDataCreatedAt : 9/19/2022 7:05:47 AM
SystemDataCreatedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
SystemDataCreatedByType : Application
SystemDataLastModifiedAt : 9/19/2022 7:05:47 AM
SystemDataLastModifiedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
SystemDataLastModifiedByType : Application
Type : Microsoft.ElasticSan/ElasticSans
```

This example creates two VirtualNetworkRule objects and then input the objects and other variables to create a volume group.
Expand All @@ -35,19 +36,20 @@ New-AzElasticSanVolumeGroup -ResourceGroupName myresourcegroup -ElasticSanName m
```

```output
Encryption : EncryptionAtRestWithPlatformKey
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan/volumegroups/myvolumegroup
Name : myvolumegroup
Encryption : EncryptionAtRestWithPlatformKey
EnforceDataIntegrityCheckForIscsi : True
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan/volumegroups/myvolumegroup
Name : myvolumegroup
NetworkAclsVirtualNetworkRule : {/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/subnet1, /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/subnet2}
ProtocolType : iSCSI
ProvisioningState : Succeeded
SystemDataCreatedAt : 9/19/2022 7:05:47 AM
SystemDataCreatedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
SystemDataCreatedByType : Application
SystemDataLastModifiedAt : 9/19/2022 7:05:47 AM
SystemDataLastModifiedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
SystemDataLastModifiedByType : Application
Type : Microsoft.ElasticSan/ElasticSans
ProtocolType : iSCSI
ProvisioningState : Succeeded
SystemDataCreatedAt : 9/19/2022 7:05:47 AM
SystemDataCreatedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
SystemDataCreatedByType : Application
SystemDataLastModifiedAt : 9/19/2022 7:05:47 AM
SystemDataLastModifiedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
SystemDataLastModifiedByType : Application
Type : Microsoft.ElasticSan/ElasticSans
```

This command creates a volume group with the NetworkAclsVirtualNetworkRule input in json format.
Expand All @@ -60,6 +62,7 @@ New-AzElasticSanVolumeGroup -ResourceGroupName myresourcegroup -ElasticSanName m
```output
Encryption : EncryptionAtRestWithPlatformKey
EncryptionIdentityEncryptionUserAssignedIdentity :
EnforceDataIntegrityCheckForIscsi : True
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan/volumeGroups/myvolumegroup
IdentityPrincipalId : 00000000-0000-0000-0000-000000000000
IdentityTenantId : 00000000-0000-0000-0000-000000000000
Expand Down Expand Up @@ -99,6 +102,7 @@ New-AzElasticSanVolumeGroup -ResourceGroupName myresoucegroup -ElasticSanName my
```output
Encryption : EncryptionAtRestWithCustomerManagedKey
EncryptionIdentityEncryptionUserAssignedIdentity : /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myuai
EnforceDataIntegrityCheckForIscsi : True
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan/volumeGroups/myvolumegroup
IdentityPrincipalId :
IdentityTenantId :
Expand All @@ -120,12 +124,50 @@ ProtocolType : iSCSI
ProvisioningState : Succeeded
ResourceGroupName : myresourcegroup
SystemDataCreatedAt : 10/7/2023 6:32:27 AM
SystemDataCreatedBy : a000255f-5f09-45e0-a970-9d9ed9cc6453
SystemDataCreatedBy : 00000000-0000-0000-0000-000000000000
SystemDataCreatedByType : Application
SystemDataLastModifiedAt : 10/7/2023 6:32:27 AM
SystemDataLastModifiedBy : a000255f-5f09-45e0-a970-9d9ed9cc6453
SystemDataLastModifiedBy : 00000000-0000-0000-0000-000000000000
SystemDataLastModifiedByType : Application
Type : Microsoft.ElasticSan/elasticSans/volumeGroups
```

This command creates a volume group with identity type "SystemAssigned" and encryption type "platform-managed key".
This command creates a volume group with identity type "SystemAssigned" and encryption type "platform-managed key".

### Example 5: Create a volume group with EnforceDataIntegrityCheckForIscsi disabled
```powershell
New-AzElasticSanVolumeGroup -ResourceGroupName myresoucegroup -ElasticSanName myelasticsan -Name myvolumegroup -EnforceDataIntegrityCheckForIscsi $false
```

```output
Encryption : EncryptionAtRestWithPlatformKey
EncryptionIdentityEncryptionUserAssignedIdentity :
EnforceDataIntegrityCheckForIscsi : False
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan/volumeGroups/myvolumegroup
IdentityPrincipalId :
IdentityTenantId :
IdentityType :
IdentityUserAssignedIdentity : {
}
KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp :
KeyVaultPropertyCurrentVersionedKeyIdentifier :
KeyVaultPropertyKeyName :
KeyVaultPropertyKeyVaultUri :
KeyVaultPropertyKeyVersion :
KeyVaultPropertyLastKeyRotationTimestamp :
Name : myvolumegroup
NetworkAclsVirtualNetworkRule :
PrivateEndpointConnection :
ProtocolType : iSCSI
ProvisioningState : Succeeded
ResourceGroupName : myresourcegroup
SystemDataCreatedAt : 9/18/2024 3:45:01 AM
SystemDataCreatedBy : 00000000-0000-0000-0000-000000000000
SystemDataCreatedByType : User
SystemDataLastModifiedAt : 9/18/2024 4:58:14 AM
SystemDataLastModifiedBy : 00000000-0000-0000-0000-000000000000
SystemDataLastModifiedByType : User
Type : Microsoft.ElasticSan/elasticSans/volumeGroups
```

This command creates a volume group with EnforceDataIntegrityCheckForIscsi disabled.
Loading

0 comments on commit 1552e99

Please sign in to comment.