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(HMS-2640): machine type is required #734

Closed
wants to merge 1 commit into from

Conversation

lzap
Copy link
Member

@lzap lzap commented Oct 23, 2023

It looks like GCP errors out with "Operation denied by custom org policy: [customConstraints/custom.denyMachineTypes] : This organization policy prevents creating instances with exotic machine types. Contact the IT Public Cloud team at help.redhat.com for an exception" when nothing is passed into machine type. It is likely only on our account, but I am unable to test this with different account so making the field a required field.

Replaces: #689

@lzap
Copy link
Member Author

lzap commented Oct 23, 2023

/retest

@ezr-ondrej
Copy link
Member

This organization policy prevents creating instances with exotic machine types.

This seems to be unrelated to what you're fixing 🤔
I do not really understand this patch, but the error seems to be about us allowing to launch machine types, that are not permitted for given organization in the GCP.

Is this really fixing it? 🤔

Copy link
Member

@ezr-ondrej ezr-ondrej left a comment

Choose a reason for hiding this comment

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

There are probably typos in the examples, but I do not understand this patch 🤔

"source_id": "{{source_id_gcp}}",
"image_id": "https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/images/rhel-9-v20230411",
"amount": 1,
"machine_type": "e2-micro",
"launch_template_id": "{{launch_template_id}}",
"launch_template_id_gcp": "{{launch_template_id}}",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"launch_template_id_gcp": "{{launch_template_id}}",
"launch_template_id": "{{launch_template_id_gcp}}",

@@ -8,7 +8,7 @@ X-Rh-Identity: {{identity}}
"source_id": "{{source_id_aws}}",
"image_id": "ami-05fa00d4c63e32376",
"amount": 1,
"launch_template_id": "{{launch_template_id}}",
"launch_template_id_aws": "{{launch_template_id}}",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"launch_template_id_aws": "{{launch_template_id}}",
"launch_template_id": "{{launch_template_id_aws}}",

@lzap
Copy link
Member Author

lzap commented Oct 23, 2023

This seems to be unrelated to what you're fixing 🤔

Exactly, however, this is what Google returns. You pass nothing - this error. You pass any valid value and there you have it. It is weird indeed, I am fine just ignoring this it might be only on our account.

@lzap lzap force-pushed the input-checking-2640 branch from 8f2c413 to 0cb34c1 Compare October 23, 2023 14:08
@ezr-ondrej
Copy link
Member

Hmm I've got no idea really, but this PR defies purpose of the previous change: https://github.com/RHEnVision/provisioning-backend/pull/686/files#diff-91dda804d58381d894991796abaf5e1d17a6c2616438e44eaffa239494428605R217

So if we want to backtrack on that, we should also revert that to stay consistent?

Copy link
Member

@ezr-ondrej ezr-ondrej left a comment

Choose a reason for hiding this comment

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

still a typo, we did not rename the parameters, right?

@@ -8,7 +8,7 @@ X-Rh-Identity: {{identity}}
"source_id": "{{source_id_aws}}",
"image_id": "ami-05fa00d4c63e32376",
"amount": 1,
"launch_template_id": "{{launch_template_id}}",
"launch_template_id_aws": "{{launch_template_id_aws}}",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"launch_template_id_aws": "{{launch_template_id_aws}}",
"launch_template_id": "{{launch_template_id_aws}}",

"source_id": "{{source_id_gcp}}",
"image_id": "https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/images/rhel-9-v20230411",
"amount": 1,
"machine_type": "e2-micro",
"launch_template_id": "{{launch_template_id}}",
"launch_template_id_gcp": "{{launch_template_id_gcp}}",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"launch_template_id_gcp": "{{launch_template_id_gcp}}",
"launch_template_id": "{{launch_template_id_gcp}}",

@lzap
Copy link
Member Author

lzap commented Oct 24, 2023

Yeah let’s keep it as is.

@lzap lzap closed this Oct 24, 2023
@lzap lzap deleted the input-checking-2640 branch October 24, 2023 06:14
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.

2 participants