use instance metadata to resolve instance role

Patch proposal for issue #2