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

Error when get metrics Hypervisor #8

Open
datnt53 opened this issue Oct 25, 2018 · 2 comments
Open

Error when get metrics Hypervisor #8

datnt53 opened this issue Oct 25, 2018 · 2 comments

Comments

@datnt53
Copy link

datnt53 commented Oct 25, 2018

2018-10-25 08:56:22,440:ERROR:'HypervisorStats' object has no attribute 'extra_config'
2018-10-25 08:56:22,441:ERROR:failed to get data for cache key hypervisor_stats

                free = ((int(self.extra_config['cpu_ratio'] *
                             m_vcpus)) -
                        m_vcpus_used)

nova_aggregates[agg]['metrics']['free_vcpus'] += free

@d819r197
Copy link

d819r197 commented Mar 4, 2019

To fix this issue you will need to change the variable extra_config['cpu_ratio'] to self.cpu_overcommit_ratio
We can see that a similar code is being called with correct variables;
ree = (int(self.cpu_overcommit_ratio * m_vcpus)) - m_vcpus_used cache_stats.append({ 'stat_name': 'free_vcpus', 'stat_value': free, 'host': host, })
So if we match that, and produce:
for agg in nova_aggregates.keys(): agg_hosts = nova_aggregates[agg]['hosts'] if host in agg_hosts: free = ((int(self.cpu_overcommit_ratio * m_vcpus)) - m_vcpus_used) nova_aggregates[agg]['metrics']['free_vcpus'] += free
We find that the code is working properly. I will be submitting a patch for this to att-comdev, but until then this is the fix.

@datnt53
Copy link
Author

datnt53 commented Mar 6, 2019

Thank a lot!

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

2 participants