1. when replacing instances (we do that when updating a FAILED server resources), we call detach_interface[1] when preparing for replacement, which seems to delete the internal port unless preserve_on_delete is True[2].
2. When deleting instances we explicitly delete[3] the ports from neutron, which would delete them irrespective of the flag.
However, We do delete the instances after the replacement is successful which would try delete the old port too.
To me it looks like the implementation in heat assumed that detach_interface would not delete the port, as we would need to attach that back to the old instance when doing a rollback.
We can delete the ports explicitly after calling detach_interface but that would break the rollback use case which is anyway broken atm:D
1. when replacing instances (we do that when updating a FAILED server resources), we call detach_interface[1] when preparing for replacement, which seems to delete the internal port unless preserve_on_delete is True[2].
2. When deleting instances we explicitly delete[3] the ports from neutron, which would delete them irrespective of the flag.
However, We do delete the instances after the replacement is successful which would try delete the old port too.
To me it looks like the implementation in heat assumed that detach_interface would not delete the port, as we would need to attach that back to the old instance when doing a rollback.
We can delete the ports explicitly after calling detach_interface but that would break the rollback use case which is anyway broken atm:D
[1] https:/ /github. com/openstack/ heat/blob/ master/ heat/engine/ resources/ openstack/ nova/server_ network_ mixin.py# L547
[2] https:/ /github. com/openstack/ nova/blob/ master/ nova/network/ neutronv2/ api.py# L2317
[3] https:/ /github. com/openstack/ heat/blob/ master/ heat/engine/ resources/ openstack/ nova/server_ network_ mixin.py# L157