diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadata.java b/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadata.java index f3797849cd..acb16fe549 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadata.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadata.java @@ -50,6 +50,7 @@ import org.jclouds.ec2.domain.InstanceState; import org.jclouds.ec2.domain.RootDeviceType; import org.jclouds.ec2.domain.RunningInstance; import org.jclouds.logging.Logger; +import org.jclouds.util.InetAddresses2; import org.jclouds.util.InetAddresses2.IsPrivateIPAddress; import com.google.common.annotations.VisibleForTesting; @@ -122,7 +123,8 @@ public class RunningInstanceToNodeMetadata implements Function addressesBuilder = ImmutableSet.builder(); if (Strings.emptyToNull(instance.getIpAddress()) != null) addressesBuilder.add(instance.getIpAddress()); - //Set ipAddress to be + //Add dnsName (if available) to addresses, when the IPAddress is null + // happens on Eucalyptus sometimes. else if(Strings.emptyToNull(instance.getDnsName()) != null) addressesBuilder.add(instance.getDnsName()); if (Strings.emptyToNull(instance.getPrivateIpAddress()) != null)