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

Added changes in volume object. #228

Closed
wants to merge 3 commits into from
Closed

Conversation

chitranm
Copy link
Contributor

@chitranm chitranm commented Oct 29, 2024

DE24521 - Added new read only fields in volume object - StoragePoolName and DataCenterName.

@chitranm chitranm marked this pull request as ready for review October 29, 2024 10:57
@chitranm chitranm requested a review from a team as a code owner October 29, 2024 10:57
@karthik-radakrishnan
Copy link

LGTM. Will defer to Denis/Mike to approve.

@@ -231,7 +231,7 @@ require (
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this dependency has changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dbozzato81, I didn't do anything except the change at line 9 and "go mod tidy".

Copy link
Contributor

Choose a reason for hiding this comment

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

It was part of the new metal-client release:
image

Comment on lines 219 to 220
Required: false,
Optional: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't one of these be true?

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 will remove this Optional parameter as it is a read only field.

Comment on lines 227 to 228
Required: false,
Optional: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't one of these be true?

Copy link
Contributor

Choose a reason for hiding this comment

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

There is already a vStoragePool attribute present

Choose a reason for hiding this comment

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

Looks like vStoragePool is not being populated (in the translation layer). Wonder how it's being used by the client (BMaaS UI).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @karthik-radakrishnan and @dbozzato81, I realized that vStoragePool is getting populated using /available-resources API. And if I remove StoragePoolName then we are back to the same problem where vStoragePool can have a specific data to a particular pod location. And same is true with DataCanterName. I will keep both of them as these are read only parameters. Let me know if there are any concerns.

Copy link
Contributor

Choose a reason for hiding this comment

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

From the vStoragePool definition and looking at the code, it seams it is only used for Volume create i.e. it is not getting populated by the provider by it is given by the user in case vStoragePoolID is not.

		vStoragePool: {
			Type:        schema.TypeString,
			Required:    false,
			Optional:    true,
			Description: "The storage pool of the volume to be created.",
		},

So why we can't use it like this?...

		vStoragePool: {
			Type:        schema.TypeString,
			Optional:    true,
                        Computed:  true,
			Description: "The storage pool of the volume to be created.",
		},

Another question, are we sure that vStoragePoolID is computed and returned correctly for external volumes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @dbozzato81, vStoragePoolID is assigned to externally managed volumes when we create them in the DB from DCC. This poolID is assigned based on the array volume was created on.

I have explained above for the vStoragePool - This is fetched based on the vStoragePoolID and available-resources response. And then it is used to create Volume.

vStoragePoolName and vDataCenterName are read only fields and if we don't want them to have in terraform then we can discard this PR and make vStoragePool Computed as true

@@ -1,13 +1,14 @@
module github.com/hewlettpackard/hpegl-metal-terraform-resources

go 1.21.0
go 1.22.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@neilgierman, please check if this is Ok? It is coming after "go mod tidy".

Copy link
Contributor

Choose a reason for hiding this comment

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

I have another PR at #231 to be a more complete update to gp 1.22. Once that is approved, then the new master can be merged to this PR.

@chitranm
Copy link
Contributor Author

chitranm commented Nov 5, 2024

After the discussion with @dbozzato81 and @karthik-radakrishnan, we realized that these two new parameters are read only and not required to create volume resource. Hence I am discarding this PR.

@neilgierman do I need to keep the go.mod and go.sum changes in this PR?

@neilgierman
Copy link
Contributor

After the discussion with @dbozzato81 and @karthik-radakrishnan, we realized that these two new parameters are read only and not required to create volume resource. Hence I am discarding this PR.

@neilgierman do I need to keep the go.mod and go.sum changes in this PR?

Nothing is needed from this PR. I have #231 open that has the Go changes only.

@chitranm chitranm closed this Nov 5, 2024
@chitranm chitranm deleted the DE24521_add_new_vol_attr branch November 5, 2024 14:31
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

Successfully merging this pull request may close these issues.

5 participants