创建 Azure 文件共享Create an Azure file share

若要创建 Azure 文件共享,需要回答有关你将如何使用它的三个问题:To create an Azure file share, you need to answer three questions about how you will use it:

  • Azure 文件共享的性能要求是什么?What are the performance requirements for your Azure file share?
    Azure 文件存储提供在基于硬盘(基于 HDD)的硬件上托管的标准文件共享,以及在基于固态磁盘(基于 SSD)的硬件上托管的高级文件共享。Azure Files offers standard file shares, which are hosted on hard disk-based (HDD-based) hardware, and premium file shares, which are hosted on solid-state disk-based (SSD-based) hardware.

  • 需要哪种大小的文件共享?What size file share do you need?
    标准文件共享最多可以涵盖 100 TiB 的空间,但默认不会启用此功能;如果所需的文件共享大于 5 TiB,则需要为存储帐户启用大型文件共享功能。Standard file shares can span up to 100 TiB, however this feature is not enabled by default; if you need a file share that is larger than 5 TiB, you will need to enable the large file share feature for your storage account. 高级文件共享最多可扩展到 100 TiB 而无需任何特殊设置,但高级文件共享是经过预配的,而不像标准文件共享一样即付即用。Premium file shares can span up to 100 TiB without any special setting, however premium file shares are provisioned, rather than pay as you go like standard file shares. 这意味着,预配一个远超所需大小的文件共享会增加存储的总成本。This means that provisioning a file share much larger than what you need will increase the total cost of storage.

  • Azure 文件共享在冗余方面的要求是什么?What are your redundancy requirements for your Azure file share?
    标准文件共享提供本地冗余 (LRS) 或异地冗余 (GRS) 存储,但是,只有本地冗余文件共享才支持大型文件共享功能。Standard file shares offer locally-redundant (LRS), or geo-redundant (GRS) storage, however the large file share feature is only supported on locally redundant file shares. 高级文件共享不支持异地冗余。Premium file shares do not support geo-redundancy.

有关这三个选项的详细信息,请参阅规划 Azure 文件存储部署For more information on these three choices, see Planning for an Azure Files deployment.

先决条件Prerequisites

创建存储帐户Create a storage account

Azure 文件共享将部署到存储帐户。存储帐户是代表存储共享池的顶级对象。Azure file shares are deployed into storage accounts, which are top-level objects that represent a shared pool of storage. 此存储池可用于部署多个文件共享。This pool of storage can be used to deploy multiple file shares.

对于客户的不同存储方案,Azure 支持多种类型的存储帐户,但对于 Azure 文件存储,有两个主要类型的存储帐户。Azure supports multiple types of storage accounts for different storage scenarios customers may have, but there are two main types of storage accounts for Azure Files. 需要创建的存储帐户类型取决于你是要创建标准文件共享还是要创建高级文件共享:Which storage account type you need to create depends on whether you want to create a standard file share or a premium file share:

  • 常规用途版本 2 (GPv2) 存储帐户:使用 GPv2 存储帐户可以在标准的/基于硬盘(基于 HDD)的硬件上部署 Azure 文件共享。General purpose version 2 (GPv2) storage accounts: GPv2 storage accounts allow you to deploy Azure file shares on standard/hard disk-based (HDD-based) hardware. 除了存储 Azure 文件共享以外,GPv2 存储帐户还可以存储其他存储资源,例如 Blob 容器、队列或表。In addition to storing Azure file shares, GPv2 storage accounts can store other storage resources such as blob containers, queues, or tables.

  • FileStorage 存储帐户:使用 FileStorage 存储帐户可以在高级/基于固态磁盘(基于 SSD)的硬件上部署 Azure 文件共享。FileStorage storage accounts: FileStorage storage accounts allow you to deploy Azure file shares on premium/solid-state disk-based (SSD-based) hardware. FileStorage 帐户只能用于存储 Azure 文件共享;其他存储资源(Blob 容器、队列、表等)都不能部署在 FileStorage 帐户中。FileStorage accounts can only be used to store Azure file shares; no other storage resources (blob containers, queues, tables, etc.) can be deployed in a FileStorage account.

若要通过 Azure 门户创建存储帐户,请在仪表板中选择“+ 创建资源”。To create a storage account via the Azure portal, select + Create a resource from the dashboard. 在出现的 Azure 市场搜索窗口中搜索“存储帐户”,并选择生成的搜索结果。In the resulting Azure Marketplace search window, search for storage account and select the resulting search result. 此时会显示存储帐户的概述页;选择“创建”继续执行存储帐户创建向导中的步骤。This will lead to an overview page for storage accounts; select Create to proceed with the storage account creation wizard.

浏览器中存储帐户快速创建选项的屏幕截图

“基本信息”部分The Basics section

创建存储帐户所要完成的第一部分是标有“基本信息”的部分。The first section to complete to create a storage account is labeled Basics. 此部分包含创建存储帐户所需填写的所有字段。This contains all of the required fields to create a storage account. 若要创建 GPv2 存储帐户,请确保将“性能”单选按钮设置为“标准”,并在“帐户类型”下拉列表中选择“StorageV2 (常规用途 v2)”。To create a GPv2 storage account, ensure the Performance radio button is set to Standard and the Account kind drop-down list is selected to StorageV2 (general purpose v2).

