diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java index 4d7fba92a1..c1b07dd69a 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java @@ -19,7 +19,6 @@ package org.jclouds.openstack.nova.v2_0.compute.functions; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_RUNNING; - import java.util.Collections; import java.util.List; import java.util.Set; @@ -87,6 +86,7 @@ public class AllocateAndAddFloatingIpToNode implements logger.debug(">> adding floatingIp(%s) to node(%s)", ip.get().getIp(), node.getId()); floatingIpApi.addToServer(ip.get().getIp(), node.getProviderId()); + input.get().getNodeMetadata().set(NodeMetadataBuilder.fromNodeMetadata(node).publicAddresses(ImmutableSet.of(ip.get().getIp())).build()); floatingIpCache.invalidate(RegionAndId.fromSlashEncoded(node.getId())); return input.get().getNodeMetadata(); @@ -100,7 +100,7 @@ public class AllocateAndAddFloatingIpToNode implements * @param nodeID optional id of the Node we are trying to allocate a FloatingIP for. Used here only for logging purposes * @return Optional */ - private Optional allocateFloatingIPForNode(FloatingIPApi floatingIpApi, Optional> poolNames, String nodeID) { + private synchronized Optional allocateFloatingIPForNode(FloatingIPApi floatingIpApi, Optional> poolNames, String nodeID) { FloatingIP ip = null;