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 Chennai region and zones and update SysTypes #15

Merged

Conversation

arshadd-b
Copy link
Contributor

@arshadd-b arshadd-b commented Nov 18, 2024

This PR adds regions and zones and updates SysTypes
Fixes issue #14

@ppc64le-cloud-bot
Copy link

Welcome @arshadd-b! It looks like this is your first PR to ppc64le-cloud/powervs-utils 🎉

@ppc64le-cloud-bot ppc64le-cloud-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 18, 2024
@mkumatag
Copy link
Member

/cc @dharaneeshvrd @Karthik-K-N

please review and also Chennai DC and also go through this doc - https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-ibm-cloud-reg and see what else is missing.

@Prajyot-Parab
Copy link

@arshadd-b
Add Chennai DC

zone   -> che01
region -> che

region.go Outdated Show resolved Hide resolved
region.go Outdated Show resolved Hide resolved
@arshadd-b arshadd-b force-pushed the update-regions-and-zones branch from 76469e2 to adc1ded Compare November 19, 2024 04:14
@ppc64le-cloud-bot ppc64le-cloud-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 19, 2024
region.go Outdated
@@ -11,13 +11,11 @@ func GetRegion(zone string) (region string, err error) {
case strings.HasPrefix(zone, "us-south"):
region = "us-south"
case strings.HasPrefix(zone, "dal"):
region = "dal"
region = "us-south"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this change? Not sure it might cause some breakage to existing modules using this func. Please validate this across OpenShift and capi projects for its usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had referred this mapping https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/docs/book/src/reference/regions-zones-mapping.md
Could see that the zones us-south dal10 dal12 having same region us-south
same case with wdc

It is getting used just here , I don't think will create any issue
https://github.com/openshift/machine-api-provider-powervs/blob/e253fa30d99bb7ed00c1f27ca3d810fa682a1901/pkg/client/powervs_client.go#L162C36-L162C45

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I think @Karthik-K-N can comment here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think when we are setting provider id we set / so till now its dal/dal10, I think it will affect it.
@KeerthanaAP @Shilpa-Gokul whats the value you set for region when using dal10 zone? in IPI

Copy link
Contributor

Choose a reason for hiding this comment

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

We set the powervs region as "dal" while using "dal10" zone and I think we use "us-south" for VPCRegion.
https://github.com/openshift/installer/blob/release-4.15/pkg/types/powervs/powervs_regions.go#L24C3-L24C6

Zones: []string{
"che01",
},
SysTypes: []string{"s922", "e980"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Hope you have validated the sys types available in Chennai! If not you can check via PowerVS workspace in cloud.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have checked the machine types for this zone che01 I can see only these two machine types

Do we need to include Dedicated host types as well in sysTypes ?

@arshadd-b arshadd-b force-pushed the update-regions-and-zones branch from adc1ded to b8b8a24 Compare November 19, 2024 08:22
@arshadd-b
Copy link
Contributor Author

arshadd-b commented Nov 19, 2024

I have noticed new machine Types added in zones, I have added those as well
But in some cases like in Zone dal12 having machine types E980, S922and dal10 is having machine types E980, S1022, S922 . Machine Types are different for different zones.
How should we handle these cases since we have single entry of zones belonging to same region in map ?

For now we have kept the common machine Types in zones
https://github.com/ppc64le-cloud/powervs-utils/blob/main/region.go#L65

@dharaneeshvrd
Copy link
Contributor

Individual zone based machine types would alter the current region map.
If we are sure that region map is not directly consumed and only util funcs are consumed, then we can alter the map and util funcs.

@Karthik-K-N
Copy link
Contributor

I dont have much idea on the impact, @hamzy @mjturek could you please take a look.

@mkumatag
Copy link
Member

mkumatag commented Nov 21, 2024

we shouldn't have made public if not required!

Individual zone based machine types would alter the current region map.
If we are sure that region map is not directly consumed and only util funcs are consumed, then we can alter the map and util funcs.

@mkumatag mkumatag closed this Nov 21, 2024
@mkumatag mkumatag reopened this Nov 21, 2024
@arshadd-b arshadd-b force-pushed the update-regions-and-zones branch from b8b8a24 to 3187642 Compare November 26, 2024 06:53
@ppc64le-cloud-bot ppc64le-cloud-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 26, 2024
@arshadd-b
Copy link
Contributor Author

I have noticed new machine Types added in zones, I have added those as well But in some cases like in Zone dal12 having machine types E980, S922and dal10 is having machine types E980, S1022, S922 . Machine Types are different for different zones. How should we handle these cases since we have single entry of zones belonging to same region in map ?

For now we have kept the common machine Types in zones https://github.com/ppc64le-cloud/powervs-utils/blob/main/region.go#L65

Have created different issue for this #16

@arshadd-b arshadd-b changed the title update regions and zones Add missing regions and zones and update SysTypes Nov 26, 2024
@dharaneeshvrd
Copy link
Contributor

Overall LGTM!
@arshadd-b Please update the commit message with proper details!

@arshadd-b arshadd-b changed the title Add missing regions and zones and update SysTypes Add missing regions and zones and SysTypes Nov 26, 2024
@arshadd-b arshadd-b force-pushed the update-regions-and-zones branch from 3187642 to 52428b5 Compare November 26, 2024 09:20
@arshadd-b arshadd-b changed the title Add missing regions and zones and SysTypes Add Chennai region and zones and update SysTypes Nov 26, 2024
@arshadd-b
Copy link
Contributor Author

Overall LGTM! @arshadd-b Please update the commit message with proper details!

done

@@ -16,8 +16,6 @@ func GetRegion(zone string) (region string, err error) {
region = "sao"
case strings.HasPrefix(zone, "us-east"):
region = "us-east"
case strings.HasPrefix(zone, "tor"):
Copy link
Member

Choose a reason for hiding this comment

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

why is this removed? I still see an entry here for tor - https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-ibm-cloud-reg

Copy link
Member

Choose a reason for hiding this comment

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

@Prajyot-Parab @dharaneeshvrd @Karthik-K-N am I missing something here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Its a dup entry, that's why she removed I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah two entries were there for tor, so I have removed one

Copy link
Member

@mkumatag mkumatag left a comment

Choose a reason for hiding this comment

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

/lgtm

@ppc64le-cloud-bot ppc64le-cloud-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 28, 2024
@ppc64le-cloud-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arshadd-b, mkumatag

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ppc64le-cloud-bot ppc64le-cloud-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 28, 2024
@ppc64le-cloud-bot ppc64le-cloud-bot merged commit a2c048c into ppc64le-cloud:main Nov 28, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants