It would be great if there was a way to retrieve the generated hostname for an instance (i.e. the content of the hostname column of the instances table), preferably in both the EC2 and the openstack API.
I guess for the EC2 api, we could change:
privateDnsName to have the hostname instead of fixed_ip since the IPs are available anyway.
For the openstack api, I think the following would be the cleanest solution:
diff --git a/nova/api/openstack/v2/schemas/v1.1/server.rng b/nova/api/openstack/v2/schemas/v1.1/server.rng
index 2e86ccf..b3d0a7d 100644
--- a/nova/api/openstack/v2/schemas/v1.1/server.rng
+++ b/nova/api/openstack/v2/schemas/v1.1/server.rng
@@ -7,6 +7,7 @@
<attribute name="updated"> <text/> </attribute>
<attribute name="created"> <text/> </attribute>
<attribute name="hostId"> <text/> </attribute>
+ <attribute name="hostname"> <text/> </attribute>
<attribute name="accessIPv4"> <text/> </attribute>
<attribute name="accessIPv6"> <text/> </attribute>
<attribute name="status"> <text/> </attribute>
Reviewed: https:/ /review. openstack. org/1916 github. com/openstack/ nova/commit/ 88acbe869a22075 306999b095ba87a 4069a3beac
Committed: http://
Submitter: Jenkins
Branch: master
status fixcommitted
done
commit 88acbe869a22075 306999b095ba87a 4069a3beac
Author: Jimmy Bergman <email address hidden>
Date: Mon Nov 28 12:33:58 2011 +0100
Fix for EC2 API part of bug 897164
Change-Id: I96344eaccd2f42 b70223b3c155a47 93ab00d09d5