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

    https://github.com/apache/brooklyn-server/pull/355#discussion_r81509871
  
    --- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
 ---
    @@ -1956,6 +1955,33 @@ protected LoginCredentials createUser(ComputeService 
computeService, NodeMetadat
             return userCreation.createdUserCredentials;
         }
     
    +    protected HostAndPort resolveManagementHostAndPort(ComputeService 
computeService, NodeMetadata node, String vmHostname, Optional<HostAndPort> 
hostAndPortOverride, ConfigBag config) {
    +        return resolveManagementHostAndPort(computeService, node, 
vmHostname, hostAndPortOverride, config, false);
    +    }
    +
    +    protected HostAndPort resolveManagementHostAndPort(ComputeService 
computeService, NodeMetadata node, String vmHostname, Optional<HostAndPort> 
hostAndPortOverride, ConfigBag config, boolean 
useOnlyVmHostNameAndHostAndPortOverride) {
    +        String pollForFirstReachable = 
config.get(POLL_FOR_FIRST_REACHABLE_ADDRESS);
    +        boolean pollForFirstReachableEnabled = 
!useOnlyVmHostNameAndHostAndPortOverride && 
!"false".equalsIgnoreCase(pollForFirstReachable);
    +
    +        String managementAddress = hostAndPortOverride.isPresent() ? 
hostAndPortOverride.get().getHostText() :
    +                (pollForFirstReachableEnabled ? 
getFirstReachableAddress(node, config) : vmHostname);
    +        int managementPort = hostAndPortOverride.isPresent() ? 
hostAndPortOverride.get().getPort() : node.getLoginPort();
    +        try {
    +            Networking.getInetAddressWithFixedName(managementAddress);
    --- End diff --
    
    This was always used before.
    
    Networking.getInetAddressWithFixedName is expecting two kinds of arguments:
    - IPv4 or IPv6 address - when this is used it doesn't resolve the address 
or trying to reach it. It just checks whether it is formatted correctly.
    - hostname - it tries to `private static InetAddress[] getAllByName0 
(String host, InetAddress reqAddr, boolean check)` which uses 
`InetAddress.lookupAllHostAddr` which may do some resolving


---
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