一个屏幕截图,其中“性能”单选按钮已选择为“标准”,“帐户类型”已选择为“StorageV2”

若要创建 FileStorage 存储帐户,请确保将“性能”单选按钮设置为“高级”,并在“帐户类型”下拉列表中选择“FileStorage”。To create a FileStorage storage account, ensure the Performance radio button is set to Premium and the Account kind drop-down list is selected to FileStorage.

一个屏幕截图,其中“性能”单选按钮已选择为“高级”,“帐户类型”已选择为“FileStorage”

其他基本信息字段与存储帐户的选择无关:The other basics fields are independent from the choice of storage account:

  • 订阅:要部署到的存储帐户所在的订阅。Subscription: The subscription for the storage account to be deployed into.
  • 资源组:要部署到的存储帐户所在的资源组。Resource group: The resource group for the storage account to be deployed into. 可以创建新的资源组,也可以使用现有资源组。You may either create a new resource group or use an existing resource group. 资源组是对 Azure 资源进行分组的逻辑容器。A resource group is a logical container for grouping your Azure services. 在创建存储帐户时,可以选择创建新的资源组,也可以使用现有资源组。When you create a storage account, you have the option to either create a new resource group, or use an existing resource group.
  • 存储帐户名称:要创建的存储帐户资源的名称。Storage account name: The name of the storage account resource to be created. 此名称必须全局唯一,但可以是所需的任何名称。This name must be globally unique, but otherwise can any name you desire. 通过 SMB 装载 Azure 文件共享时,存储帐户名称将用作服务器名称。The storage account name will be used as the server name when you mount an Azure file share via SMB.
  • 位置:要部署到的存储帐户所在的区域。Location: The region for the storage account to be deployed into. 此区域可以是与资源组关联的区域,也可以是任何其他可用区域。This can be the region associated with the resource group, or any other available region.
  • 复制:尽管此字段的标签为“复制”,但它实际上指的是“冗余”;这是所需的冗余级别:本地冗余 (LRS) 和异地冗余 (GRS)。Replication: Although this is labeled replication, this field actually means redundancy; this is the desired redundancy level: locally redundancy (LRS), and geo-redundancy (GRS). 此下拉列表还包含读取访问权限异地冗余存储 (RA-GRS),它不适用于 Azure 文件共享;在选择这些选项的情况下在存储帐户中创建的任何文件共享实际上是异地冗余的。This drop-down list also contains read-access geo-redundancy (RA-GRS), which do not apply to Azure file shares; any file share created in a storage account with these selected will actually be either geo-redundant. 根据所在的区域或所选的存储帐户类型,可能不允许使用某些冗余选项。Depending on your region or selected storage account type, some redundancy options may not be allowed.
  • 访问层:此字段不适用于 Azure 文件存储,因此可以选中任一单选按钮。Access tier: This field does not apply to Azure Files, so you can choose either one of the radio buttons.

“网络”边栏选项卡The Networking blade

在“网络”部分可以配置网络选项。The networking section allows you to configure networking options. 创建存储帐户时,这些设置是可选的,以后可根据需要对其进行配置。These settings are optional for the creation of the storage account and can be configured later if desired. 有关这些选项的详细信息,请参阅 Azure 文件存储的网络注意事项For more information on these options, see Azure Files networking considerations.

“高级”边栏选项卡The Advanced blade

“高级”部分包含 Azure 文件共享的几项重要设置:The advanced section contains several important settings for Azure file shares:

  • 需要安全传输:此字段指示存储帐户是否需要对与存储帐户的通信进行传输中加密。Secure transfer required: This field indicates whether the storage account requires encryption in transit for communication to the storage account. 建议将此功能保持启用状态,但是,如果需要 SMB 2.1 支持,则必须禁用此功能。We recommend this is left enabled, however, if you require SMB 2.1 support, you must disable this. 如果禁用加密,我们建议将存储帐户访问约束到包含服务终结点的虚拟网络。We recommend if you disable encryption that you constrain your storage account access to a virtual network with service endpoints.
  • 大型文件共享:此字段为最多涵盖 100 TiB 空间的文件共享启用存储帐户。Large file shares: This field enables the storage account for file shares spanning up to 100 TiB. 启用此功能会将存储帐户限制为只能使用本地冗余存储选项。Enabling this feature will limit your storage account to only locally redundant storage options. 为大型文件共享启用 GPv2 存储帐户后,无法禁用大型文件共享功能。Once a GPv2 storage account has been enabled for large file shares, you cannot disable the large file share capability. FileStorage 存储帐户(高级文件共享的存储帐户)没有此选项,因为所有高级文件共享最多可以扩展到 100 TiB。FileStorage storage accounts (storage accounts for premium file shares) do not have this option, as all premium file shares can scale up to 100 TiB.

适用于 Azure 文件存储的重要高级设置的屏幕截图

