安裝最新版本之後,請執行 az extension add -n elastic-san 以安裝彈性 SAN 的延伸模組。
不需要額外的註冊步驟。
限制
下列清單包含目前提供彈性 SAN 的區域及哪些區域同時支援區域備援儲存體 (ZRS) 和本地備援儲存體 (LRS) 或僅支援 LRS:
南非北部 - LRS
東亞 - LRS
東南亞 - LRS
巴西南部 - LRS
加拿大中部 - LRS
法國中部 - LRS 和 ZRS
德國中西部 - LRS
澳大利亞東部 - LRS
北歐 - LRS 和 ZRS
西歐 - LRS 和 ZRS
英國南部 - LRS
日本東部 - LRS
南韓中部 - LRS
美國中部
美國東部 - LRS
美國中南部 - LRS
美國東部 2 - LRS
美國西部 2 - LRS 和 ZRS
美國西部 3 - LRS
瑞典中部 - LRS
瑞士北部 - LRS
設定公用網路存取
您可以在 SAN 等級啟用對彈性 SAN 端點的公共網際網路存取。 啟用彈性 SAN 的公用網路存取可讓您透過儲存體服務端點設定個別磁碟區群組的公用存取。 依據預設,即使您允許在 SAN 等級存取個別磁碟區群組,還是會拒絕公用存取。 您必須明確設定磁碟區群組,以允許從特定 IP 位址範圍和虛擬網路子網路存取。
您可以在建立彈性 SAN 時啟用公用網路存取,或使用 Azure PowerShell 模組或 Azure CLI 為現有的 SAN 啟用它。
# Set the variable values.
# The name of the resource group where the Elastic San is deployed.
$RgName = "<ResourceGroupName>"
# The name of the Elastic SAN.
$EsanName = "<ElasticSanName>"
# The region where the new Elastic San will be created.
$Location = "<Location>"
# The SKU of the new Elastic SAN - `Premium_LRS` or `Premium_ZRS`.
$SkuName = "<SkuName>"
# The base size of the new Elastic SAN.
$BaseSize = "<BaseSize>"
# The extended size of the new Elastic SAN.
$ExtendedSize = "<ExtendedSize>"
# Setup the parameters to create an Elastic San with public network access enabled.
$NewEsanArguments = @{
Name = $EsanName
ResourceGroupName = $RgName
BaseSizeTiB = $BaseSize
ExtendedCapacitySizeTiB = $ExtendedSize
Location = $Location
SkuName = $SkuName
PublicNetworkAccess = "Enabled"
}
# Create the Elastic San.
New-AzElasticSan @NewEsanArguments
# Set the variable values.
# The name of the resource group where the Elastic San is deployed.
$RgName="<ResourceGroupName>"
# The name of the Elastic SAN.
$EsanName="<ElasticSanName>"
# The region where the new Elastic San will be created.
$Location="<Location>"
# The SKU of the new Elastic SAN - `Premium_LRS` or `Premium_ZRS`.
$SkuName="<SkuName>"
# The base size of the new Elastic SAN.
$BaseSize="<BaseSize>"
# The extended size of the new Elastic SAN.
$ExtendedSize="<ExtendedSize>"
# Create the Elastic San.
az elastic-san create \
--elastic-san-name $EsanName \
--resource-group $RgName \
--location $Location \
--base-size-tib $BaseSize \
--extended-capacity-size-tib $ExtendedSize \
--sku $SkuName \
--public-network-access enabled
若要為彈性 SAN 磁碟區群組建立私人端點,您必須具有彈性 SAN 磁碟區群組擁有者角色。 若要核准新的私人端點連線,您必須擁有 Azure 資源提供者作業Microsoft.ElasticSan/elasticSans/PrivateEndpointConnectionsApproval/action的權限。 這項作業的權限包含在彈性 SAN 網路管理員角色中,但也可以透過自訂 Azure 角色授與。
使用此程式碼範例,透過 PowerShell 為您的彈性 SAN 磁碟區群組建立私人端點。 以您自己的值取代 RgName、VnetName、SubnetName、EsanName、EsanVgName、PLSvcConnectionName、EndpointName 及 Location 的值:
# Set the resource group name.
$RgName = "<ResourceGroupName>"
# Set the virtual network and subnet, which is used when creating the private endpoint.
$VnetName = "<VnetName>"
$SubnetName = "<SubnetName>"
$Vnet = Get-AzVirtualNetwork -Name $VnetName -ResourceGroupName $RgName
$Subnet = $Vnet | Select -ExpandProperty subnets | Where-Object {$_.Name -eq $SubnetName}
# Set the Elastic SAN, which is used when creating the private endpoint service connection.
$EsanName = "<ElasticSanName>"
$EsanVgName = "<ElasticSanVolumeGroupName>"
$Esan = Get-AzElasticSan -Name $EsanName -ResourceGroupName $RgName
# Create the private link service connection, which is input to creating the private endpoint.
$PLSvcConnectionName = "<PrivateLinkSvcConnectionName>"
$EsanPlSvcConn = New-AzPrivateLinkServiceConnection -Name $PLSvcConnectionName -PrivateLinkServiceId $Esan.Id -GroupId $EsanVgName
# Create the private endpoint.
$EndpointName = '<PrivateEndpointName>'
$Location = '<Location>'
$PeArguments = @{
Name = $EndpointName
ResourceGroupName = $RgName
Location = $Location
Subnet = $Subnet
PrivateLinkServiceConnection = $EsanPlSvcConn
}
New-AzPrivateEndpoint @PeArguments # -ByManualRequest # (Uncomment the `-ByManualRequest` parameter if you are using the two-step process).
如果您使用雙步驟流程,請使用此程式碼範例來核准私人連結服務連線。 使用先前程式碼範例中的相同變數:
# Get the private endpoint and associated connection.
$PrivateEndpoint = Get-AzPrivateEndpoint -Name $EndpointName -ResourceGroupName $RgName
$PeConnArguments = @{
ServiceName = $EsanName
ResourceGroupName = $RgName
PrivateLinkResourceType = "Microsoft.ElasticSan/elasticSans"
}
$EndpointConnection = Get-AzPrivateEndpointConnection @PeConnArguments |
Where-Object {($_.PrivateEndpoint.Id -eq $PrivateEndpoint.Id)}
# Approve the private link service connection.
$ApprovalDesc="<ApprovalDesc>"
Approve-AzPrivateEndpointConnection @PeConnArguments -Name $EndpointConnection.Name -Description $ApprovalDesc
# Get the private endpoint connection anew and verify the connection status.
$EndpointConnection = Get-AzPrivateEndpointConnection @PeConnArguments |
Where-Object {($_.PrivateEndpoint.Id -eq $PrivateEndpoint.Id)}
$EndpointConnection.PrivateLinkServiceConnectionState
使用 Azure CLI 為彈性 SAN 磁碟區群組部署私人端點牽涉到三個步驟:
取得彈性 SAN 的私人連線資源識別碼。
使用輸入建立私人端點:
私人連線資源識別碼
磁碟區群組名稱
資源群組名稱
子網路名稱
虛擬網路名稱
(選擇性如果您使用雙步驟流程 (建立,然後核准)):彈性 SAN 網路管理員核准連線。
使用此程式碼範例,透過 Azure CLI 為您的彈性 SAN 磁碟區群組建立私人端點。 如果您使用雙步驟流程,請取消註解 --manual-request 參數。 將所有範例變數值取代為您自己的值:
# Define some variables.
# The name of the resource group where the resources are deployed.
RgName="<ResourceGroupName>"
# The name of the subnet from which access to the volume group will be configured.
VnetName="<VnetName>"
# The name of the virtual network that includes the subnet.
SubnetName="<SubnetName>"
# The name of the Elastic SAN that the volume group belongs to.
EsanName="<ElasticSanName>"
# The name of the Elastic SAN Volume Group to which a connection is to be created.
EsanVgName="<ElasticSanVolumeGroupName>"
# The name of the new private endpoint
EndpointName="<PrivateEndpointName>"
# The name of the new private link service connection to the volume group.
PLSvcConnectionName="<PrivateLinkSvcConnectionName>"
# The region where the new private endpoint will be created.
Location="<Location>"
# The description provided for the approval of the private endpoint connection.
ApprovalDesc="<ApprovalDesc>"
# Get the id of the Elastic SAN.
id=$(az elastic-san show \
--elastic-san-name $EsanName \
--resource-group $RgName \
--query 'id' \
--output tsv)
# Create the private endpoint.
az network private-endpoint create \
--connection-name $PLSvcConnectionName \
--name $EndpointName \
--private-connection-resource-id $id \
--resource-group $RgName \
--vnet-name $VnetName \
--subnet $SubnetName \
--location $Location \
--group-id $EsanVgName # --manual-request
# Verify the status of the private endpoint connection.
PLConnectionName=$(az network private-endpoint-connection list \
--name $EsanName \
--resource-group $RgName \
--type Microsoft.ElasticSan/elasticSans \
--query "[?properties.groupIds[0]=='$EsanVgName'].name" -o tsv)
az network private-endpoint-connection show \
--resource-name $EsanName \
--resource-group $RgName \
--type Microsoft.ElasticSan/elasticSans \
--name $PLConnectionName
若要為屬於另一個 Microsoft Entra 租用戶之虛擬網路中的子網路新增網路規則,請使用完整的 VirtualNetworkResourceId 參數,格式為 "/subscriptions/subscription-ID/resourceGroups/resourceGroup-Name/providers/Microsoft.Network/virtualNetworks/vNet-name/subnets/subnet-name"。
移除虛擬網路規則。
## You can remove a virtual network rule by object, by resource ID, or by removing all the rules in a volume group
### remove by networkRule object
Remove-AzElasticSanVolumeGroupNetworkRule -ResourceGroupName myRGName -ElasticSanName mySANName -VolumeGroupName myVolGroupName -NetworkAclsVirtualNetworkRule $virtualNetworkRule1,$virtualNetworkRule2
### remove by networkRuleResourceId
Remove-AzElasticSanVolumeGroupNetworkRule -ResourceGroupName myRGName -ElasticSanName mySANName -VolumeGroupName myVolGroupName -NetworkAclsVirtualNetworkResourceId "myResourceID"
### Remove all network rules in a volume group by pipeline
((Get-AzElasticSanVolumeGroup -ResourceGroupName myRGName -ElasticSanName mySANName -VolumeGroupName myVolGroupName).NetworkAclsVirtualNetworkRule) | Remove-AzElasticSanVolumeGroupNetworkRule -ResourceGroupName myRGName -ElasticSanName mySANName -VolumeGroupName myVolGroupName
若要為屬於另一個 Microsoft Entra 租用戶之虛擬網路中的子網路新增規則,請使用完整的子網路識別碼,格式為 /subscriptions/\<subscription-ID\>/resourceGroups/\<resourceGroup-Name\>/providers/Microsoft.Network/virtualNetworks/\<vNet-name\>/subnets/\<subnet-name\>。
您可以使用 subscription 參數,為屬於另一個 Microsoft Entra 租用戶的虛擬網路擷取子網路識別碼。
# First, get the current length of the list of virtual networks. This is needed to ensure you append a new network instead of replacing existing ones.
virtualNetworkListLength = az elastic-san volume-group show -e $sanName -n $volumeGroupName -g $RgName --query 'length(networkAcls.virtualNetworkRules)'
az elastic-san volume-group update -e $sanName -g $RgName --name $volumeGroupName --network-acls virtual-network-rules[$virtualNetworkListLength] "{virtualNetworkRules:[{id:/subscriptions/subscriptionID/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/$VnetName/subnets/default, action:Allow}]}"