terminate instance didn't clean ip information
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Vish Ishaya |
Bug Description
It's a command to terminate instance.
# nova delete <instance-id>
then, compute-api call self.db.
nova/compute/
555 def _delete_
556 """Delete an instance on this host."""
557 self._shutdown_
558 self._cleanup_
559 instance = self.db.
560 self._instance_
561 instance_id,
562 vm_state=
563 task_state=None,
564 terminated_
565
566 self.db.
567
568 usage_info = utils.usage_
569 notifier.
570 'compute.
571 notifier.INFO, usage_info)
finally, instance_destroy() is called at nova/db/
1168 @require_context
1169 def instance_
1170 session = get_session()
1171 with session.begin():
1172 session.
1173 filter_
1174 update({'deleted': True,
1175 'deleted_at': utils.utcnow(),
1176 'updated_at': literal_
1177 session.
1178 filter_
1179 update({'deleted': True,
1180 'deleted_at': utils.utcnow(),
1181 'updated_at': literal_
1182 session.
1183 filter_
1184 update({'deleted': True,
1185 'deleted_at': utils.utcnow(),
1186 'updated_at': literal_
1187 session.
1188 filter_
1189 update({'deleted': True,
1190 'deleted_at': utils.utcnow(),
1191 'updated_at': literal_
But, this update didn't clean or delete any network information of instance.
instance_destroy() update only instances, security_
Because this method didn't update fixed_ips and floating_ips, there is error occured when I allocate all fixed or floating ip address to instance.
this is example)
# nova list
+------
| ID | Name | Status | Networks |
+------
| 1fcc667d-
| a2561d60-
| bbfa18ce-
| cf737e81-
+------
mysql>select * from fixed_ips where deleted=0;
mysql> select * from fixed_ips where deleted=0;
+------
| created_at | updated_at | deleted_at | deleted | id | address | network_id | instance_id | allocated | leased | reserved | virtual_
+------
| 2011-11-10 01:41:21 | NULL | NULL | 0 | 1 | 10.0.152.0 | 1 | NULL | 0 | 0 | 1 | NULL | NULL |
| 2011-11-10 01:41:21 | NULL | NULL | 0 | 2 | 10.0.152.1 | 1 | NULL | 0 | 0 | 1 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-15 01:40:58 | NULL | 0 | 3 | 10.0.152.2 | 1 | 1 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-10 02:22:19 | NULL | 0 | 4 | 10.0.152.3 | 1 | NULL | 0 | 0 | 0 | NULL | nova152 |
| 2011-11-10 01:41:21 | 2011-11-15 01:37:06 | NULL | 0 | 5 | 10.0.152.4 | 1 | 2 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-15 04:32:53 | NULL | 0 | 6 | 10.0.152.5 | 1 | 3 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-15 04:32:47 | NULL | 0 | 7 | 10.0.152.6 | 1 | 4 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-15 04:32:42 | NULL | 0 | 8 | 10.0.152.7 | 1 | 5 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-15 04:32:59 | NULL | 0 | 9 | 10.0.152.8 | 1 | 6 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-17 23:47:20 | NULL | 0 | 10 | 10.0.152.9 | 1 | 7 | 1 | 0 | 0 | 7 | NULL |
| 2011-11-10 01:41:21 | 2011-11-17 23:47:21 | NULL | 0 | 11 | 10.0.152.10 | 1 | 8 | 1 | 0 | 0 | 8 | NULL |
| 2011-11-10 01:41:21 | 2011-11-17 23:47:22 | NULL | 0 | 12 | 10.0.152.11 | 1 | 9 | 1 | 0 | 0 | 9 | NULL |
| 2011-11-10 01:41:21 | 2011-11-17 23:47:24 | NULL | 0 | 13 | 10.0.152.12 | 1 | 10 | 1 | 0 | 0 | 10 | NULL |
| 2011-11-10 01:41:21 | 2011-11-17 23:47:25 | NULL | 0 | 14 | 10.0.152.13 | 1 | 11 | 1 | 0 | 0 | 11 | NULL |
| 2011-11-10 01:41:21 | 2011-11-15 05:39:57 | NULL | 0 | 15 | 10.0.152.14 | 1 | 12 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-16 06:29:44 | NULL | 0 | 16 | 10.0.152.15 | 1 | 13 | 1 | 0 | 0 | 13 | NULL |
| 2011-11-10 01:41:21 | 2011-11-16 07:32:12 | NULL | 0 | 17 | 10.0.152.16 | 1 | 14 | 1 | 0 | 0 | 14 | NULL |
| 2011-11-10 01:41:21 | 2011-11-17 23:47:27 | NULL | 0 | 18 | 10.0.152.17 | 1 | 15 | 1 | 0 | 0 | 15 | NULL |
| 2011-11-10 01:41:21 | 2011-11-17 23:47:28 | NULL | 0 | 19 | 10.0.152.18 | 1 | 16 | 1 | 0 | 0 | 16 | NULL |
| 2011-11-10 01:41:21 | 2011-11-16 08:22:54 | NULL | 0 | 20 | 10.0.152.19 | 1 | 17 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-16 08:28:41 | NULL | 0 | 21 | 10.0.152.20 | 1 | 18 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-12-01 05:44:58 | NULL | 0 | 22 | 10.0.152.21 | 1 | 19 | 1 | 1 | 0 | 19 | NULL |
| 2011-11-10 01:41:21 | 2011-12-01 05:44:17 | NULL | 0 | 23 | 10.0.152.22 | 1 | 20 | 1 | 1 | 0 | 20 | NULL |
| 2011-11-10 01:41:21 | 2011-12-01 05:44:54 | NULL | 0 | 24 | 10.0.152.23 | 1 | 21 | 1 | 1 | 0 | 21 | NULL |
| 2011-11-10 01:41:21 | 2011-11-29 08:51:37 | NULL | 0 | 25 | 10.0.152.24 | 1 | 22 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-29 08:54:12 | NULL | 0 | 26 | 10.0.152.25 | 1 | 23 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-29 08:53:49 | NULL | 0 | 27 | 10.0.152.26 | 1 | 24 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-30 02:00:44 | NULL | 0 | 28 | 10.0.152.27 | 1 | 25 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-12-01 04:13:22 | NULL | 0 | 29 | 10.0.152.28 | 1 | 26 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-30 11:14:07 | NULL | 0 | 30 | 10.0.152.29 | 1 | 27 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-30 02:05:08 | NULL | 0 | 31 | 10.0.152.30 | 1 | 28 | 0 | 0 | 0 | NULL | NULL |
| 2011-11-10 01:41:21 | 2011-11-30 09:02:26 | NULL | 0 | 32 | 10.0.152.31 | 1 | 30 | 1 | 0 | 0 | 30 | NULL |
+------
every fixed_ips was allocated one time. But now There are only 4 instances, other instances was deleted.
then, I try to boot new instance, nova didn't.
/var/log/
2011-12-01 14:46:40,776 DEBUG nova.rpc [-] received {u'_context_roles': [], u'_context_
2011-12-01 14:46:40,777 DEBUG nova.rpc [-] unpacked context: {'user_id': u'nova', 'roles': [], 'timestamp': u'2011-
2011-12-01 14:46:47,914 AUDIT nova.compute.
2011-12-01 14:46:47,988 DEBUG nova.rpc [-] Making asynchronous call on network ... from (pid=5977) multicall /usr/lib/
2011-12-01 14:46:47,988 DEBUG nova.rpc [-] MSG_ID is 9436655168cb45c
2011-12-01 14:46:48,128 ERROR nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
(nova.compute.
I think when terminate instance, nova should clean network ip information(
OR, when boot new instance, nova should select ip to instance properly.
Changed in nova: | |
assignee: | nobody → Vish Ishaya (vishvananda) |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | none → essex-3 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | essex-3 → 2012.1 |
IPs are supposed to be disassociated after a timeout (by default 600 seconds), see fixed_ip_ disassociate_ timeout for example, so I think that's intended behavior ?