The ALIYUN::NAS::FileSystem resource type creates a NAS file system.
Syntax
{
"Type": "ALIYUN::NAS::FileSystem",
"Properties": {
"SnapshotId": String,
"Description": String,
"StorageType": String,
"DeletionForce": Boolean,
"EncryptType": Integer,
"VpcId": String,
"ZoneId": String,
"Capacity": Integer,
"Tags": List,
"ProtocolType": String,
"FileSystemType": String,
"Bandwidth": Integer,
"VSwitchId": String,
"Duration": Integer,
"ChargeType": String,
"ResourceGroupId": String
}
} Properties
Property Name | Type | Required | Update allowed | Description | Constraints |
ProtocolType | String | Yes | No | The protocol type. | Valid values:
|
Bandwidth | Integer | No | No | The maximum throughput of the file system. | This parameter is required when FileSystemType is set to cpfs. The value depends on the Capacity. For more information, see the CPFS purchase page. Unit: Mbps. |
ChargeType | String | No | No | The billing method. | Valid values:
|
Duration | Integer | No | No | The subscription duration. | This parameter is required and takes effect only when ChargeType is set to Subscription. If you do not renew a subscription instance, the instance is automatically released upon expiration. Valid values:
Unit: months. |
StorageType | String | Yes | No | Storage class | Valid values:
|
DeletionForce | Boolean | No | Yes | Force delete? | Valid values:
|
Description | String | No | Yes | The description of the file system. | The description must be 2 to 128 characters in length. It must start with a letter or a Chinese character and cannot start with |
Tags | List | No | Yes | The tags. | You can add up to 20 tags to an instance. For more information, see the Tags properties section. |
SnapshotId | String | No | No | The snapshot ID. | You can specify a SnapshotId to create a NAS instance from a snapshot. This feature is available only for Extreme NAS file systems. Note The version of the file system created from a snapshot must be the same as the version of the source file system of the snapshot. If the versions are different, perform the following steps:
|
EncryptType | Integer | No | No | Specifies whether to encrypt the file system. Data is encrypted at rest using a key that is managed by Key Management Service (KMS). You do not need to decrypt the data when you read or write the encrypted data. | This parameter is valid only when FileSystemType is set to standard or extreme. Valid values:
|
Capacity | Integer | No | Yes | The capacity of the file system. | This parameter is required and takes effect only when FileSystemType is set to extreme or cpfs. Value range:
Unit: GB. |
FileSystemType | String | No | No | The type of the file system. | Valid values:
|
VpcId | String | No | No | The ID of the virtual private cloud (VPC). If you specify VpcId and VSwitchId, a default mount target is preconfigured when the file system is created. | This parameter is required when FileSystemType is set to cpfs. |
VSwitchId | String | No | No | The ID of the vSwitch. If you specify VpcId and VSwitchId, a default mount target is preconfigured when the file system is created. | This parameter is required when FileSystemType is set to cpfs. |
ResourceGroupId | String | No | Yes | The ID of the resource group. | None |
ZoneId | String | No | No | The ID of the zone. | None |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
] Tags properties
Property Name | Type | Required | Update allowed | Description | Constraints |
Key | String | Yes | No | The tag key. | The tag key must be 1 to 128 characters in length. It cannot start with |
Value | String | No | No | The tag value. | The tag value must be 0 to 128 characters in length. It cannot start with |
Return value
Fn::GetAtt
FileSystemId: The ID of the file system.
Examples
Scenario 1: Create a file system
ROSTemplateFormatVersion: '2015-09-01'
Description: Test NAS FileSystem
Parameters: {}
Resources:
FileSystem:
Type: ALIYUN::NAS::FileSystem
Properties:
ProtocolType: NFS
StorageType: Capacity
Outputs:
FileSystemId:
Description: ID of the file system created
Value:
Fn::GetAtt:
- FileSystem
- FileSystemId{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": "Test NAS FileSystem",
"Parameters": {
},
"Resources": {
"FileSystem": {
"Type": "ALIYUN::NAS::FileSystem",
"Properties": {
"ProtocolType": "NFS",
"StorageType": "Capacity"
}
}
},
"Outputs": {
"FileSystemId": {
"Description": "ID of the file system created",
"Value": {
"Fn::GetAtt": [
"FileSystem",
"FileSystemId"
]
}
}
}
}Scenario 2: Create a NAS file system, an access group, an access rule, and a mount target
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Create NAS file systems, access groups, access rules, and mount targets, configure
protocols, storage types, permissions, and network settings.
Parameters:
Description:
Type: String
Description: File system description.
Default: mytest
ProtocolType:
Type: String
Description: Type of protocol used.
Default: NFS
AllowedValues:
- NFS
- SMB
StorageType:
Type: String
Description: The file system type.
Default: Capacity
AllowedValues:
- Performance
- Capacity
AccessGroupName:
Type: String
Default: mytest
VSwitchId:
Type: String
VpcId:
Type: String
Priority:
Type: Number
Description: 'Allowed values: 1 to 100'
Default: 1
MinValue: 1
MaxValue: 100
UserAccessType:
Type: String
Default: no_squash
AllowedValues:
- no_squash
- root_squash
- all_squash
SourceCidrIp:
Type: String
Description: Address or address segment
Default: 0.0.0.0/0
RWAccessType:
Type: String
Description: 'Read-write permission type: RDWR (default), RDONLY'
Default: RDWR
AllowedValues:
- RDWR
- RDONLY
Resources:
FileSystem:
Type: ALIYUN::NAS::FileSystem
Properties:
ProtocolType:
Ref: ProtocolType
StorageType:
Ref: StorageType
Description:
Ref: Description
AccessGroup:
Type: ALIYUN::NAS::AccessGroup
Properties:
AccessGroupType: Vpc
AccessGroupName:
Ref: AccessGroupName
AccessRule:
Type: ALIYUN::NAS::AccessRule
Properties:
Priority:
Ref: Priority
UserAccessType:
Ref: UserAccessType
AccessGroupName:
Fn::GetAtt:
- AccessGroup
- AccessGroupName
SourceCidrIp:
Ref: SourceCidrIp
RWAccessType:
Ref: RWAccessType
DependsOn: AccessGroup
MountTarget:
Type: ALIYUN::NAS::MountTarget
Properties:
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
FileSystemId:
Fn::GetAtt:
- FileSystem
- FileSystemId
NetworkType: Vpc
AccessGroupName:
Fn::GetAtt:
- AccessGroup
- AccessGroupName
DependsOn:
- AccessRule
- FileSystem
Outputs:
FileSystemId:
Description: ID of the file system created
Value:
Fn::GetAtt:
- FileSystem
- FileSystemId
AccessGroupName:
Description: Permission group name
Value:
Fn::GetAtt:
- AccessGroup
- AccessGroupName
AccessRuleId:
Value:
Fn::GetAtt:
- AccessRule
- AccessRuleId
MountTargetDomain:
Value:
Fn::GetAtt:
- MountTarget
- MountTargetDomain
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"en": "Create NAS file systems, access groups, access rules, and mount targets, configure protocols, storage types, permissions, and network settings."
},
"Parameters": {
"Description": {
"Type": "String",
"Description": "File system description.",
"Default": "mytest"
},
"ProtocolType": {
"Type": "String",
"Description": "Type of protocol used.",
"Default": "NFS",
"AllowedValues": [
"NFS",
"SMB"
]
},
"StorageType": {
"Type": "String",
"Description": "The file system type.",
"Default": "Capacity",
"AllowedValues": [
"Performance",
"Capacity"
]
},
"AccessGroupName": {
"Type": "String",
"Default": "mytest"
},
"VSwitchId": {
"Type": "String"
},
"VpcId": {
"Type": "String"
},
"Priority": {
"Type": "Number",
"Description": "Allowed values: 1 to 100",
"Default": 1,
"MinValue": 1,
"MaxValue": 100
},
"UserAccessType": {
"Type": "String",
"Default": "no_squash",
"AllowedValues": [
"no_squash",
"root_squash",
"all_squash"
]
},
"SourceCidrIp": {
"Type": "String",
"Description": "Address or address segment",
"Default": "0.0.0.0/0"
},
"RWAccessType": {
"Type": "String",
"Description": "Read-write permission type: RDWR (default), RDONLY",
"Default": "RDWR",
"AllowedValues": [
"RDWR",
"RDONLY"
]
}
},
"Resources": {
"FileSystem": {
"Type": "ALIYUN::NAS::FileSystem",
"Properties": {
"ProtocolType": {
"Ref": "ProtocolType"
},
"StorageType": {
"Ref": "StorageType"
},
"Description": {
"Ref": "Description"
}
}
},
"AccessGroup": {
"Type": "ALIYUN::NAS::AccessGroup",
"Properties": {
"AccessGroupType": "Vpc",
"AccessGroupName": {
"Ref": "AccessGroupName"
}
}
},
"AccessRule": {
"Type": "ALIYUN::NAS::AccessRule",
"Properties": {
"Priority": {
"Ref": "Priority"
},
"UserAccessType": {
"Ref": "UserAccessType"
},
"AccessGroupName": {
"Fn::GetAtt": [
"AccessGroup",
"AccessGroupName"
]
},
"SourceCidrIp": {
"Ref": "SourceCidrIp"
},
"RWAccessType": {
"Ref": "RWAccessType"
}
},
"DependsOn": "AccessGroup"
},
"MountTarget": {
"Type": "ALIYUN::NAS::MountTarget",
"Properties": {
"VpcId": {
"Ref": "VpcId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"FileSystemId": {
"Fn::GetAtt": [
"FileSystem",
"FileSystemId"
]
},
"NetworkType": "Vpc",
"AccessGroupName": {
"Fn::GetAtt": [
"AccessGroup",
"AccessGroupName"
]
}
},
"DependsOn": [
"AccessRule",
"FileSystem"
]
}
},
"Outputs": {
"FileSystemId": {
"Description": "ID of the file system created",
"Value": {
"Fn::GetAtt": [
"FileSystem",
"FileSystemId"
]
}
},
"AccessGroupName": {
"Description": "Permission group name",
"Value": {
"Fn::GetAtt": [
"AccessGroup",
"AccessGroupName"
]
}
},
"AccessRuleId": {
"Value": {
"Fn::GetAtt": [
"AccessRule",
"AccessRuleId"
]
}
},
"MountTargetDomain": {
"Value": {
"Fn::GetAtt": [
"MountTarget",
"MountTargetDomain"
]
}
}
}
}Scenario 3: Build a conversational model with Qwen and LangChain
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Create a VPC environment, configure security groups, set up an NFS file system,
enable PAI services, and deploy a conversation model WebUI based on Qwen and LangChain.
Parameters:
ZoneId:
Type: String
Label:
en: VSwitch Availability Zone
Description:
en: Availability Zone ID
AssociationProperty: ZoneId
PAIEASInstanceType:
Type: String
Label:
en: PAI-EAS instance type.
Description:
en: PAI-EAS instance type.
AllowedPattern: '(^ecs.*gn.*)|(^ml.*)'
AssociationProperty: ALIYUN::EAS::Instance::InstanceType
AssociationPropertyMetadata:
SubscriptionType: PayAsYouGo
Resources:
RandomString:
Type: ALIYUN::RandomString
Properties:
length: 8
character_classes:
- class: lowercase
min: 1
- class: digits
min: 1
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
CidrBlock: 192.168.0.0/24
SecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: Vpc
SecurityGroupIngress:
- PortRange: 80/80
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
- PortRange: 443/443
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
- PortRange: 3389/3389
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
NasFileSystem:
Type: ALIYUN::NAS::FileSystem
Properties:
ProtocolType: NFS
FileSystemType: standard
StorageType: Performance
DeletionForce: true
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
NasAccessGroup:
Type: ALIYUN::NAS::AccessGroup
Properties:
AccessGroupType: Vpc
AccessGroupName:
Fn::Sub: nas-access-group-${ALIYUN::StackId}
NasMountTarget:
Type: ALIYUN::NAS::MountTarget
DependsOn:
- NasAccessRule
Properties:
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
NetworkType: Vpc
AccessGroupName:
Ref: NasAccessGroup
FileSystemId:
Ref: NasFileSystem
NasAccessRule:
Type: ALIYUN::NAS::AccessRule
Properties:
SourceCidrIp: 0.0.0.0/0
AccessGroupName:
Ref: NasAccessGroup
Workspace:
Type: ALIYUN::PAI::Workspace
Properties:
EnvTypes:
- dev
- prod
Description: Build a conversational model based on Qwen and LangChain.
WorkspaceName:
Fn::Sub: qwen_demo_${RandomString.value}
EAS:
Type: ALIYUN::PAI::Service
Properties:
ServiceConfig:
metadata:
name:
Fn::Sub: qwen_demo_${RandomString.value}
instance: 1
enable_webservice: 'true'
cloud:
computing:
instance_type:
Ref: PAIEASInstanceType
instances: Null
containers:
- image:
Fn::Sub:
- 'eas-registry-vpc.${Region}.cr.aliyuncs.com/pai-eas/chat-llm-webui:2.1'
- Region:
Ref: ALIYUN::Region
script: 'python webui/webui_server.py --port=8000 --model-path=Qwen/Qwen-7B-Chat'
port: 8000
DependsOn:
- Workspace
Outputs:
Namespace:
Description:
en: The namespace where the service resides.
Value:
Fn::GetAtt:
- EAS
- Namespace
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- ZoneId
- PAIEASInstanceType
TemplateTags:
- acs:technical-solution:AI:Build a conversational model with Qwen and LangChain{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"en": "Create a VPC environment, configure security groups, set up an NFS file system, enable PAI services, and deploy a conversation model WebUI based on Qwen and LangChain."
},
"Parameters": {
"ZoneId": {
"Type": "String",
"Label": {
"en": "VSwitch Availability Zone"
},
"Description": {
"en": "Availability Zone ID"
},
"AssociationProperty": "ZoneId"
},
"PAIEASInstanceType": {
"Type": "String",
"Label": {
"en": "PAI-EAS instance type."
},
"Description": {
"en": "PAI-EAS instance type."
},
"AllowedPattern": "(^ecs.*gn.*)|(^ml.*)",
"AssociationProperty": "ALIYUN::EAS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"SubscriptionType": "PayAsYouGo"
}
}
},
"Resources": {
"RandomString": {
"Type": "ALIYUN::RandomString",
"Properties": {
"length": 8,
"character_classes": [
{
"class": "lowercase",
"min": 1
},
{
"class": "digits",
"min": 1
}
]
}
},
"Vpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": "192.168.0.0/16"
}
},
"VSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"ZoneId": {
"Ref": "ZoneId"
},
"VpcId": {
"Ref": "Vpc"
},
"CidrBlock": "192.168.0.0/24"
}
},
"SecurityGroup": {
"Type": "ALIYUN::ECS::SecurityGroup",
"Properties": {
"VpcId": {
"Ref": "Vpc"
},
"SecurityGroupIngress": [
{
"PortRange": "80/80",
"Priority": 1,
"SourceCidrIp": "0.0.0.0/0",
"IpProtocol": "tcp",
"NicType": "internet"
},
{
"PortRange": "443/443",
"Priority": 1,
"SourceCidrIp": "0.0.0.0/0",
"IpProtocol": "tcp",
"NicType": "internet"
},
{
"PortRange": "3389/3389",
"Priority": 1,
"SourceCidrIp": "0.0.0.0/0",
"IpProtocol": "tcp",
"NicType": "internet"
}
]
}
},
"NasFileSystem": {
"Type": "ALIYUN::NAS::FileSystem",
"Properties": {
"ProtocolType": "NFS",
"FileSystemType": "standard",
"StorageType": "Performance",
"DeletionForce": true,
"ZoneId": {
"Ref": "ZoneId"
},
"VpcId": {
"Ref": "Vpc"
},
"VSwitchId": {
"Ref": "VSwitch"
}
}
},
"NasAccessGroup": {
"Type": "ALIYUN::NAS::AccessGroup",
"Properties": {
"AccessGroupType": "Vpc",
"AccessGroupName": {
"Fn::Sub": "nas-access-group-${ALIYUN::StackId}"
}
}
},
"NasMountTarget": {
"Type": "ALIYUN::NAS::MountTarget",
"DependsOn": [
"NasAccessRule"
],
"Properties": {
"VpcId": {
"Ref": "Vpc"
},
"VSwitchId": {
"Ref": "VSwitch"
},
"NetworkType": "Vpc",
"AccessGroupName": {
"Ref": "NasAccessGroup"
},
"FileSystemId": {
"Ref": "NasFileSystem"
}
}
},
"NasAccessRule": {
"Type": "ALIYUN::NAS::AccessRule",
"Properties": {
"SourceCidrIp": "0.0.0.0/0",
"AccessGroupName": {
"Ref": "NasAccessGroup"
}
}
},
"Workspace": {
"Type": "ALIYUN::PAI::Workspace",
"Properties": {
"EnvTypes": [
"dev",
"prod"
],
"Description": "Build a conversational model based on Qwen and LangChain.",
"WorkspaceName": {
"Fn::Sub": "qwen_demo_${RandomString.value}"
}
}
},
"EAS": {
"Type": "ALIYUN::PAI::Service",
"Properties": {
"ServiceConfig": {
"metadata": {
"name": {
"Fn::Sub": "qwen_demo_${RandomString.value}"
},
"instance": 1,
"enable_webservice": "true"
},
"cloud": {
"computing": {
"instance_type": {
"Ref": "PAIEASInstanceType"
},
"instances": null
}
},
"containers": [
{
"image": {
"Fn::Sub": [
"eas-registry-vpc.${Region}.cr.aliyuncs.com/pai-eas/chat-llm-webui:2.1",
{
"Region": {
"Ref": "ALIYUN::Region"
}
}
]
},
"script": "python webui/webui_server.py --port=8000 --model-path=Qwen/Qwen-7B-Chat",
"port": 8000
}
]
}
},
"DependsOn": [
"Workspace"
]
}
},
"Outputs": {
"Namespace": {
"Description": {
"en": "The namespace where the service resides."
},
"Value": {
"Fn::GetAtt": [
"EAS",
"Namespace"
]
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"ZoneId",
"PAIEASInstanceType"
]
}
],
"TemplateTags": [
"acs:technical-solution:AI:Build a conversational model with Qwen and LangChain"
]
}
}
}For more examples, see Public templates that contain this resource.