After spending a good few days breaking my head open against my desk, I figured I'd throw this up here on StackOverflow since I've yet to see the question properly answered.
This is a multi-part question. Once I know the concepts behind it, I should have no problem throwing it together.
1A) How do you get the InstanceNames associated with Hyper-V Virtual Machines so you can do your initial lookup on the Performance Counters? I've managed a way to do it using a JScript file that's called by PHP which is then called by a VB.Net app, but that seems stupidly unreliable and inefficient.
1B) Also, some servers have multiple virtual network interface cards associated with them. How can I differentiate between the two? Each VM comes with a "private" and "public" network associated with it. The easiest way I can think of would be to make one Synthetic and one Emulated, but that seems too hack-ish for me and could potentially be unreliable.
2) Once you have the InstanceNames, What would be the best way to iterate through them so I could receive the amount of bandwidth they are using on a bytes-per-second basis for incoming/outgoing bandwidth? I know the performance counters exist, I'm just a bit lost.
3) I'd like to save the data in a way that I can use it with RRDTool. It can be in a flat file that I can call from remote, however.
Quick notes -- I've got VS2010 Premium and .Net 4 at my disposal. The Hyper-V server is running Server 2008 Datacenter R2, and I've got SCVMM on the Active Directory network.
I understand the concepts behind what I'm trying to do, but Microsoft makes things so overcomplicated and convoluted to work with at times.
I've been able to successfully get one set of counters at a time (Bandwidth in/out per server), but that's it, really.
Any help is much appreciated.