ALIYUN::NAS::FileSystem类型用于新建文件系统。

语法

{
  "Type": "ALIYUN::NAS::FileSystem",
  "Properties": {
    "SnapshotId": String,
    "Description": String,
    "StorageType": String,
    "DeletionForce": Boolean,
    "EncryptType": Integer,
    "VpcId": String,
    "ZoneId": String,
    "Capacity": Integer,
    "ProtocolType": String,
    "FileSystemType": String,
    "Bandwidth": Integer,
    "VSwitchId": String
  }
}  

属性

属性名称 类型 必须 允许更新 描述 约束
ProtocolType String 协议类型 取值:
  • NFS
  • SMB
StorageType String 存储类型
  • 当FileSystemType=standard时,取值:
    • Performance:性能型
    • Capacity:容量型
  • 当FileSystemType=extreme或FileSystemType=cpfs时,取值:
    • standard:标准型
    • advance:高级型
DeletionForce Boolean 是否强制删除 取值:
  • true
  • false(默认值)
Description String 文件系统描述 长度为2~128个英文或中文字符。必须以英文字母或中文开头,不能以http://和https://开头。可以包含数字、半角冒号(:)、下划线(_)或者短划线(-)。
ZoneId String 可用区ID
SnapshotId String 快照ID。
说明 通过快照创建文件系统,创建的文件系统版本和快照源文件系统版本一致。如果快照的源文件系统版本是1,需要创建版本2性能规格的文件系统,可以先通过快照创建一个文件系统,然后再创建一个新的文件系统,把通过快照创建的文件系统中的数据拷贝到新创建的文件系统,拷贝完成后把业务迁移到新的文件系统即可。
可以通过指定SnapshotId实现从指定快照创建NAS实例,目前仅支持极速型NAS。
EncryptType Integer 是否创建加密文件系统。使用KMS服务托管密钥,对文件系统落盘数据进行加密存储。 在读写加密数据时,无需解密。 当FileSystemType=standard或extreme时有效。取值:
  • 0:不加密
  • 1:加密
Capacity Integer 文件系统容量
  • 当FileSystemType=extreme时必填,取值范围:100~262,144。
  • 当FileSystemType=cpfs时必填,取值范围:2048~512,000。

单位:GB。

FileSystemType String 文件系统类型 取值:
  • standard(默认值):通用型
  • extreme:极速型
  • cpfs:并行文件系统
VpcId String 专有网络ID,指定VpcId和VSwitchId可以在创建文件系统实例的同时预配置好一个默认挂载点。 当FileSystemType=cpfs时必填。
Bandwidth Integer 文件系统吞吐上限 当FileSystemType=cpfs时必填,取值根据Capacity确定,详情请参见CPFS购买页面

单位:MB/s。

VSwitchId String 交换机ID,指定VpcId和VSwitchId可以在创建文件系统实例的同时预配置好一个默认挂载点。 当FileSystemType=cpfs时必填。

返回值

Fn::GetAtt

