[openstack-dev] [Heat][TripleO] - Getting attributes of openstack resources not created by the stack for TripleO NetworkConfig.

Zane Bitter zbitter at redhat.com
Tue Apr 24 19:39:02 UTC 2018


On 23/04/18 14:09, Dan Sneddon wrote:
> 
> Yes, the port is currently created as part of the Ironic server 
> resource. We would have more flexibility if this were a separate Neutron 
> port, but we need to be able to support upgrades. This would require the 
> ability in Heat to detach the implicit port from the Ironic resource, 
> and attach a Neutron port resource with the same IP to a node without 
> rebuilding the entire node. This isn't currently possible.

I believe it's possible using a two-step migration. First create an 
OS::Neutron::Port resource with external_id as the current port ID. Then 
use get_resource to pass the ID of the Port explicitly to the Server in 
its network config. On update, Heat will recognise this as an unchanged 
config thanks to the fixes that Harald made in Queens. Second, do 
another update removing the external_id to allow Heat to manage this 
port (or don't, I guess, since Nova will clean up the port when the 
server is deleted regardless).

This process is pretty horrible though, and more suited to a manual 
fix-up than something like TripleO.

> I can see another use case for this Heat functionality, which is that I 
> would like to be able to generate a report using Heat that lists all the 
> ports in use in the entire deployment. This would be generated 
> post-deployment, and could be used to populate an external DNS server, 
> or simply to report on which IPs belong to which nodes.

You can get IPs from the servers already. (Also, you should use 
Designate resources to populate your external DNS server ;)
The issue here AIUI is that you can't get info from the subnet, like the 
CIDR, and in fact you may not even know the subnet because of the 
magical way Neutron will implicitly allocate stuff for you.

cheers,
Zane.



More information about the OpenStack-dev mailing list