For resource 'Instance', Fn::GetAtt instance "PrivateDnsName" returns IP address

Bug #1245545 reported by Tihomir Trifonov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Confirmed
Wishlist
Unassigned

Bug Description

in resources/instance.py we have:

         if name == 'AvailabilityZone':
             res = self.properties['AvailabilityZone']
        elif name in ['PublicIp', 'PrivateIp', 'PublicDnsName',
                      'PrivateDnsName']:
             res = self._ipaddress()

I think

    self.physical_resource_name()

is much closer to 'PublicDnsName' and 'PrivateDnsName' than self._ipaddress().

Maybe this is left as a ToDo, but anyway self.physical_resource_name() works pretty well for Instance resources and returns actual hostname.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi Tihomir. This is quite deployment specific actually. In some nova configurations the instance name will not at all reflect the actualy reachable hostname of the server. The ip address is far more likely to provide an externally reachable address than physical resource name.

At best, this behavior could be a configuration option for clouds that have a nova configuration that does actually do server name DNS records. But I have yet to see an OpenStack cloud that works this way.

Changed in heat:
importance: Undecided → Medium
importance: Medium → Wishlist
status: New → Triaged
Changed in heat:
assignee: nobody → Sergey Slipushenko (sslypushenko)
Changed in heat:
status: Triaged → In Progress
Revision history for this message
Sergey Slipushenko (sslypushenko) wrote :

If instance name doesn't reflect the actual hostname of the server, it is not a reason to return ip address instead of dns server name. When nova will able to do DNS records then we should implement this mechanism.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/60260

Revision history for this message
Randall Burt (randall-burt) wrote :

I think the IP address does make more sense in this case. The resource name for an instance can be user-supplied and can have nothing at all to do with accessing the instance. IMO, IP address is a much more reasonable return value given that we can't currently exactly mimic the CFN implementation or intent.

Revision history for this message
Sergey Slipushenko (sslypushenko) wrote :

Do you think that it is not a bug? So, why this bug wasn't closed before?

Revision history for this message
andersonvom (andersonvom) wrote :

I agree with Randall that the physical_resource_name is not the best option to be displayed there.

Ideally, it should return the correct DNS name, if one exists, otherwise the IP address, but not the IP address at all times.

Changed in heat:
assignee: Sergey Slipushenko (sslypushenko) → nobody
status: In Progress → Confirmed
Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.