You can use Resource Orchestration Service (ROS) to call File Storage NAS (NAS) resources. This topic describes how to create an ROS template and use the template to automatically create a NAS file system.
Supported resources
ROS is an Alibaba Cloud service that simplifies the management of cloud computing resources. You can create a template to describe the required cloud computing resources such as Elastic Compute Service (ECS) and ApsaraDB RDS instances, as well as the dependencies between the resources. ROS automatically creates and configures all resources based on the template to implement automated deployment and O&M. For more information, see What is ROS?
You can use ROS to call the API operations of NAS. Resources that can be orchestrated by using ROS include regular resources and data resources.
Regular resources
ALIYUN::NAS::AccessGroup: creates a permission group.
ALIYUN::NAS::AccessRule: creates a rule for a permission group.
ALIYUN::NAS::FileSystem: create a NAS file system.
ALIYUN::NAS::MountTarget: creates a mount target.
Data resources
DATASOURCE::NAS::AccessGroups: queries the details of permission groups.
DATASOURCE::NAS::FileSystems: queries the details of file systems.
DATASOURCE::NAS::Zones: queries zones.
Permissions
In this example, you must create a file system. By default, ROS uses the credentials of the user who logs on to the ROS console. The user must be granted the following permission:
AliyunNASFullAccess: grants full permissions on NAS.
Procedure
Log on to the ROS console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Stacks. On the Stacks page, choose
.Specify Template: Select Select an Existing Template.
Template Import Method: Select Enter Template Content.
Template Content: Select ROS and then enter code.
For more information about the syntax, description, and examples of how to create a file system, see ALIYUN::NAS::FileSystem.
YAML
formatROSTemplateFormatVersion: '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
JSON
format{ "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" ] } } } }
For more examples, visit nas.yml. In the examples, the following resource types are used: ALIYUN::NAS::FileSystem, ALIYUN::NAS::AccessGroup, ALIYUN::NAS::AccessRule, and ALIYUN::NAS::MountTarget.
Click Create and execute the created stack.
View the result.
After the file system is created, click the Resources tab to view the ID of the fie system in the Resource ID column. You can click the resource ID in the Resource ID column to go to the details page of the file system.