Hi, Steve. You probably missed this chat a couple months ago. Hopefully, at least the context is helpful:
https://gist.github.com/3202856 -A On Fri, Oct 5, 2012 at 3:56 AM, Steve Loughran <ste...@hortonworks.com> wrote: > On 4 October 2012 22:23, Alex Heneveld <alex.henev...@cloudsoftcorp.com>wrote: > >> >> Steve- >> >> He he I have scars from all the times I've banged my head against this. >> I've come to the conclusion you should pretty much always use: >> >> cluster.getInstanceMatching(**RolePredicates.role("cmserver"** >> )).getPublicHostname() >> >> which is the *public* hostname admittedly -- but should normally resolve >> within a private subnet to the private IP if the public IP is not >> accessible. > > > it does. but net traffic to it gets billed at the external rate on many > infrastructures > > >> In a good network anyway. Failing that you should just be able to use >> the private IP. If you're feeling ambitious, fix /etc/hosts / DNS for the >> boxes you manage so that public hostnames do work everywhere in your >> universe. > > > oh, that's both devious and wrong. I'll think about using it though. > > >> Otherwise you end up hacking different things for different target clouds. >> > > do you have those per-target hacks anywhere? a whirr-contrib module perhaps? > > >> >> I think private hostname is a nebulous concept ... good that >> Instance.getPrivateHostname is deprecated. (Private to whom? -- localhost >> is quite a reliable private hostname but probably not what you are after!) >> >> So can you somehow use public hostname or private IP ? >> > > I was thinking maybe I could run something on one of the hosts I bring up > to do the mapping for me -give it the list of IPs, get back the locally > rDNS'd list. I don't see anything in whirr right now, and the way > statements get executed as async batches, it maybe tricky. I could imagine > a new statement to do that. > > for now I'm just going to add an extra property for the domain, suffix that > to the (known) hostname -and let the users sort it out