Nova network fixed IP allocation/deletion logic

Asked by Ryu Ishimoto

Hi,

I noticed that when deleting a network recrod, the fixed_ip records associate with the network is not deleted. Instead, 'network_delete_safe' method simply sets the network_id of the fixed IPs to NULL. Is this the intended behavior? Since the network record is deleted from the DB, why not do the same for the fixed ips? Or at least mark the 'deleted' flag to true? The reason why I'm wondering about this is that during the fixed IP assignment process, 'fixed_ip_associate_pool' method fetches an available IP that has no network association(network_id = NULL), which means that a VIF could get an IP address that belongs to a deleted network, potentially outside the IP range specified for the existing networks. If this is done by design, it would be great if someone can explain it to me why it has to be this way. I might just be missing something here. If not, I can submit a bug report for this. A sensible solution could be to just delete these fixed IPs from the DB when deleting a network. What do you think?

Cheers,
Ryu

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vish Ishaya (vishvananda) said :
#1

No this is actually a bug. The ips should be deleted too. Check to make sure there isn't a bug on it already. In any case, would love a merge prop to fix this.

Vish

On Nov 29, 2011, at 9:15 PM, Ryu Ishimoto wrote:

> New question #180461 on OpenStack Compute (nova):
> https://answers.launchpad.net/nova/+question/180461
>
> Hi,
>
> I noticed that when deleting a network recrod, the fixed_ip records associate with the network is not deleted. Instead, 'network_delete_safe' method simply sets the network_id of the fixed IPs to NULL. Is this the intended behavior? Since the network record is deleted from the DB, why not do the same for the fixed ips? Or at least mark the 'deleted' flag to true? The reason why I'm wondering about this is that during the fixed IP assignment process, 'fixed_ip_associate_pool' method fetches an available IP that has no network association(network_id = NULL), which means that a VIF could get an IP address that belongs to a deleted network, potentially outside the IP range specified for the existing networks. If this is done by design, it would be great if someone can explain it to me why it has to be this way. I might just be missing something here. If not, I can submit a bug report for this. A sensible solution could be to just delete these fixed IPs from the DB when deleting a network. What do you think?
>
> Cheers,
> Ryu
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Can you help with this problem?

Provide an answer of your own, or ask Ryu Ishimoto for more information if necessary.

To post a message you must log in.