#luns in qtrees
1 messages · Page 1 of 1 (latest)
@inner gulch lun.yaml would be handling the cases where luns were created within qtree. If it's within qtree then qtree info will be available, else the volume info available where it's resides. attaching one screenshot of one of the local cluster, where only few luns were belongs to qtree not all.
Could you share some more detail regarding the lun as 4th element and/or 1st element which you would be expecting ?
in lun.yaml, it says:
# path is something like "/vol/vol_georg_fcp401/lun401"
# we only want lun name, which is 4th element
split:
- path / ,,,lun
and the LUN page is using the qtree name as the lun name, even though we have a multiple luns in the same qtree, so the paths would look like:
/vol/vol_georg_fcp401/lun401/lun-1
/vol/vol_georg_fcp401/lun401/lun-2
/vol/vol_georg_fcp401/lun401/lun-3
but we just see them as
svmname/vol_georg_fcp401/lun401
hi @inner gulch we may need to create a plugin to handle this case, in the meantime, if you amenable, you could try this. Comment out or remove the split: and add this instead then bounce the poller.
split_regex:
- path ^\/\w+\/\w+\/((?:\w|-)+)$ lun
- path ^\/\w+\/\w+\/\w+\/((?:\w|-)+)$ lun
It doesn't like the format:
WRN labelagent/parse_rules.go:251 > (split_regex) rule has invalid format [path ^/\w+/\w+/((?:\w|-)+)$ lun]
WRN labelagent/parse_rules.go:251 > (split_regex) rule has invalid format [path ^/\w+/\w+/\w+/((?:\w|-)+)$ lun]
it worked locally so probably a copy/paste error introduced by Discord. What version of Harvest are you running?
harvest-23.11.0-1_linux_amd64 in containers
hrm. quotes need to be on the string ?
or backticks?
cool, can you screenshot your snippet - the screenshot I pasted above works. Yes the backticks are required
i think mine matches now. now for the waiting game to see if it shows up.
Looks like i'm getting no luns at all now. Is there an easy way to directly query prometheus?
yes, see if you can hit port 9090 in a browser. Alternatively you can curl the poller directly too
if you want to curl the poller directly curl -s localhost:$port/metrics | grep lun replace $port with your poller's port
docker ps -a should show your the poller's port if you exposed it
yeah, no sign of the new named luns.
Did you end up curling or using Prometheus? Any errors in the Harvest logs? I haven't found a local cluster with luns in qtrees to test with so I created a unit test with your example "/vol/vol_georg_fcp401/lun401/lun-1" and the split_regex correctly creates the label lun=lun-1
using prometheus. i just flipped to using 'lun_size' as a query, and the luns are there, but missing a lun field.
I assume you have a mix of luns? some in qtrees and some not? I did try the template changes I gave you on a cluster with normal luns and they are still collected fine
on this lab host, it's just a small set of luns in qtrees.
ah ok
and i haven't figured out where to find the harvest logs
and they have (well had) this shape? /vol/vol_georg_fcp401/lun401/lun-1
docker logs poller-name if you're using containers
there's in a format like:
/vol/foo_luns1/bar-lab/host1-1
/vol/foo_luns1/bar-lab/host1-2
/vol/foo_luns2/bar-lab/host2-1
/vol/foo_luns1/bar-lab/host3-1
ok, yeah, i did figure out those logs. Nothing exciting is coming out of there now that i have the backticks in place
a small victory since no luns either 🙂
oh i see the problem - you know the joke about regexes? The one I gave you does not match /vol/foo_luns1/bar-lab/host1-1 because of the hyphen in the 3rd element. Let me fix that and give you a new one if you want to try
fun fact - the regexes in old harvest also don't expect spaces in qtree names.
- path ^\/(?:\w|-)+\/(?:\w|-)+\/((?:\w|-)+)$ lun
- path ^\/(?:\w|-)+\/(?:\w|-)+\/(?:\w|-)+\/((?:\w|-)+)$ lun
we can totally make spaces work
For those that have not seen it before...
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.
does the new regex work for your luns?
it appears to. i need to apply it to zapiperf as well
nice!
wait a sec. the lun name is the entire path, not just the lun name.
so i've screwed up zapiperf, even though i copied the lines directly from one to the other
missed the second pattern
looks like zapiperf is slightly different since it extracts volume also
testing with
split_regex:
- path `^\/((?:\w|-)+)\/(?:\w|-)+\/((?:\w|-)+)$` volume,lun
- path `^\/((?:\w|-)+)\/(?:\w|-)+\/(?:\w|-)+\/((?:\w|-)+)$` volume,lun
since you are pulling out two vars (volume, lun) I believe you need to capture groups. Let me try on my local cluster.
This should also work for your zapiperf lun.yaml - use split, as long as all luns are in qtrees
lun / ,,,volume,lun
wouldn't it be / ,,volume,,lun ?
yes you're right since it is /vol/vol-name/qtree-name/lun-name
and, yes, there's a capture group in there for the volume.
but i think i did something wrong
it's a nice capture group for "vol".
but
- path ``^\/(?:\w|-)+\/((?:\w|-)+)\/((?:\w|-)+)$`` volume,lun
- path ``^\/(?:\w|-)+\/((?:\w|-)+)\/(?:\w|-)+\/((?:\w|-)+)$`` volume,lun
is not doing what i expected
(ignoring the backtick situation)
yeah im trying that locally with my non-qtree enhanced luns
hmmm if so that looks like a bug. capture group1 should be the volume match and group2 should be the lun match
oh oh right, i see what you mean. Not the capture groups but the input label
so now the dashboards are looking better. Qtrees are dropped, which shouldn't matter with our scheme
excellent!
thanks for the help!
you bet. Have a good weekend!
And if you want to look at the space problem you mentioned earlier we can do that next week
I created a pull request for this bug @ben we'll get it reviewed and checked in https://github.com/NetApp/harvest/pull/2502