vsphere-graphite icon indicating copy to clipboard operation
vsphere-graphite copied to clipboard

Retrieve Tags

Open adelbot opened this issue 6 years ago • 17 comments

Hi,

Is it possible to retrieve tags on virtualmachine ?

adelbot avatar May 04 '18 08:05 adelbot

Tags should be returned to influx dd.

cblomart avatar May 05 '18 15:05 cblomart

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

how can i verify in the code ?

adelbot avatar May 05 '18 15:05 adelbot

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)

cblomart avatar Jul 09 '18 14:07 cblomart

Hi,

Good News

Is it a special configuration to retrieve tags ?

De : Blomart Cédric [mailto:[email protected]] Envoyé : lundi 9 juillet 2018 16:46 À : cblomart/vsphere-graphite [email protected] Cc : DELBOT Alain [email protected]; Author [email protected] 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.

adelbot avatar Jul 09 '18 17:07 adelbot

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.

cblomart avatar Jul 09 '18 18:07 cblomart

i test with the v0.6 tag.

Is it ok ?


From: Blomart Cédric [email protected] 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.

adelbot avatar Jul 09 '18 18:07 adelbot

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

cblomart avatar Jul 10 '18 17:07 cblomart

Great

I’ll test tomorrow and feed back

Ps : Vive la France Cédric


From: Blomart Cédric [email protected] 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 avatar Jul 10 '18 17:07 adelbot

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?

adelbot avatar Jul 11 '18 06:07 adelbot

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.

cblomart avatar Jul 11 '18 08:07 cblomart

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 avatar Dec 18 '18 20:12 MnrGreg

@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.

MnrGreg avatar Jan 28 '19 06:01 MnrGreg

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 [email protected] 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.

cblomart avatar Jan 28 '19 13:01 cblomart

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.

MnrGreg avatar Feb 28 '19 06:02 MnrGreg

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)

cblomart avatar Feb 28 '19 15:02 cblomart

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

MnrGreg avatar Feb 28 '19 18:02 MnrGreg

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 ...

hamelg avatar Jun 12 '19 14:06 hamelg