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

Setting resource limits for a flavor #456

Closed
krishnaprasad-narayanan opened this issue Sep 17, 2015 · 2 comments
Closed

Setting resource limits for a flavor #456

krishnaprasad-narayanan opened this issue Sep 17, 2015 · 2 comments

Comments

@krishnaprasad-narayanan

Hello all,

I am new to OpenStack4j. I have a requirement where I have to specify the resource limits during the creation of a VM. For example: CPU limit, CPU period, disk I/O options and etc. I am looking for an interface that looks similar to the one in the URL: http://docs.openstack.org/admin-guide-cloud/compute-flavors.html. I searched the OpenStack4j especially the interfaces related to "Flavor" and "FlavorService" but could not find one.

I am currently using the following library: openstack4j-2.0.3-withdeps.jar. May I know does this version support this requirement? If yes, can I know the suitable interfaces that I have to use in order to use this feature?

Regards,
Krishnaprasad

@iviireczech
Copy link
Contributor

Hello,
this can be achieved by creating extra specs on flavor.

Nova client example:

$ nova flavor-key m1.low_cpu set quota:cpu_quota=10000
$ nova flavor-key m1.low_cpu set quota:cpu_period=20000 

OpenStack4j equivalent:

final Map<String, String> spec = new HashMap<>();
spec.put("quota:cpu_quota", "10000");
spec.put("quota:cpu_period", "20000");

osClient
             .compute()
             .flavors()
             .createAndUpdateExtraSpecs("m1.low_cpu_id", spec);

@vinodborole
Copy link
Contributor

@krishnaprasad-narayanan please reopen if this issue still exists

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

No branches or pull requests

3 participants