ALIYUN::NAS::FileSystem類型用於建立檔案系統。
文法
{
"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
}
} 屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
ProtocolType | String | 是 | 否 | 協議類型。 | 取值:
|
Bandwidth | Integer | 否 | 否 | 檔案系統吞吐上限。 | 當FileSystemType取值為cpfs時該參數必須指定,取值根據Capacity確定。更多資訊,請參見CPFS購買頁面。 單位:Mbps。 |
ChargeType | String | 否 | 否 | 付費類型。 | 取值:
|
Duration | Integer | 否 | 否 | 訂用帳戶時間長度。 | 當ChargeType取值為Subscription時該參數有效且必須指定。當訂用帳戶執行個體到期時未進行續約,執行個體會自動到期釋放。取值:
單位:月。 |
StorageType | String | 是 | 否 | 儲存類型。 | 取值:
|
DeletionForce | Boolean | 否 | 是 | 是否強制移除。 | 取值:
|
Description | String | 否 | 是 | 檔案系統描述。 | 長度為2~128個字元。必須以英文字母或漢字開頭,不能以 |
Tags | List | 否 | 是 | 標籤。 | 每個執行個體最多綁定20個標籤。 更多資訊,請參見Tags屬性。 |
SnapshotId | String | 否 | 否 | 快照ID。 | 可以通過指定SnapshotId從指定快照建立NAS執行個體,目前僅支援極速型NAS。 說明 通過快照建立的檔案系統版本需和快照源檔案系統版本一致。如果不一致,可以執行以下步驟:
|
EncryptType | Integer | 否 | 否 | 檔案系統是否加密。使用KMS託管密鑰,對檔案系統落盤資料進行加密儲存。在讀寫加密資料時,無需解密。 | 當FileSystemType取值為standard或extreme時該參數有效。取值:
|
Capacity | Integer | 否 | 是 | 檔案系統容量。 | 當FileSystemType取值為extreme或cpfs時該參數有效且必須指定。 取值範圍:
單位:GB。 |
FileSystemType | String | 否 | 否 | 檔案系統類型。 | 取值:
|
VpcId | String | 否 | 否 | 專用網路ID,指定VpcId和VSwitchId可以在建立檔案系統執行個體的同時預配置一個預設掛載點。 | 當FileSystemType取值為cpfs時,該參數必須指定。 |
VSwitchId | String | 否 | 否 | 交換器ID,指定VpcId和VSwitchId可以在建立檔案系統執行個體的同時預配置一個預設掛載點。 | 當FileSystemType取值為cpfs時該參數必須指定。 |
ResourceGroupId | String | 否 | 是 | 資源群組ID。 | 無 |
ZoneId | String | 否 | 否 | 可用性區域ID。 | 無 |
Tags文法
"Tags": [
{
"Key": String,
"Value": String
}
] Tags屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Key | String | 是 | 否 | 標籤鍵。 | 長度為1~128個字元,不能以 |
Value | String | 否 | 否 | 標籤值。 | 長度為0~128個字元,不能以 |
傳回值
Fn::GetAtt
FileSystemId:檔案系統ID。
樣本
情境 1 :建立檔案系統。
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"
]
}
}
}
}情境 2 :建立NAS檔案系統、訪問組、訪問規則及掛載點。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 建立NAS檔案系統、訪問組、訪問規則及掛載目標,配置協議、儲存類型、許可權及網路設定。
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~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": {
"zh-cn": "建立NAS檔案系統、訪問組、訪問規則及掛載目標,配置協議、儲存類型、許可權及網路設定。",
"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~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"
]
}
}
}
}情境 3 :通義千問和LangChain搭建對話模型。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 建立VPC環境,配置安全性群組,搭建NFS檔案系統,啟用PAI服務,部署基於Qwen和LangChain的對話模型WebUI。
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
zh-cn: 可用性區域
Description:
en: Availability Zone ID
zh-cn: 可用性區域ID。
AssociationProperty: ZoneId
PAIEASInstanceType:
Type: String
Label:
en: PAI-EAS instance type.
zh-cn: PAI-EAS執行個體規格
Description:
en: PAI-EAS instance type.
zh-cn: PAI-EAS 使用的執行個體規格。
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 dialogue 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:
zh-cn: 服務所在的命名空間。
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:通義千問和LangChain搭建對話模型{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "建立VPC環境,配置安全性群組,搭建NFS檔案系統,啟用PAI服務,部署基於Qwen和LangChain的對話模型WebUI。",
"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",
"zh-cn": "可用性區域"
},
"Description": {
"en": "Availability Zone ID",
"zh-cn": "可用性區域ID。"
},
"AssociationProperty": "ZoneId"
},
"PAIEASInstanceType": {
"Type": "String",
"Label": {
"en": "PAI-EAS instance type.",
"zh-cn": "PAI-EAS執行個體規格"
},
"Description": {
"en": "PAI-EAS instance type.",
"zh-cn": "PAI-EAS 使用的執行個體規格。"
},
"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 dialogue 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": {
"zh-cn": "服務所在的命名空間。",
"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:通義千問和LangChain搭建對話模型"
]
}
}
}