Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/355#discussion_r81297696
  
    --- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
 ---
    @@ -770,17 +771,20 @@ protected MachineLocation obtainOnce(ConfigBag setup) 
throws NoMachinesAvailable
                     sshHostAndPortOverride = Optional.absent();
                 }
     
    -            LoginCredentials initialCredentials = node.getCredentials();
    +            String managementAddress = sshHostAndPortOverride.isPresent() 
? sshHostAndPortOverride.get().getHostText() : getFirstReachableAddress(node, 
setup);
    --- End diff --
    
    Unfortunately this code is very subtle and delicate. There are so many 
permutations of different behaviour in different clouds, different OS distros, 
and different networking configurations.
    
    Therefore be very cautious about changing it! There are a bunch of live 
tests that are useful (but very slow). But those are not sufficient, as 
downstream projects like clocker and other advanced-networking test cases (e.g. 
with DNAT etc) will require specific behaviour.
    
    Long term, I'd love to rewrite the entire class so that it is properly 
unit-testable. But that is a huge undertaking, so we haven't scheduled the time 
for that.
    
    For example, you can't call `getFirstReachableAddress()` here. There is a 
config key (see `waitForWInRmable` and `waitForSsable` below) that we also use 
to turn off all attempts to reach the VM's IPs. This is used, for example, in 
clocker when provisioning a container that is not ssh'able and whose IP is 
entirely private - I believe that no IP reported by docker for that container 
would be reachable by Brooklyn.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to