Hi! I would like to discuss https://bugs.launchpad.net/nova/+bug/1036672 - Unable to spawn instance after I delete and create same network
Steps to reproduce: 1. Create project and network 2. Spawn instance 3. Delete instance 4. Delete project and network 5. Create same network 6. Create project 7. Spawn instance 8. The instance will not be spawned, you will see that the deleted network was not found in nova-network log This bug reproduces for this reason. When deleting a network, its record is removed from database and its fixed_ips are marked as deleted. During instance spawning, an IP address is chosen. Then fixed_ip_get_by_address is called. It calls model_query passing read_deleted="yes". The deleted fixed ip is chosen and it causes NetworkNotFound. The same error will be during instance deletion while disassociating fixed IP. In folsom, fixed_ip_get_by_address does not pass read_deleted flag anymore, however, its `context` parameter contains read_deleted="yes" when IP is being disassociated. So, NetworkNotFound is raised again. I would like to ask several questions: 1) Is it really necessary to keep deleted fixed IPs in the database? A network cannot be removed until it is not used, so, it should be safe to remove its fixed IPs. 2) How control a code using database context? It could be too tricky and it difficult to predict when its flags, e.g. read_deleted, are set to some values. 3) Who actually uses objects that are marked as deleted in the database? I know only one example - instance types that can be deleted but are still referenced by running instances. Are there other examples? -- Alessio Ababilov Software Engineer Grid Dynamics _______________________________________________ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp