cblomart / vsphere-graphite

VMware vSphere stats to storage backends as graphite, influxdb, elasticsearch or prometheus
MIT License
62 stars 21 forks source link

Retrieve Tags #29

Open adelbot opened 6 years ago

adelbot commented 6 years ago

Hi,

Is it possible to retrieve tags on virtualmachine ?

cblomart commented 6 years ago

Tags should be returned to influx dd.

adelbot commented 6 years ago

So, i have a problem because no tags even with influxdb

how can i verify in the code ?

cblomart commented 6 years ago

I updated tags management yesterday. It is not yet released but should be testable in a manual build or via docker (tag = short commit number)

adelbot commented 6 years ago

Hi,

Good News

Is it a special configuration to retrieve tags ?

De : Blomart Cédric [mailto:notifications@github.com] Envoyé : lundi 9 juillet 2018 16:46 À : cblomart/vsphere-graphite vsphere-graphite@noreply.github.com Cc : DELBOT Alain alain.delbot@laposte.fr; Author author@noreply.github.com Objet : Re: [cblomart/vsphere-graphite] Retrieve Tags (#29)

I updated tags management yesterday. It is not yet released but should be testable in a manual build or via docker (tag = short commit number)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/cblomart/vsphere-graphite/issues/29#issuecomment-403504608, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5FTEf373x476vGxiqhkXwW52aZpicwks5uE2zDgaJpZM4TyQw4.

Post-scriptum La Poste

Ce message est confidentiel. Sous reserve de tout accord conclu par ecrit entre vous et La Poste, son contenu ne represente en aucun cas un engagement de la part de La Poste. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur.

cblomart commented 6 years ago

There is no special configuration to retrieve tags. Tags were simply not properly added to the collected metrics. As indicated it should be resolved in the last commits.

adelbot commented 6 years ago

i test with the v0.6 tag.

Is it ok ?


From: Blomart Cédric notifications@github.com Sent: Monday, July 9, 2018 8:17:46 PM To: cblomart/vsphere-graphite Cc: DELBOT Alain; Author Subject: Re: [cblomart/vsphere-graphite] Retrieve Tags (#29)

There is no special configuration to retrieve tags. Tags were simply not properly added to the collected metrics. As indicated it should be resolved in the last commits.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/cblomart/vsphere-graphite/issues/29#issuecomment-403572569, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5FTNsHkFsYi_97T6FDu5l85PGYqH50ks5uE55KgaJpZM4TyQw4.

Post-scriptum La Poste

Ce message est confidentiel. Sous reserve de tout accord conclu par ecrit entre vous et La Poste, son contenu ne represente en aucun cas un engagement de la part de La Poste. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur.

cblomart commented 6 years ago

i made a release v0.6a that corrects tags retrieval.

adelbot commented 6 years ago

Great

I’ll test tomorrow and feed back

Ps : Vive la France Cédric


From: Blomart Cédric notifications@github.com Sent: Tuesday, July 10, 2018 7:11:34 PM To: cblomart/vsphere-graphite Cc: DELBOT Alain; Author Subject: Re: [cblomart/vsphere-graphite] Retrieve Tags (#29)

i made a release v0.6a that corrects tags retrieval.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/cblomart/vsphere-graphite/issues/29#issuecomment-403898007, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF5FTPSaM5azKLZK_F84G8RkxJmC8zW9ks5uFOBGgaJpZM4TyQw4.

Post-scriptum La Poste

Ce message est confidentiel. Sous reserve de tout accord conclu par ecrit entre vous et La Poste, son contenu ne represente en aucun cas un engagement de la part de La Poste. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur.

adelbot commented 6 years ago

It does not seem to work. Here is an example of the information returned: mem_consumed_maximum,cluster=XME-CM-SCR-0001,datastore=XM01,folder=MGMT/W8C,host=wpex0001,memorysizemb=4096,name=wqna0005,network=tn-management1|ap-intranet-dev-w8c|epg-web,numcpu=2,type=virtualmachine,vcenter=weyv0001 Value=4194304i 1531288181 mem_active_average,cluster=XME-CM-SCR-0001,datastore=XM01,folder=MGMT/W8C,host=wpex0001,memorysizemb=4096,name=wqna0005,network=tn-management1|ap-intranet-dev-w8c|epg-web,numcpu=2,type=virtualmachine,vcenter=weyv0001 Value=335544i 1531288181 mem_active_maximum,cluster=XME-CM-SCR-0001,datastore=XM01,folder=MGMT/W8C,host=wpex0001,memorysizemb=4096,name=wqna0005,network=tn-management1|ap-intranet-dev-w8c|epg-web,numcpu=2,type=virtualmachine,vcenter=weyv0001 Value=335544i 1531288181 mem_vmmemctl_average,cluster=XME-CM-SCR-0001,datastore=XM01,folder=MGMT/W8C,host=wpex0001,memorysizemb=4096,name=wqna0005,network=tn-management1|ap-intranet-dev-w8c|epg-web,numcpu=2,type=virtualmachine,vcenter=weyv0001 Value=0i 1531288181 mem_vmmemctl_maximum,cluster=XME-CM-SCR-0001,datastore=XM01,folder=MGMT/W8C,host=wpex0001,memorysizemb=4096,name=wqna0005,network=tn-management1|ap-intranet-dev-w8c|epg-web,numcpu=2,type=virtualmachine,vcenter=weyv0001 Value=0i 1531288181

All virtualmachine have tags and category. govc_linux_amd64 tags.category.ls => StorageType CCX Env ComputeType Owner NetworkZone AntiAffinityGroupID StorageTemperature

govc_linux_amd64 tags.association.ls -json /XP/vm/MGMT/WAA/WEYA0130 => [ { "Name": "shared", "TagID": "urn:vmomi:InventoryServiceTag:e9b62a08-ef48-4355-93e5-6f536ae2e097:GLOBAL" }, { "Name": "Production", "TagID": "urn:vmomi:InventoryServiceTag:4a30396a-28ed-463e-b735-ad9d3d7367f3:GLOBAL" }, { "Name": "WAA", "TagID": "urn:vmomi:InventoryServiceTag:32d3660a-170b-440d-b21c-7bf8d557464a:GLOBAL" }, { "Name": "PVGZ373", "TagID": "urn:vmomi:InventoryServiceTag:0c85106a-7886-4c80-bf8c-421ff5d7c5fd:GLOBAL" }, { "Name": "resilient", "TagID": "urn:vmomi:InventoryServiceTag:611adac5-c7a4-4c82-b01e-906027982d83:GLOBAL" } ]

Can I do something to help you?

cblomart commented 6 years ago

I collect tags found in the webservice sdk. These looks different than the tags shown in the vsphere interface.

After looking up, it seems that these are not available by webservice but with rest services. This does mean to handle a second type of client to vsphere and may require a bit more time to implement.

MnrGreg commented 5 years ago

govmomi 0.19.0 has been updated with better rest tags support. @cblomart Perhaps this will make things easier?

https://github.com/vmware/govmomi/pull/1206 https://github.com/vmware/govmomi/blob/v0.19.0/govc/CHANGELOG.md

MnrGreg commented 5 years ago

@cblomart what are your thoughts about incorporating this other rest client to return the tags? It would be great to be able to graph a running cost for certain VM’s based on their tags.

You’re already collecting the numcpu, memory and disk capacity. One then need only determine ones cost per core, 1GB RAM & 1GB disk to be able to graph some cost show back calculations.

cblomart commented 5 years ago

Different things to look at... there is already the tags. I were looking at custom attributes and there are also the tags of the inventory...

Envoyé de mon iPhone

Le 28 janv. 2019 à 07:59, Gregory May notifications@github.com a écrit :

@cblomart what are your thoughts about incorporating this other rest client to return the tags? It would be great to be able to graph a running cost for certain VM’s based on their tags.

You’re already collecting the numcpu, memory and disk capacity. One then need only determine ones cost per core, 1GB RAM & 1GB disk to be able to graph some cost show back calculations.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

MnrGreg commented 5 years ago

I think the Tags of the inventory are different from the vSphere Tag Categories and associated Tag values available through the REST client. From what I’ve understood the custom attributes is being depreciated in place of vSphere Tags.

Having these tags would add another dimension to the reports and bring a lot of value.

cblomart commented 5 years ago

I will merge #60 in this issue as so we have an argument in the issue: tags vs. custom attributes.

As pointed out metric beat (elastic) support custom attributes and not tag... But effectively VMware has articles on how to convert custom attributes to tags

I would like to close some of the other issues before sorting this out (clean branches and base the code on latest changes)

MnrGreg commented 5 years ago

Hi, yes, metricbeat is limited to Custom Attributes. vSphere Tags is what is really needed.

hamelg commented 5 years ago

vsphere tags and custom attributes (both) are very useful. They could be exposed with graphite tags.

Example :

My vm myvm shows these attached tags and the following custom attributes

Category Assigned   Tags
Owner               XHS567
Env                 Production
CCX                 W2_

Custom Attributes    Values
Zone                 D1
ComputeType          Shared

In the vsphere-graphite.json

...
"Properties": [ 
    { "vsphere-tags": [ "env", "ccx" ] } , 
    { "vsphere-attrs": [ "all" ] },
 ],
...
  "Backend": {
    "Type": "graphite",
    "UseTags": true ,
    ...
  },
...

With UseTags: false vsphere.myhost.virtualmachine.myvm.cpu.used.summation 331 1558090772

With UseTags: true vsphere.cpu.used.summation;host=myhost;virtualmachine=myvm;env=Production;ccx=W2_;zone=D1;computetype=Shared 331 1558090772

So, vsphere-tags and/or vsphere-attrs properties should be implemented in other backends ...