Skip to content
New issue

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

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

Already on GitHub? # to your account

vra_zone resource - placement_policy "SPREAD_MEMORY" #571

Open
davidsedano01 opened this issue Mar 11, 2025 · 3 comments · May be fixed by #573
Open

vra_zone resource - placement_policy "SPREAD_MEMORY" #571

davidsedano01 opened this issue Mar 11, 2025 · 3 comments · May be fixed by #573
Labels
awaiting-response Awaiting Response enhancement Enhancement

Comments

@davidsedano01
Copy link

Code of Conduct

This project has a Code of Conduct that all participants are expected to understand and follow:

Description

Currently (version 0.12.0) when creating "Resource: vra_zone", "placement_policy" attribute only accepts: "One of DEFAULT, SPREAD or BINPACK.".

Currently we are running Aria Automation 8.18 and utilizing "SPREAD BY MEMORY".

Example error when running "terraform plan"

│ Error: "placement_policy" must be one of 'DEFAULT', 'SPREAD', 'BINPACK'

│ with vra_zone.my_zone1,
│ on main.tf line 15, in resource "vra_zone" "my_zone1":
│ 15: placement_policy = "SPREAD_MEMORY"

Describe alternatives you've considered "placement_policy" is limited to

We are importing this resource, we have to go in manually in the GUI and set our desired policy.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@davidsedano01 davidsedano01 added enhancement Enhancement needs-triage Needs Triage labels Mar 11, 2025
@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Mar 12, 2025

@frodenas Could we update as follows?

const (
	PlacementPolicyDefault      = "DEFAULT"
	PlacementPolicySpread       = "SPREAD"
	PlacementPolicySpreadMemory = "SPREAD_MEMORY"
	PlacementPolicyBinpack      = "BINPACK"
)

var allowedPlacementPolicies = []string{
	PlacementPolicyDefault,
	PlacementPolicySpread,
	PlacementPolicySpreadMemory,
	PlacementPolicyBinpack,
}

and

		"placement_policy": {
				Type:        schema.TypeString,
				Default:     PlacementPolicyDefault,
				Description: getPlacementPolicyDescription(),
				Optional:    true,
				ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
					value := v.(string)
					for _, validValue := range allowedPlacementPolicies {
						if value == validValue {
							return
						}
					}
					errors = append(errors, fmt.Errorf(
						"%q must be one of %s", k, strings.Join(allowedPlacementPolicies, ", ")))
					return
				},
			},

I think this would be more idiomatic and simpler to maintain.

Let me know your thoughts and I'd. e happy to implement these changes.

@tenthirtyam tenthirtyam added awaiting-response Awaiting Response and removed needs-triage Needs Triage labels Mar 12, 2025
@willbarfield
Copy link

This would be very helpful. How long does it normally take to turn around a fix like this?

@tenthirtyam
Copy link
Collaborator

This would be very helpful. How long does it normally take to turn around a fix like this?

I've submitted #573 for review with an updated passing acceptance test.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
awaiting-response Awaiting Response enhancement Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants