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

add option to libvirtkvm collector to build instance name based on openstack metadata #481

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

biancalana
Copy link

add option to libvirtkvm collector to build instance name based on openstack metadata, this is useful to group VMs tenant metrics on Openstack.

@@ -28,10 +28,10 @@ specific to the compute node | bool
uri | qemu:///system | The libvirt connection URI. By default it's<br>
'qemu:///system'. One decent option is<br>
'qemu+unix:///system?socket=/var/run/libvirt/libvit-sock-ro'. | str
format_name_using_metadata | False | Use openstack metadata to generate instance name, its useful when do you and to group VMs metrics by project | string, possible options: ${owner_project},${owner_project_uuid},${instance},${instance_uuid}
Copy link
Member

Choose a reason for hiding this comment

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

This is not in the config option list

@shortdudey123
Copy link
Member

Can you update the libvirtkvm collector tests to accommodate your change?

@@ -21,6 +22,47 @@ def setUp(self):
def test_import(self):
self.assertTrue(LibvirtKVMCollector)

@patch('libvirt')
Copy link
Author

Choose a reason for hiding this comment

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

Someone can help here ? I need to mock the entire libvirt module...

I'm not a python guy and had never written this kind of tests 💥

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

Successfully merging this pull request may close these issues.

3 participants