Introduction: After the enterprise business on the cloud, but also faced with a specific availability area to purchase a specific computing product instance on the cloud dilemma? Private pool on cloud pick
Why do cloud services need resource certainty and service continuity
Cloud computing is evolving into infrastructure like hydro and coal, enabling users to use on demand and pay by volume. At present, all cloud service providers at home and abroad are cooperating with ecological partners to improve the rapid iteration and promotion of cloud products and services. However, the reality is very painful: users still face the dilemma of failure to purchase specific computing product instances on the cloud in specific available areas occasionally. The computing concept of cloud services — flexibility anytime, anywhere, why does it not Work in this scenario? Let’s analyze it.
At present, the whole business life cycle of customer cloud needs the “commoditized” carrier of perceptive computing power: for example, A customer needs to buy aliYun elastic computing cloud server when migrating the Web service of personal blog to Aliyun, and the customer needs to sense the cloud server specification information, such as the latest ECS.G7.xlarge. For example, a customer B will deploy the business of online 3D creative effect on Ali Cloud and rely on the powerful GPU and other computing resources of Ali Cloud. In this case, it needs to purchase the GPU cloud server of Elastic computing of Ali Cloud, such as ECS.gn7i-C8G1.2xlarge.
Popular understanding: similar users to the “hotel” to rent a “room”. In the on-cloud environment, the user purchases a specific compute instance specification on the cloud.
This is different from “plug and play” for hydropower and coal: computing power in the cloud needs to sense information about commodity instances. Hydropower and coal are unified ‘consumption’, shielding back-end suppliers (which grid power supply, which line transmission) and production equipment (hydropower, thermal power, wind power, solar power, etc.). At present, computing power service selling entities of domestic and foreign head cloud service providers is still the mainstream of computing power corresponding to specific commodities. Since it is commodity specific, there are differences between goods in service characteristics, suitable business scenarios, quantity required by business, and so on. Cloud service providers also need to prepare different products in different regions in advance, as well as the availability of quantities.
Because it is difficult to accurately predict the user level, purchase time and purchase quantity of various specific computing power products, once there is an industry hot spot, most customers in the same industry will buy a large number of products with a certain feature in a short time, and it is easy to snap up specific products, leading to the purchase failure of some users. For example, in the context of the epidemic, the rise of mining and online education has led to the strong demand for computing power of the local site and video coding and decoding, leading to the prominent phenomenon of buying up related commodities.
Common sense: the “hotel” like the remaining rooms are used up, new customers failed to stay. In the cloud environment, users purchase computing instances on the cloud, but the stock is sold out in a short time, and the purchase may fail.
In addition, e-commerce will hold various “festival” promotions at different times of the year, such as June 18 and November 11. During and after the promotion, a large amount of computing power resources are required to support the online campaign and the massive data analysis after the campaign. Customer service experiences typical continuous service processes such as “normal”, “great promoting state”, “great promoting final state” and “normal state”. In order to ensure the continuity of services throughout the year, in particular, the resource demand is determined according to the expected plan, so the deterministic delivery of resources on the cloud is an important support.
Popular understanding: for example, the Olympic Games such expected activities, users stay in the hotel, the insurance measure is to book a good room in advance. In a cloud environment, this means booking a virtual IDC (private pool) on the cloud so that resources can be delivered deterministically on the private pool.
Figure 1- Comparison of the current “service form” of hydropower and coal infrastructure and cloud computing infrastructure
To sum up, at this stage, under the background that the mainstream service sales form of cloud services is still the “commercialization of computing power”, users need to perceive the characteristics of commodities required in the life cycle process of business on the cloud, and the cloud platform needs to supply and produce commodities. Due to the changes in demand and the uncertainty of the market environment, the short-term mismatch between supply and demand is more likely to occur. Therefore, to serve specific customers in specific industries and purchase deterministic goods for specific computing power, that is, to deliver deterministic resources on the cloud, has become an important ability to solve this dilemma.
How to ensure the certainty of business resources and service continuity on the cloud
The objective situation is analyzed before, there is a phenomenon of short-term purchase failure of goods in a specific region, a specific time period and a specific calculation power. For customers, it is necessary to realize the certainty of resource delivery based on their own scenarios, cloud commodity supply in the market, and appropriate cost input, so as to ensure business continuity.
The following analysis is based on the overall concept. Specific business scenarios of customers require case-by-case analysis. For example, the selection of predetermined area, the selection of instance specifications, the selection of predetermined time, the selection of predetermined quantity, and the optimal total cost. One partition of resource delivery is shown in Figure 2, where private pools are an important implementation of deterministic delivery. Based on service scenarios, this article will not introduce the optimal private pool selection solution. The following documents will be dedicated to help users better rely on cloud products and services, achieve deterministic delivery of resources, and ensure service continuity.
Figure 2- A partition of resource delivery
Figure 3- Alternative strategies for deterministic delivery
Figure 4- Alternative strategies for flexible delivery
Aliyun private pool options and value
1- Related concepts
Private Pool: When a user purchases a product such as “Elastic guarantee” or “Capacity Reservation” under the “Resource Assurance” service TAB on the ECS console, he or she obtains a deterministic inventory resource reserve on the cloud and is exclusively allocated for use. Figure 5- Private pool schema abstraction and multiple product implementations. On the left side of Figure 5, a private pool service has two phases: private pool reservation and private pool resource delivery. For private pool reservations, the product’s goal is fulfillment: to ensure that the private pool is actually used. For example, EA Elastic Assurance takes a one-time pre-charge for this private pool.
Figure 5- Private pool pattern and multiple product implementations
**iCR: ** Immediately Capacity Reservesion CR is used up and there is no extra cost. It can only charge for the remaining Capacity when there is no Reservesion in the private pool.
**aCR: ** Advance Capacity Reservation A Reservation for a specified period of time that takes effect later. A Reservation fee is charged based on the credit rating. The higher the credit rating, the lower the Reservation fee.
For private pool resource delivery, the product goal is: deterministic delivery, zero threshold usage. When the instance comes out, the normal charges will be made by the instance.
Resources: * * * * resources security is including resource supply quantitative perception, resource reservation, private pool uncertainty planning using the deterministic link resources service, it can improve the query you, reservation, purchase and use of resources in the process of experience, make you in a complex and changeable market environment can still enjoy the proprietary security resources.
** Flexible protection: ** With flexible protection, you only need to pay a low protection fee in exchange for resource certainty protection for a fixed period (support from 1 month to 5 years). When purchasing elastic security, set the available area, instance specification, guaranteed quantity and other attributes, and the system will reserve resources matching the specified number of attributes in a private pool. For example, 10 ecS.C6. Large specification instances are reserved in east China 1 (Hangzhou) available area I. During the elastic guarantee period, you choose to use the capacity of the private pool when creating pay-as-you-go instances to enjoy resource certainty assurance. You can repeatedly create/release a specified number of instances without worrying about resource provisioning during the elastic guarantee period. Resource deterministic guarantee is no longer provided when elastic guarantee expires or there is no free capacity.
** Immediate Capacity Reservation: ** You can purchase an immediate capacity reservation at any time, and the reservation will take effect immediately after the reservation is successful to enjoy the resource certainty service. After the scheduled capacity takes effect, you will be charged according to the volume instance rate until the scheduled capacity is automatically released or you manually release the capacity in advance. Purchase Effective Immediately If you set the available area, instance specifications, OPERATING system type, and capacity, the system reserves the specified number of resources in a private pool. During the capacity subscription period, you choose to use the capacity of the private pool when creating pay-as-you-go instances to enjoy resource determinism. For ECS purchased through common scenarios, the online resources may not meet your customization requirements at all times due to the ever-changing supply of resources. During the capacity subscription period, you can repeatedly create/release a specified number of instances without worrying about resource provisioning. If the capacity reservation is not in effect or there is no available capacity in the capacity reservation, the resource deterministic guarantee is no longer provided. In the capacity booking cycle, if you purchase a volume instance and use resource determinism, the computing resource charge for the volume instance will be offset against part or all of the capacity booking that matches the volume instance.
If a volume instance matches both elastic guarantee and capacity reservation, the system preferentially selects the private pool corresponding to the capacity reservation product for matching.
2- Private pool value
Value 1: Certainty resource delivery
With the widespread adoption of cloud native concepts and practices, cloud-based computing power r&d has become the new normal. In the process of rapid business development after cloud native, customers often demand deterministic delivery of resources for specific scenarios, and expect 100% guarantee of the online, operation and promotion of businesses in accordance with the established plan.
Resource assurance related products provide full link deterministic delivery capability.
With the capability of deterministic delivery, from the business perspective, it avoids the uncertain risk of low success rate of purchase caused by the purchase of certain scarce resources under a certain available area on the cloud, such as the instance of GPU with large specifications. Based on the elastic delivery of the original shared resource pool, the deterministic delivery can further guarantee 100% resource security of high-priority services. For example, 20 INSTANCES of A specifications are purchased in quantity. These instances will perform operations such as o&M and change of services. In this way, the private pool composed of 20 INSTANCES of A specifications is purchased to ensure 100% certainty of resources during o&M of these instances and prevent them from being preempted by other customers. Normally, the 20 A-spec private pool capacity is used by all 20 A-spec instances, with no free capacity and therefore no additional cost input. If the number of resource-deterministic INSTANCES of A is less than 20 (for example, only 18 instances are used), two free capacities are generated. In this case, the free capacities are charged by the second and billed by the hour.
Value 2: Resources are scheduled and allocated exclusively
In the iterative upgrading process where customer business architecture and business evolution are deeply integrated with cloud products and services, in addition to the deterministic delivery of resources, the flexible delivery of resources also becomes an important demand. Ali Cloud resource guarantee service currently supports exclusive scheduling allocation based on private pools on the cloud. There are two practical methods for user-specific scheduling.
Method 1: Users schedule instances based on the Open, Target, and None matching rules
When creating a private pool, the user specifies the matching attributes of the private pool: Open (Open) and Target (specified). When creating an instance, specify the instance matching attribute Open or Target (in Target mode, the specified private pool ID must be displayed), and the back end schedules the attribute matching.
When the instance matching attribute is set to Open, the system preferentially creates the instance from the user private pool. If there is no matching private pool, the system creates instances according to the shared pool process and retains the deterministic feature of resources. Once it discovers free capacity, the system automatically matches and associates these instances with free private pools on time. When the value of the instance match attribute is Target, a private pool is specified. In this case, the system checks the capacity and resource rules of the specified private pool. For example, region, Zone, instanceType, Platform, and payType private pools.
When the matching attribute of an instance is modified, the system will re-match the instance with the private pool on time to ensure that the instance is associated with the private pool as much as possible to reduce user costs (the free capacity of the private pool is used up in a timely manner). When a private pool whose matching mode is Open is released, the system will re-match instances associated with the private pool and using the Open matching mode on time to ensure that instances are associated with the private pool as much as possible, thereby reducing users’ costs (the free capacity of the private pool is used up in a timely manner).
Method 2: Users schedule and allocate instances based on Tags matching rules
When creating a private pool, you can specify the tag information of the private pool and then specify the tag information when creating an instance. In this way, the backend can schedule and allocate resources from the private pool or the common pool based on the tag matching rules specified by the customer.
In order to lower or zero thresholds for users, Ali Cloud Resource Guarantee service supports users to directly use Mode 1 or Mode 2 for exclusive resource scheduling based on CreateInstance and RunInstnaces interfaces. For example, after a user applies for a whitelist, the backend sets the matching attribute of the instance created by the user as the default value based on user requirements. In this way, the existing integration interface parameters of the user do not need to be changed.
3- Private pool retrieval
Console purchase and acquisition
Help.aliyun.com/document\_d…
OpenAPI integrated access
Related demos are as follows:
1.1 Java
下载地址:https://search.maven.org/search?q=aliyun-java-sdk-ecs
1.2 Python
https://pypi.org/project/aliyun-python-sdk-ecs/
Python可直接通过pip安装:pip install aliyun-python-sdk-ecs
2.将SDK导入到工程中
具体操作步骤可参考官方帮助文档,地址:
https://help.aliyun.com/document_detail/25699.html?spm=a2c4g.11186623.6.1483.512e73fbxDWOfZ
3.创建立即生效容量预定私有池
创建容量预定私有池的对应API为CreateCapacityReservation
其中<accessKeyId>和<accessSecret>需要替换为对应购买账号的AK信息。
3.1 Java版Demo
创建私有池:立即生效容量预留
在线接口体验:https://api.aliyun.com/?spm=5176.12818093.resource-links.dapi_platform.54ce16d07XdZhp#/?product=Ecs&version=2014-05-26&api=CreateCapacityReservation&tab=DEMO&lang=JAVA
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile;
import com.google.gson.Gson;
import java.util.*;
import com.aliyuncs.ecs.model.v20140526.*;
public class CreateCapacityReservation {
public static void main(String[] args) {
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "<accessKeyId>", "<accessSecret>");
IAcsClient client = new DefaultAcsClient(profile);
CreateCapacityReservationRequest request = new CreateCapacityReservationRequest();
request.setRegionId("cn-hangzhou");
List<String> zoneIdList = new ArrayList<String>();
zoneIdList.add("cn-hangzhou-i");
request.setZoneIds(zoneIdList);
request.setInstanceType("ecs.c6.2xlarge");
request.setPeriod(1);
request.setPeriodUnit("Hour");
request.setPrivatePoolOptionsName("PrivatePoolName");
request.setDescription("PrivatePoolDescription");
request.setPrivatePoolOptionsMatchCriteria("Open");
request.setEndTimeType("Unlimited");
request.setInstanceAmount(10);
List<RunInstancesRequest.Tag> tagList = new ArrayList<RunInstancesRequest.Tag>();
RunInstancesRequest.Tag tag1 = new RunInstancesRequest.Tag();
tag1.setKey("11");
tag1.setValue("22");
tagList.add(tag1);
request.setTags(tagList);//注入tags
try {
CreateCapacityReservationResponse response = client.getAcsResponse(request);
System.out.println(new Gson().toJson(response));
} catch (ServerException e) {
e.printStackTrace();
} catch (ClientException e) {
System.out.println("ErrCode:" + e.getErrCode());
System.out.println("ErrMsg:" + e.getErrMsg());
System.out.println("RequestId:" + e.getRequestId());
}
}
}
创建实例-Open 开放匹配
在线接口体验:https://api.aliyun.com/?spm=5176.12818093.resource-links.dapi_platform.54ce16d07XdZhp#/?product=Ecs&version=2014-05-26&api=RunInstances&tab=DEMO&lang=JAVA
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile;
import com.google.gson.Gson;
import java.util.*;
import com.aliyuncs.ecs.model.v20140526.*;
public class RunInstances {
public static void main(String[] args) {
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "<accessKeyId>", "<accessSecret>");
IAcsClient client = new DefaultAcsClient(profile);
RunInstancesRequest request = new RunInstancesRequest();
request.setRegionId("cn-hangzhou");
request.setZoneId("cn-hangzhou-i");
request.setInstanceType("ecs.c6.2xlarge");
request.setInstanceChargeType("PostPaid");
request.setPeriod(1);
request.setPeriodUnit("Hour");
request.setNetworkType("vpc");
request.setImageId("aliyun_2_1903_x64_20G_alibase_20200529.vhd");
request.setSystemDiskSize(40);
request.setSystemDiskType("cloud_ssd");
request.setPrivatePoolOptionsMatchCriteria("Open"); // 私有池 开放匹配参数
request.setSecurityGroupId("sg-xxx");
request.setVSwitchId("vsw-xxx");
try {
RunInstancesResponse response = client.getAcsResponse(request);
System.out.println(new Gson().toJson(response));
} catch (ServerException e) {
e.printStackTrace();
} catch (ClientException e) {
System.out.println("ErrCode:" + e.getErrCode());
System.out.println("ErrMsg:" + e.getErrMsg());
System.out.println("RequestId:" + e.getRequestId());
}
}
}
创建实例-Target 指定匹配
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile;
import com.google.gson.Gson;
import java.util.*;
import com.aliyuncs.ecs.model.v20140526.*;
public class RunInstance {
public static void main(String[] args) {
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "<accessKeyId>", "<accessSecret>");
IAcsClient client = new DefaultAcsClient(profile);
RunInstancesRequest request = new RunInstancesRequest();
request.setRegionId("cn-hangzhou");
request.setZoneId("cn-hangzhou-i");
request.setInstanceType("ecs.c6.2xlarge");
request.setInstanceChargeType("PostPaid");
request.setPeriod(1);
request.setPeriodUnit("Hour");
request.setNetworkType("vpc");
request.setImageId("aliyun_2_1903_x64_20G_alibase_20200529.vhd");
request.setSystemDiskSize(40);
request.setSystemDiskType("cloud_ssd");
request.setPrivatePoolOptionsMatchCriteria("Target"); // 私有池 指定匹配
request.setPrivatePoolOptionsId("crp-xxx"); // 私有池id
request.setSecurityGroupId("sg-xxx");
request.setVSwitchId("vsw-xxx");
try {
RunInstancesResponse response = client.getAcsResponse(request);
System.out.println(new Gson().toJson(response));
} catch (ServerException e) {
e.printStackTrace();
} catch (ClientException e) {
System.out.println("ErrCode:" + e.getErrCode());
System.out.println("ErrMsg:" + e.getErrMsg());
System.out.println("RequestId:" + e.getRequestId());
}
}
}
Copy the code
4- Private pool user case
Case 1: Zero-threshold Tags matching to achieve accurate and deterministic delivery of business
Company A needs to upgrade its services once in A while and release its servers to deploy services again. During the upgrade process, ensure that the resources on which the business depends are delivered with certainty to ensure the continuity of business services.
There are two key changes: server release and re-deployment of business. On the cloud platform, users release and purchase resources all the time. In this dynamic process, the resources released by user A may soon be purchased by user B, and user A may not be able to buy the resources at this time. User A has to wait for other users to release the resources, or when the cloud platform happens to have A new commodity volume, and then he has A chance to purchase the resources successfully. Once the business needs to delay the purchase of corresponding goods (waiting for available inventory to be placed), the business upgrade process may be interrupted and service continuity may be affected.
To solve this problem, customers can first purchase the target product, implement new deployment of the business, and then release the old resource, which increases the cost of the upgrade process: the new resource and the old resource are paid at the same time, and the longer the upgrade process takes, the more the cost of the upgrade. In addition, the upgrade process is affected by the purchased resources. Subsequent upgrades can be performed only after the newly purchased resources are successfully delivered. In this way, the service upgrade plan is affected by the resource delivery.
Ali Cloud’s CR, effective immediately, fits this scenario perfectly. Company A buys A batch of private pools suitable for service scenarios (the capacity reservation takes effect immediately), releases resources, and allocates 100% resources to the private pools to upgrade services on time. In the actual use of private pools, Ali Cloud provides a standardized access scheme: Users can independently assign resources to private pools for resource delivery based on service management requirements. This requires the business to make minor changes to the existing resource delivery interface. However, considering the cost of user access and the degree of intrusion on existing services, Ali Cloud further provides CR with zero threshold and supports advanced features: after the authorization of customers, the cloud platform will help customers change the default matching attribute to Open when they purchase new instances. It also supports tag-oriented, business-specific instances and private pool Tag matching rules (the industry’s first feature) on top of existing Tag resource management.
The specific operation steps for COMPANY A to use CR are as follows:
- The technical staff of A company changed the matching attribute of the stock instance requiring immediate effective CR to Open through API.
- The technical staff of Company A authorizes Ali Cloud to change the default matching attribute of newly purchased instances under its account from None to Open.
- Technical personnel of COMPANY A design corresponding Tag combinations based on internal service logic
- Technical personnel of COMPANY A can create CR with corresponding Tag combination to take effect immediately as required
- Ali Cloud will associate the instances of the stock with the corresponding private pool according to the combination of Tag tags
- Technical personnel of company A create A new instance of the Tag combination, which must be successfully created and associated with the corresponding private pool
Note: Company A does not need to modify any existing script files to achieve deterministic delivery of resources with zero intrusion.
Case 2: Business self-management Precise and deterministic delivery of services and private pools
In company B, the resource delivery team is responsible for the resource delivery of all business lines of the company. To improve resource utilization, it is common for services to share resources. For example, services A and B share resources during the day and at night. For example, company B conducts online promotion activities irregularly, during which there will be an obvious resource burst. In this process, the sharing of resources and the sudden demand for resources occur.
On the cloud, the customer’s own resources are shared. One way is to release the cloud server and deploy and adjust the applications on the service. Another method is to release resources and applications, and the new application reapplies for resources for redeployment. The former resource and application lifecycle are decoupled, while the latter resource and lifecycle are consistent.
Driven by the cloud native concept, consistent resource and application life cycles can be achieved: programmable infrastructure, immutable infrastructure. Customers want resources that are ready to be released and available again. In fact, when multiple users purchase resources concurrently on the cloud, the platform does not promise that the resources released by user C will be left for user C to use, but will be sold when users need to buy. Then, the release of resources may not be able to buy again in time.
Similarly, the temporary purchase of a large number of sudden resources may not be successful. The client’s demand is the certainty delivery of resources to complete the promotion of business activities.
Ali cloud delay capacity reservation, effective immediately capacity reservation, take effect after the capacity of the book (that is, the customer’s exclusive private pool), the customer can release the instance of private pool at any time, again through the pool of private instance, customer perception, private pool capacity of business resources sharing based on the private pool, can be accurate migration anywhere at any time. Company B has strong r&d strength and strong technology control. It independently integrates OpenAPI of private pool into the company’s resource delivery system to achieve independent and precise resource delivery.
The specific operation steps of COMPANY B are as follows:
- Technical personnel of COMPANY B purchase CR with immediate effect matching resource planning through API
- B company technical personnel in the receipt of the application for business resources, according to the B company resources management strategy, create API in resources, such as CreateInstance, RunInstances set PrivatePoolOptionsMatchCriteria = Open. In this mode, resource creation is first matched in the developed private pool, and when the private pool cannot be matched, it is applied to the shared pool, which well realizes the certainty and flexibility of shared service delivery. Or PrivatePoolOptionsMatchCriteria = Target, PrivatePoolOptions ID = CRP – a. In this mode, ensure that the resource creation is created in the specified private pool CRP-A. Very low level of certainty delivery of reinsurance or high priority business.
The above two cases are (1) zero-threshold matching of Tags to achieve accurate and deterministic delivery of business (2) Accurate and deterministic delivery of business self-management and private pool. The two modes can be widely reused in the ECS resource certainty delivery scenarios of various companies on Ali Cloud.
5- Key technologies for private pools
In a word, the cloud platform reserves fixed resource inventory for customers, which is only provided for exclusive use by customers (including other sub-accounts or AliUid authorized by customers).
Open | Target Principle of allocation technology
According to create an instance of the incoming parameters: PrivatePoolOptionsMatchCriteria value is Open or None or Target, the back-end in selecting corresponding resource pool for inventory check and delivery. The private pool also has MatchCriteria, which can be Open or Target.
The matching rules can be read in the official document: help.aliyun.com/document\_d…
Tags Distribution technology principles
Tags allocation is essentially based on the matching rules of private pool Tags and instance Tags, which is a reflection of the scheduling system capability directly productized service. Then all the relevant technology of the scheduling system can be used in theory. For a comprehensive introduction to resource scheduling and management, see In Depth Clustering: Resource Scheduling and Management in A Large Data Center.
conclusion
Cloud resource protection services (such as specific elastic protection, immediate capacity reservation, and capacity planning services to be launched) are delivered to customers in a cloud private pool, and customers can implement deterministic delivery, flexible delivery, and resource sharing based on the private pool. This provides strong support for the certainty and continuous development of customers’ business. Customers can also share capacity and cost.
Author: Li Yuqian, ali Cloud technology expert; This article has been published with the author’s authorization
That’s the end of this best practices story, and we’ll have a guide to private pools on the cloud and more
The original link
This article is the original content of Aliyun and shall not be reproduced without permission.