“高级”选项卡中提供的其他设置(Blob 软删除、Azure Data Lake Storage Gen 2 的分层命名空间,以及 Blob 存储的 NFSv3)不适用于 Azure 文件存储。The other settings that are available in the advanced tab (blob soft-delete, hierarchical namespace for Azure Data Lake storage gen 2, and NFSv3 for blob storage) do not apply to Azure Files.

TagsTags

标记是名称/值对,可让你通过将相同的标记应用到多个资源和资源组,对资源进行分类并查看合并的账单。Tags are name/value pairs that enable you to categorize resources and view consolidated billing by applying the same tag to multiple resources and resource groups. 这些设置是可选的,可以在创建存储帐户后应用。These are optional and can be applied after storage account creation.

查看 + 创建Review + create

创建存储帐户的最后一步是选中“查看 + 创建”选项卡上的“创建”按钮。 如果未填写存储帐户的所有必填字段,则此按钮将不可用。The final step to create the storage account is to select the Create button on the Review + create tab. This button won't be available if all of the required fields for a storage account are not filled.

创建文件共享Create file share

创建存储帐户后,剩下的操作就是创建文件共享。Once you've created your storage account, all that is left is to create your file share. 无论使用的是高级文件共享还是标准文件共享,此过程大部分都是相同的。This process is mostly the same regardless of whether you're using a premium file share or a standard file share. 主要区别在于配额及其表示的内容。The primary difference is the quota and what it represents.

标准文件共享是 Azure 文件共享的上限,最终用户不能超越此上限。For standard file shares, it's an upper boundary of the Azure file share, beyond which end-users cannot go. 针对标准文件共享指定配额的主要目的是便于预算:“我不希望此文件共享增长到此临界点以外”。The primary purpose for quota for a standard file share is budgetary: "I don't want this file share to grow beyond this point". 如果未指定配额,则标准文件共享最多可以涵盖 100 TiB 的空间(如果未为存储帐户设置大型文件共享属性,则最多可以涵盖 5 TiB)。If a quota is not specified, standard file share can span up to 100 TiB (or 5 TiB if the large file shares property is not set for a storage account).

对于高级文件共享,配额会重载以表示预配的大小。For premium file shares, quota is overloaded to mean provisioned size. 预配的大小是将要对你计费的数量,与实际使用情况无关。The provisioned size is the amount that you will be billed for, regardless of actual usage. 预配高级文件共享时,需要考虑两个因素:1) 需要从空间使用率角度考虑该共享的未来增长情况;2) 需要考虑工作负载所需的 IOPS。When you provision a premium file share, you want to consider two factors: 1) the future growth of the share from a space utilization perspective and 2) the IOPS required for your workload. 每个预配的 GiB 都允许你使用额外的保留 IOPS 和突发 IOPS。Every provisioned GiB entitles you to additional reserved and burst IOPS. 有关如何规划高级文件共享的详细信息,请参阅预配高级文件共享For more information on how to plan for a premium file share, see provisioning premium file shares.

如果你刚刚创建了存储帐户,可以在部署屏幕中选择“转到资源”导航到该存储帐户。If you just created your storage account, you can navigate to it from the deployment screen by selecting Go to resource. 如果以前已创建了存储帐户,可以通过它所在的资源组导航到该存储帐户。If you have previously created the storage account, you can navigate to it via the resource group containing it. 进入存储帐户后,选择标有“文件共享”的磁贴(也可以通过存储帐户的目录导航到“文件共享”)。 Once in the storage account, select the tile labeled File shares (you can also navigate to File shares via the table of contents for the storage account).

“文件共享”磁贴的屏幕截图

在文件共享列表中,应会看到以前在此存储帐户中创建的任何文件共享;如果尚未创建任何文件共享,则会显示一个空表。In the file share listing, you should see any file shares you have previously created in this storage account; an empty table if no file shares have been created yet. 选择“+ 文件共享”创建新的文件共享。Select + File share to create a new file share.

此时屏幕上应会显示“新建文件共享”边栏选项卡。The new file share blade should appear on the screen. 填写“新建文件共享”边栏选项卡中的字段以创建文件共享:Complete the fields in the new file share blade to create a file share:

  • 名称:要创建的文件共享的名称。Name: the name of the file share to be created.
  • 配额:标准文件共享的文件共享配额;高级文件共享的文件共享预配大小。Quota: The quota of the file share for standard file shares; the provisioned size of the file share for premium file shares.

选择“创建”以完成新共享的创建。Select Create to finishing creating the new share. 请注意,如果存储帐户位于虚拟网络中,那么除非客户端也在虚拟网络中,否则无法成功创建 Azure 文件共享。Note that if your storage account is in a virtual network, you will not be able to successfully create an Azure file share unless your client is also in the virtual network. 也可以使用 Azure PowerShell New-AzRmStorageShare cmdlet 解决此时间点限制。You can also work around this point-in-time limitation by using the Azure PowerShell New-AzRmStorageShare cmdlet.

备注

文件共享的名称必须是全部小写。The name of your file share must be all lowercase. 若要全面且详细地了解如何为文件共享和文件命名,请参阅 命名和引用共享、目录、文件和元数据For complete details about naming file shares and files, see Naming and referencing shares, directories, files, and metadata.

后续步骤Next steps