The trouble with EnvironProvider.InstanceId()
Jeroen Vermeulen
jtv at xs4all.nl
Fri Mar 15 03:23:30 UTC 2013
Hi all,
There's this new method on the EnvironProvider interface: InstanceId().
It's meant to return the InstanceId of the machine it's being executed on.
This is problematic for us. In order to know the instance id, we need
to know what MAAS we're talking to. The Environ would know that, but
definitely not the EnvironProvider. The EC2 provider does not have this
problem because there, the address of the meta-data service is
hard-coded as a global constant.
Ian suggests that with a bit of refactoring, perhaps the call to
InstanceId() could be delayed, so that it could live in Environ instead
of EnvironProvider. Would that be a possibility?
Or does anyone have any other suggestions? One thing we thought of was
to look in the machine's cloudinit config and reverse-engineer the URL
for the metadata API from the file URLs included there. But it's not
very robust, clean, or testable.
Jeroen
More information about the Juju-dev
mailing list