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

Fix the issue where the prices for most Alibaba Cloud instance types are incorrect when the instance family generation number is greater than or equal to 7 #2858

Merged
merged 5 commits into from
Aug 14, 2024

Conversation

qixiangyang
Copy link
Contributor

@qixiangyang qixiangyang commented Aug 5, 2024

Fix the issue where the prices for most Alibaba Cloud instance types are incorrect when the instance family generation number is greater than or equal to 7.

What does this PR change?

  • According to the customer service and official documentation of Alibaba Cloud, when the instance family generation of an instance is greater than or equal to 7, the system disk does not support "cloud_efficiency". In this case, "cloud_essd" should be used as the default system disk type parameter for queries.

Does this PR relate to any other PRs?

  • No

How will this PR impact users?

  • Get the right price when calculate asset, saving or other result

Does this PR address any GitHub or Zendesk issues?

  • Closes ...

How was this PR tested?

  • add test unit

Does this PR require changes to documentation?

  • No

Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?

  • i want label this pr as "next release", just don't know how to do it

@qixiangyang qixiangyang changed the title Fix the issue where the prices for most Alibaba Cloud instance types … Fix the issue where the prices for most Alibaba Cloud instance types are incorrect when the instance family generation number is greater than or equal to 7 Aug 5, 2024
@qixiangyang qixiangyang marked this pull request as draft August 5, 2024 08:57
@qixiangyang qixiangyang marked this pull request as ready for review August 5, 2024 09:22
@teevans
Copy link
Member

teevans commented Aug 9, 2024

Great catch! We'll have a look and see what we can do!

Copy link
Contributor

@ameijer ameijer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good, nice catch, a few small requests to improve the testing here and some documentation

pkg/cloud/alibaba/provider.go Outdated Show resolved Hide resolved
pkg/cloud/alibaba/provider.go Show resolved Hide resolved
pkg/cloud/alibaba/provider.go Outdated Show resolved Hide resolved
pkg/cloud/alibaba/provider.go Show resolved Hide resolved
pkg/cloud/alibaba/provider_test.go Show resolved Hide resolved
@ameijer
Copy link
Contributor

ameijer commented Aug 12, 2024

also, please sign off on your code
image

@qixiangyang qixiangyang force-pushed the develop branch 3 times, most recently from 0933442 to cc07e66 Compare August 13, 2024 10:30
pkg/cloud/alibaba/provider.go Outdated Show resolved Hide resolved
pkg/cloud/alibaba/provider.go Outdated Show resolved Hide resolved
xiangyang.qi and others added 4 commits August 14, 2024 02:22
…are incorrect when the instance family generation number is greater than or equal to 7.

Update provider.go

remove debug info

Signed-off-by: qixiangyang <qixiangyangrm@foxmail.com>
…types.

2. Revise comments when system disk information is not available
3. Add error logging and optimize the return value for the 'getInstanceFamilyGenerationFromType' function.
4. Add test cases for generating node requests for various instance types.

Signed-off-by: xiangyang.qi <xiangyang.qi@advancegroup.com>

1. Revise 'alibabaDefaultToCloudEssd' exclude 6+ generation instance types.
2. Revise comments when system disk information is not available
3. Add error logging and optimize the return value for the 'getInstanceFamilyGenerationFromType' function.
4. Add test cases for generating node requests for various instance types.

Signed-off-by: qixiangyang <qixiangyangrm@foxmail.com>
Co-authored-by: Alex Meijer <ameijer@users.noreply.github.com>
Signed-off-by: qixiangyang <qixiangyangrm@foxmail.com>
Signed-off-by: qixiangyang <qixiangyangrm@foxmail.com>
Copy link
Contributor

@ameijer ameijer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you @qixiangyang !

@ameijer ameijer merged commit c2de805 into opencost:develop Aug 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants