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

extraconfig parameter unable to be set via Domain Admin #9397

Closed
scottsignal opened this issue Jul 15, 2024 · 7 comments · Fixed by #9422
Closed

extraconfig parameter unable to be set via Domain Admin #9397

scottsignal opened this issue Jul 15, 2024 · 7 comments · Fixed by #9422
Assignees
Milestone

Comments

@scottsignal
Copy link

scottsignal commented Jul 15, 2024

ISSUE TYPE
  • Improvement Request
COMPONENT NAME
API
CLOUDSTACK VERSION
4.19.02
CONFIGURATION

Ubuntu 22.04
KVM

OS / ENVIRONMENT

N/A

SUMMARY

A user in an account with the default out of the box role "Domain Admin" is unable to add the extraconfig parameter via API. Running this same API command as Root Admin works just fine.

STEPS TO REPRODUCE

Ensure that the 2 options are set and reboot mgmt:
allow.additional.vm.configuration.list.kvm = backend, tpm, devices
Enable additional vm configuration = enabled
Build an account & user with the out of the box role "Domain Admin"
Build an instance normally, however, make sure the Start Instance ratio is unselected at the bottom.
Run the API command to modify add the extra config. Running this command does not work under an account with out of the box default "Domain Admin" role.

https://example.com/client/api?command=updateVirtualMachine&id=<ID_Here>&extraconfig=%3Cdevices%3E%0A%3Ctpm%20model%3D%22tpm-tis%22%3E%0A%3Cbackend%20type%3D%22emulator%22%20version%3D%222.0%22%2F%3E%0A%3C%2Ftpm%3E%0A%3C%2Fdevices%3E
EXPECTED RESULTS

extraconfig added to the VM.

ACTUAL RESULTS

API returns results with no error, however, extraconfig is not added.

@weizhouapache
Copy link
Member

@scottsignal
it is expected, only root admin can set extraconfig

refer to

@Parameter(name = ApiConstants.EXTRA_CONFIG, type = CommandType.STRING, since = "4.12", description = "an optional URL encoded string that can be passed to the virtual machine upon successful deployment", authorized = { RoleType.Admin }, length = 5120)
private String extraConfig;

it has authorized = { RoleType.Admin }

@weizhouapache
Copy link
Member

we could remove the restriction, as the extraconfig is allowed when deploy a vm

@weizhouapache weizhouapache added this to the 4.19.2.0 milestone Jul 15, 2024
@scottsignal
Copy link
Author

we could remove the restriction, as the extraconfig is allowed when deploy a vm

Unless there is good reason to not. At a minimum, it would be nice to allow that not to be hard coded and be able to select roles to be selected in global settings for additional roles to add additional extraconfig. Thanks!

@nvazquez
Copy link
Contributor

I agree with @scottsignal - also there are global settings which can restrict the passing of the extra configs to the hypervisor side even though the extra configs are defined as VM settings:

image

@DaanHoogland
Copy link
Contributor

Ok, so we can change the hard-coding to allow access to the parameter for all and "just" check the global settings during the call, right @nvazquez ?

@nvazquez
Copy link
Contributor

Yes @DaanHoogland - the access is already in place using these configurations as far as I know so only editing the access should work

@DaanHoogland
Copy link
Contributor

fixed in #9422

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

5 participants