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

Retrieve Tags #29

Open
adelbot opened this issue May 4, 2018 · 17 comments
Open

Retrieve Tags #29

adelbot opened this issue May 4, 2018 · 17 comments

Comments

@adelbot
Copy link

adelbot commented May 4, 2018

Hi,

Is it possible to retrieve tags on virtualmachine ?

@cblomart
Copy link
Owner

cblomart commented May 5, 2018

Tags should be returned to influx dd.

@adelbot
Copy link
Author

adelbot commented May 5, 2018 via email

@cblomart
Copy link
Owner

cblomart commented Jul 9, 2018

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
Copy link
Author

adelbot commented Jul 9, 2018 via email

@cblomart
Copy link
Owner

cblomart commented Jul 9, 2018

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
Copy link
Author

adelbot commented Jul 9, 2018 via email

@cblomart
Copy link
Owner

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

@adelbot
Copy link
Author

adelbot commented Jul 10, 2018 via email

@adelbot
Copy link
Author

adelbot commented Jul 11, 2018

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 cblomart reopened this Jul 11, 2018
@cblomart
Copy link
Owner

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
Copy link

MnrGreg commented Dec 18, 2018

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

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

@MnrGreg
Copy link

MnrGreg commented Jan 28, 2019

@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
Copy link
Owner

cblomart commented Jan 28, 2019 via email

@MnrGreg
Copy link

MnrGreg commented Feb 28, 2019

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
Copy link
Owner

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
Copy link

MnrGreg commented Feb 28, 2019

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

@hamelg
Copy link

hamelg commented Jun 12, 2019

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

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

No branches or pull requests

4 participants