-
Notifications
You must be signed in to change notification settings - Fork 35
/
ecs-mount-nas-file-system.yml
139 lines (139 loc) · 4.24 KB
/
ecs-mount-nas-file-system.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建NAS文件系统并挂载到ECS,支持自动创建或使用现有文件系统,配置高性能存储与挂载参数。
en: Create a NAS file system and mount it onto an ECS instance, supporting automatic
creation or utilization of existing file systems, with configuration for high-performance
storage and mounting parameters.
Conditions:
CreateNas:
Fn::Equals:
- Ref: CreateNasFileSystem
- true
Parameters:
EcsInstanceId:
Type: String
Label:
en: ECS Instance ID
zh-cn: ECS实例ID
Description:
en: An ECS instance used to mount NAS file system.
zh-cn: 用于挂载NAS文件系统的ECS实例。
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
MountPath:
Type: String
Label:
en: Mount Path
zh-cn: 挂载路径
Description:
en: The local path on the ECS where the file system is to be mounted. Use the
Linux absolute path that starts with "/". Please make sure the mount path
is not occupied.
zh-cn: ECS上待挂载的本地路径,请使用"/"开头的Linux绝对路径, 请确保挂载路径未被占用。
Default: /mnt
CreateNasFileSystem:
Type: Boolean
Label:
en: Whether to automatically create a general performance NAS file system
zh-cn: 是否自动创建通用性能型NAS文件系统
Description:
en: If you choose to create automatically, the NAS file system will be automatically
created under the virtual switch where the ECS is located, <font color='red'><b>Please
ensure that the selected ECS and the trial NAS resource package are in the
same region</b>.
zh-cn: 如果选择自动创建, 将自动在 ECS 所在的虚拟交换机下创建 NAS 文件系统, <font color='red'><b>请确保选择的ECS和试用的NAS资源包在同一个地域下</b>。
Default: true
NasFileSystemId:
Type: String
Label:
en: Existing file system ID
zh-cn: 已有文件系统ID
Description:
en: Enter the existing file system Id, please ensure that the file system and
ECS are under the same VPC.
zh-cn: 输入已有文件系统Id, 请确保文件系统与 ECS 处于同一个 VPC 下。
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${CreateNasFileSystem}
- true
Default: null
Resources:
DS_Instances:
Type: DATASOURCE::ECS::Instances
Properties:
InstanceIds:
- Ref: EcsInstanceId
NasFileSystem:
Type: ALIYUN::NAS::FileSystem
Condition: CreateNas
Properties:
VpcId:
Fn::Jq:
- First
- .[0].VpcId
- Fn::GetAtt:
- DS_Instances
- Instances
VSwitchId:
Fn::Jq:
- First
- .[0].VswitchId
- Fn::GetAtt:
- DS_Instances
- Instances
StorageType: Performance
FileSystemType: standard
ProtocolType: NFS
NasMountTarget:
Type: ALIYUN::NAS::MountTarget
Properties:
VpcId:
Fn::Jq:
- First
- .[0].VpcId
- Fn::GetAtt:
- DS_Instances
- Instances
VSwitchId:
Fn::Jq:
- First
- .[0].VswitchId
- Fn::GetAtt:
- DS_Instances
- Instances
Status: Active
FileSystemId:
Fn::If:
- CreateNas
- Ref: NasFileSystem
- Ref: NasFileSystemId
NetworkType: Vpc
AccessGroupName: DEFAULT_VPC_GROUP_NAME
MountToEcs:
Type: ALIYUN::ECS::Invocation
Properties:
InstanceIds:
- Ref: EcsInstanceId
CommandName: ACS-NAS-ClickMount-Mount-Linux-NFS.sh
Parameters:
ecslocalpath:
Ref: MountPath
automountonboot: true
mountparam: vers=3,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport
mounttargetdomain:
Fn::GetAtt:
- NasMountTarget
- MountTargetDomain
protocoltype: NFSv3
nasremotepath: /
Sync: true
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- EcsInstanceId
- MountPath
TemplateTags:
- acs:document:试用教程:NAS挂载到ECS