Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add please c7. (region = "cn-hongkong") #1032

Open
cicadadevops opened this issue Nov 19, 2024 · 0 comments
Open

Add please c7. (region = "cn-hongkong") #1032

cicadadevops opened this issue Nov 19, 2024 · 0 comments

Comments

@cicadadevops
Copy link

Is your feature request related to a problem? Please describe.
Currently, cloudinfo does not support the c7 instance family for Alibaba Cloud. This causes errors when trying to scrape product data or map categories for instances like ecs.c7.2xlarge.
Describe the solution you'd like to see
Add support for the c7 instance family under the Compute Optimized category in the categoryMap. Specifically:
• Update the categoryMap in the Alibaba provider code to include c7 as part of the types.CategoryCompute.
• Ensure the c7 family is processed correctly in the mapCategory function.

Describe alternatives you've considered
Manually patch the categoryMap locally, but this solution is not maintainable for long-term use.
• Create a fallback mechanism in mapCategory to assign a default category for unknown families, such as General, but this would reduce accuracy.
Additional context
The c7 instance family represents Compute Optimized instances in Alibaba Cloud. These instances are suitable for high-performance computing tasks, and their inclusion is critical for accurate cost analysis and reporting.
• Instances like ecs.c7.2xlarge also require a specific SystemDisk.Category to fetch pricing, such as cloud_essd.


failed to get virtual machine category: could not determine the category: c7
failed to scrape products for region: failed to get products: failed to get price
aliyun ecs DescribePrice --RegionId cn-hongkong --InstanceType ecs.c7.2xlarge --PriceUnit Hour --SystemDisk.Category cloud_essd
{
	"PriceInfo": {
		"Price": {
			"Currency": "USD",
			"DetailInfos": {
				"DetailInfo": [
					{
						"DiscountPrice": 0.042768,
						"OriginalPrice": 0.3888,
						"Resource": "instanceType",
						"TradePrice": 0.346032
					},
					{
						"DiscountPrice": 0.0,
						"OriginalPrice": 0.0,
						"Resource": "",
						"TradePrice": 0.0
					},
					{
						"DiscountPrice": 0.0,
						"OriginalPrice": 0.0,
						"Resource": "bandwidth",
						"TradePrice": 0.0
					},
					{
						"DiscountPrice": 0.0,
						"OriginalPrice": 0.0,
						"Resource": "image",
						"TradePrice": 0.0
					},
					{
						"DiscountPrice": 0.0,
						"OriginalPrice": 0.005572,
						"Resource": "systemDisk",
						"TradePrice": 0.005572
					}
				]
			},
			"DiscountPrice": 0.042768,
			"OriginalPrice": 0.394372,
			"ReservedInstanceHourPrice": 0.0,
			"TradePrice": 0.351604
		},
		"Rules": {
			"Rule": [
				{
					"Description": "Instance 11% off",
					"RuleId": 653989
				}
			]
		}
	},
	"RequestId": "8F846F4A-396B-3AC9-ACD1-0ABC6EBB9DB6"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant