Per-VM CPU & RAM allocation?
Hi! If I go into the UI, I can easily see how much each VM is allocated for RAM and CPU. However, I've googled until I'm blue in the face, and can't seem to see a way -- either through CLI or API -- to get that info. "nova limits --tenant <foo>" SEEMS like it should... except (at least on my Juno cloud), the "used" column is either full of zeros or dashes. Clearly, if it's in the UI, it's possible... somehow. But it seemed like it might be easier to ask the list than go down the rabbit hole of tcp captures. Any ideas? Thanks! -Ken P.S. Not interested in CPU-hours/usage -- I'm just looking for how much is actually allocated.
On Fri, Jan 04, 2019 at 02:45:43PM -0500, Ken D'Ambrosio wrote:
Hi! If I go into the UI, I can easily see how much each VM is allocated for RAM and CPU. However, I've googled until I'm blue in the face, and can't seem to see a way -- either through CLI or API -- to get that info. "nova limits --tenant <foo>" SEEMS like it should... except (at least on my Juno cloud), the "used" column is either full of zeros or dashes. Clearly, if it's in the UI, it's possible... somehow. But it seemed like it might be easier to ask the list than go down the rabbit hole of tcp captures.
Any ideas?
Thanks!
-Ken
P.S. Not interested in CPU-hours/usage -- I'm just looking for how much is actually allocated.
Hey Ken, Those values are set based on the flavor that is chosen when creating the instance. You can get that information of a running instance by: openstack server show <instance_name_or_id> And looking at the flavor of the instance. I believe it's in the format of "flavor.name (id)". You can then do: openstack flavor show <flavor_name_or_id> or just: openstack flavor list to get the RAM and VCPUs values defined for that flavor. There are corresponding API calls you can make. Add "--debug" to those CLI calls to get the debug output that shows curl examples of the REST APIs being called. Hope that helps. Sean
On 1/4/2019 1:45 PM, Ken D'Ambrosio wrote:
Hi! If I go into the UI, I can easily see how much each VM is allocated for RAM and CPU. However, I've googled until I'm blue in the face, and can't seem to see a way -- either through CLI or API -- to get that info. "nova limits --tenant <foo>" SEEMS like it should... except (at least on my Juno cloud), the "used" column is either full of zeros or dashes. Clearly, if it's in the UI, it's possible... somehow. But it seemed like it might be easier to ask the list than go down the rabbit hole of tcp captures.
You might be looking for the os-simple-tenant-usages API [1]. That is per-tenant but the response has per-server results in it. If you were on something newer (Ocata+) you could use [2] to get per-instance resource allocations for VCPU and MEMORY_MB. I'm not sure what the UI is doing, but it might simply be getting the flavor used for each VM and showing the details about that flavor, which you could also get (more reliably) with the server details themselves starting in microversion 2.47 (added in Pike). [1] https://developer.openstack.org/api-ref/compute/?expanded=show-usage-statist... [2] https://developer.openstack.org/api-ref/placement/?expanded=list-allocations... -- Thanks, Matt
participants (3)
-
Ken D'Ambrosio
-
Matt Riedemann
-
Sean McGinnis