In our daily work, we must encounter situations where we need to build systems quickly:
- As a resource manager, you need to receive a certain number of configured resource requests. These requests require that networks and storage devices be in place as required.
- As a developer, you need to set up a development environment, copy a test environment and online environment;
- An architect plans a system that needs to be built on the cloud.
These scenes show the difficulties we face on a daily basis:
-
Various cloud resources need to be widely supported and managed, including common basic IaaS resources and PaaS services, such as host, router, load balancer and other computing network resources, as well as various database, cache, big data, and storage services.
-
Resource arrangement is difficult to use: the technology stack is complex and difficult to use, and the realization of complex topology requires systematic knowledge and rich experience;
-
A large number of machines are manually configured. Not only are resources and their topological relationships manually deployed, but the topological relationships among resources are even more troublesome.
-
High learning cost: In the past, resource management relied on API invocation from the command line, which increased operation difficulty and learning cost.
As a result, automated operation and maintenance became the business requirement of operation and maintenance personnel, and major cloud vendors launched their own Resource Orchestration (ROS) services. ROS’s philosophy is “infrastructure is code”. On the one hand, it uses code-thinking version management to record infrastructure changes, and on the other hand, it implements automated operation and maintenance through code to simplify code writing. Users can use Json/Yaml templates to describe the configurations and dependencies of multiple cloud computing resources (such as ECS, RDS, and SLB), and automatically deploy and configure all cloud resources in different regions and accounts. Just like Lego bricks, O&M personnel can easily build cloud computing resources.
After many investigations, we found that the most common scenario for cloud servers is to create 1-N cloud servers based on the “current state” of cloud servers, and the newly created system disks and data disks of cloud servers are “current state”. Take a website service as an example. Generally, operation and maintenance engineers will install some applications on the system disk or data disk, such as Tomcat, Jenkins, MySql, data/files of the website itself and so on. If need to create a cloud server and there are cloud server system or consistent state of data, can system disk to make custom images, data set into a snapshot, and then the new mirror when buying a cloud server to choose the custom image, snapshots of the data set to choose the snapshot, the rules of the security group configuration rules consistent with the original cloud server, You can create a new cloud server based on the “present state” of the original cloud server.
This approach is appropriate if you only need to create one cloud server and do not need to record historical state.
But the reality is much more complex than that, as cloud servers can be created/released frequently; Or the operator who generates the image is not the same person as the person who buys the cloud server. Once the purchase option is not correctly selected, the newly purchased cloud server cannot be put into the business. The billing by volume needs to be released, and the annual and monthly packages need to be released or data migration is due, which will inevitably bring cost losses. To record or track the historical evolution of cloud servers, such as security group configuration changes and basic images, you need to record them separately.
Faced with the above problems, operation and maintenance personnel use ROS templates as deliverables, define fixed parameters of resources in template resources, and define variable parameters in template parameters to facilitate the input of actual parameters during operation. In this way, when cloud servers are frequently created, you only need to enter variable parameters, such as image ID, snapshot ID, clone original cloud server, or no variable parameters. All definitions are described in resources and templates are compiled based on actual service requirements. Templates can also be stored in Github to track the history of templates as code management, and create operation and maintenance tools suitable for internal enterprises based on templates to achieve automatic operation and maintenance. The concept of “infrastructure is code” instead of “repetitive labor”.
We can see the powerful features of ROS:
-
Readable, easy-to-write text files: Operations personnel can edit JSON-formatted text directly or templates using the visual editor provided by the ROS console. You can use version control tools such as SVN and Git to control template versions to control infrastructure versions. ROS can also be integrated with its own application through API, SDK and other means to achieve Infrastructure as Code;
-
Standardized resource and application delivery: Independent software vendors (ISVs) can deliver entire systems and solutions containing cloud resources and applications via ROS templates. ISV can realize unified delivery by integrating aliyun resources and ISV software system through this delivery method.
-
Manage a group of cloud resources in a unified manner through the resource Stack (a resource Stack is a group of Ali Cloud resources) : The operations such as cloud resource creation, deletion, and cloning are completed by the resource Stack. In DevOps practice, ROS can be used to clone the development environment, test environment, and online environment to achieve overall migration and expansion of the application.
Once we understand the power of ROS, we create a variety of ROS templates in our daily use. As a result, we need more convenient tools to manage templates in daily operation and maintenance management. In order to better manage local and Cloud ROS Templates, we launched Alibaba Cloud Toolkit – Alibaba ROS Templates, which assists users to manage template files through a resource configuration file (.ros.config.yml).
Note:.ros.config.yml is the source file used by the Alibaba Ros Templates tool to manage Templates.
Step 1: Open your project in IntelliJ IDEA.
Step 2: Create a template using either of the following methods:
- Right-click your project name in IntelliJ IDEA and choose New > AlibabaCloud ROS YAML Template or New > AlibabaCloud ROS JSON Template.
Note: Templates created in this way will not be managed by the Alibaba ROS Templates tool. To use the template tool, add the template path to the.ros.config.yml file and move the template to the JSON and YAML folders.
- Open the Alibaba ROS Templates tool on the right side of IntelliJ IDEA, click Create, enter the name of the template, select the template type, and Create a local template.
Step 3: Enter the resource type in the Resources parameter.
- The AlibabaCloud ROS YAML Template example
- AlibabaCloud ROS JSON Template example
The fourth step: Description Ctrl+ the left mouse button can realize the jump between the parameter position and parameters, using Ctrl+ the mouse suspension can realize the floating information of parameters. The following table describes the operations of the template management function:
Right-click a local template to perform operations as required:
The operation instructions are as follows:
- Upload: Upload a template
- Rename: renames a template
- Delete: deletes a local template
Right-click a remote template and perform operations as required:
The operation instructions are as follows:
- Download: Download a template
- Properties: Displays template Properties
- Delete: deletes a remote template
Double-click the remote Template to open a temporary file by default. Right-click and choose Alibaba Cloud ROS > Update Template to display the remote Template modification.
Resource stack Management
Alibaba Cloud Toolkit – Alibaba Cloud ROS (Alibaba Cloud View) is a tool for managing the ROS resource stack. It can help you manage the remote resource stack easily.
- Open your project in IntelliJ IDEA;
- In the Window of IntelliJ IDEA, choose Alibaba Cloud View > Alibaba Cloud ROS to perform relevant operations according to your needs.
The following table describes the operations of the resource stack management function:
-
Resources: Displays information about all Resources in the resource stack
-
Parameters: displays the parameter information of the resource stack
About Cloud Toolkit
As a free local multi-IDE plug-in integrating development, testing, diagnosis and deployment, Cloud Toolkit helps developers truly realize one-click development and deployment of any server or ECS, EDAS, Kubernetes, SAE, functional computing, etc. Support Java protocol, efficient execution of terminal commands, SQL and other common tools, the speed of research and development increased by more than 8 times, greatly reduce the cost of research and development.
The product is completely free and covers IntelliJ IDEA, Eclipse, Pycharm, Maven, VS Code and other IDE environments. Continuous update + community support, to ensure that developers rest assured to use, truly achieve the R & D team to reduce costs and improve efficiency.
Corresponding download portal
- IntelliJ, PyCharm, PhpStorm:developer.aliyun.com/article/687…
- Eclipse:developer.aliyun.com/article/673…
- Visual Studio Code: * * * * marketplace.visualstudio.com/items?spm=5…
Product documentation: help.aliyun.com/document_de…
The first Cloud Native Microservices Conference
The 1st Cloud Native Microservices Conference PC Address:Developer.aliyun.com/topic/micro…
“Alibaba Cloud originator focuses on micro-service, Serverless, container, Service Mesh and other technical fields, focuses on the trend of cloud native popular technology, large-scale implementation of cloud native practice, and becomes the public account that most understands cloud native developers.”