FileSystemId:文件系统ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SnapshotId": {
      "Type": "String",
      "Description": "Snapshot ID."
    },
    "Description": {
      "Type": "String",
      "Description": "File system description (space characters are not allowed)"
    },
    "StorageType": {
      "Type": "String",
      "Description": "The file system type. Currently includes the Performance type and the Capacity type"
    },
    "DeletionForce": {
      "Type": "Boolean",
      "Description": "Whether delete all mount targets on the file system and then delete file system. Default is false",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ],
      "Default": false
    },
    "EncryptType": {
      "Type": "Number",
      "Description": "Specifies whether to encrypt data. You can use keys that are hosted by Key Management Service (KMS) to encrypt data stored on a file system. Data is automatically decrypted when you access encrypted data. Valid values:\n0: specifies that no encryption is applied to data on the file system.\n1: specifies that encryption is applied to data on the file system."
    },
    "VpcId": {
      "Type": "String",
      "Description": "Vpc ID."
    },
    "ZoneId": {
      "Type": "String",
      "Description": "Zone ID."
    },
    "Capacity": {
      "Type": "Number",
      "Description": "File system capacity, the unit is GB. Required and valid when FileSystemType=extreme or cpfs."
    },
    "ProtocolType": {
      "Type": "String",
      "Description": "Type of protocol used. Currently includes the NFS type and the SMB type",
      "AllowedValues": [
        "NFS",
        "SMB"
      ]
    },
    "FileSystemType": {
      "Type": "String",
      "Description": "File system type. Allowed values: standard, extreme, cpfs"
    },
    "Bandwidth": {
      "Type": "Number",
      "Description": "Maximum file system throughput, unit is MB/s. Required and valid only when FileSystemType=cpfs."
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "VSwitch ID."
    }
  },
  "Resources": {
    "FileSystem": {
      "Type": "ALIYUN::NAS::FileSystem",
      "Properties": {
        "SnapshotId": {
          "Ref": "SnapshotId"
        },
        "Description": {
          "Ref": "Description"
        },
        "StorageType": {
          "Ref": "StorageType"
        },
        "DeletionForce": {
          "Ref": "DeletionForce"
        },
        "EncryptType": {
          "Ref": "EncryptType"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "Capacity": {
          "Ref": "Capacity"
        },
        "ProtocolType": {
          "Ref": "ProtocolType"
        },
        "FileSystemType": {
          "Ref": "FileSystemType"
        },
        "Bandwidth": {
          "Ref": "Bandwidth"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        }
      }
    }
  },
  "Outputs": {
    "FileSystemId": {
      "Description": "ID of the file system created",
      "Value": {
        "Fn::GetAtt": [
          "FileSystem",
          "FileSystemId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SnapshotId:
    Type: String
    Description: Snapshot ID.
  Description:
    Type: String
    Description: File system description (space characters are not allowed)
  StorageType:
    Type: String
    Description: >-
      The file system type. Currently includes the Performance type and the
      Capacity type
  DeletionForce:
    Type: Boolean
    Description: >-
      Whether delete all mount targets on the file system and then delete file
      system. Default is false
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
    Default: false
  EncryptType:
    Type: Number
    Description: >-
      Specifies whether to encrypt data. You can use keys that are hosted by Key
      Management Service (KMS) to encrypt data stored on a file system. Data is
      automatically decrypted when you access encrypted data. Valid values:

      0: specifies that no encryption is applied to data on the file system.

      1: specifies that encryption is applied to data on the file system.
  VpcId:
    Type: String
    Description: Vpc ID.
  ZoneId:
    Type: String
    Description: Zone ID.
  Capacity:
    Type: Number
    Description: >-
      File system capacity, the unit is GB. Required and valid when
      FileSystemType=extreme or cpfs.
  ProtocolType:
    Type: String
    Description: Type of protocol used. Currently includes the NFS type and the SMB type
    AllowedValues:
      - NFS
      - SMB
  FileSystemType:
    Type: String
    Description: 'File system type. Allowed values: standard, extreme, cpfs'
  Bandwidth:
    Type: Number
    Description: >-
      Maximum file system throughput, unit is MB/s. Required and valid only when
      FileSystemType=cpfs.
  VSwitchId:
    Type: String
    Description: VSwitch ID.
Resources:
  FileSystem:
    Type: 'ALIYUN::NAS::FileSystem'
    Properties:
      SnapshotId:
        Ref: SnapshotId
      Description:
        Ref: Description
      StorageType:
        Ref: StorageType
      DeletionForce:
        Ref: DeletionForce
      EncryptType:
        Ref: EncryptType
      VpcId:
        Ref: VpcId
      ZoneId:
        Ref: ZoneId
      Capacity:
        Ref: Capacity
      ProtocolType:
        Ref: ProtocolType
      FileSystemType:
        Ref: FileSystemType
      Bandwidth:
        Ref: Bandwidth
      VSwitchId:
        Ref: VSwitchId
Outputs:
  FileSystemId:
    Description: ID of the file system created
    Value:
      'Fn::GetAtt':
        - FileSystem
        - FileSystemId