Ask Your Question
0

Cannot delete instances using "nova delete <instance id>"

asked 2015-11-25 15:20:29 -0500

toxickore gravatar image

updated 2015-11-25 19:30:28 -0500

smaffulli gravatar image

I'm creating instances on a kilo openstack release using the kilo ubuntu installation guide from openstack. One controller, one compute and one network node.

I can launch an instance from the dashboard, and then the instance have an ERROR status:

~# nova show 0dadc0d0-cf5e-492f-8896-deb907d80075 | grep status
| status                               | ERROR                                                                                                                                                                                                                                                               |

Since the image is still shown while doing a nova list, I'm trying to delete them.

~# nova list
+--------------------------------------+-----------+--------+------------+-------------+----------+
| ID                                   | Name      | Status | Task State | Power State | Networks |
+--------------------------------------+-----------+--------+------------+-------------+----------+
| 0dadc0d0-cf5e-492f-8896-deb907d80075 | example00 | ERROR  | -          | NOSTATE     |          |
| 19937fde-3a8a-410f-8b06-9c5fb3fc686c | example01 | ERROR  | -          | NOSTATE     |          |
| d3ab4faf-e888-4b4c-86a4-63e09248752b | example03 | ERROR  | -          | NOSTATE     |          |
| 38e7b547-fd5f-4b45-b0ab-2910b01e3e10 | example04 | ERROR  | -          | NOSTATE     |          |
+--------------------------------------+-----------+--------+------------+-------------+----------+
~# nova delete 0dadc0d0-cf5e-492f-8896-deb907d80075
Request to delete server 0dadc0d0-cf5e-492f-8896-deb907d80075 has been accepted.

But the instance is still there after some minutes or hours. The nova show is giving me the following output:

| created                              | 2015-11-23T19:51:24Z                                                                                                                                                                                                                                                |
| fault                                | {"message": "Unable to establish connection to http://127.0.0.1:9696/v2.0/ports.json?device_id=0dadc0d0-cf5e-492f-8896-deb907d80075", "code": 500, "details": "  File \"/usr/lib/python2.7/dist-packages/nova/compute/manager.py\", line 349, in decorated_function |
|                                      |     return function(self, context, *args, **kwargs)                                                                                                                                                                                                                 |
|                                      |   File \"/usr/lib/python2.7/dist-packages/nova/compute/manager.py\", line 2768, in terminate_instance                                                                                                                                                               |
|                                      |     do_terminate_instance(instance, bdms)                                                                                                                                                                                                                           |
|                                      |   File \"/usr/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py\", line 445, in inner                                                                                                                                                                       |
|                                      |     return f(*args, **kwargs)                                                                                                                                                                                                                                       |
|                                      |   File \"/usr/lib/python2.7/dist-packages/nova/compute/manager.py\", line 2766, in do_terminate_instance                                                                                                                                                            |
|                                      |     self._set_instance_error_state(context, instance)                                                                                                                                                                                                               |
|                                      |   File \"/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py\", line 85, in __exit__

What's the component I shall check for configuration? oviously is related with the line with Unable to establish connection to http://127.0.0.1:9696/v2.0/ports.json?device_id=0dadc0d0-cf5e-492f-8896-deb907d80075

Is this for nova?

Thanks in advance.

edit retag flag offensive close merge delete

5 answers

Sort by ยป oldest newest most voted
0

answered 2017-08-04 07:02:40 -0500

Mohit gravatar image

Appears that it is attempting to catch neutron a the loopback ip address 127.0.0.1 but you have mentioned that there is

One controller, one compute and one network node.

Unable to establish connection to http://127.0.0.1:9696/v2.0/ports.json?device_id=0dadc0d0-cf5e-492f-8896-deb907d80075

edit flag offensive delete link more
0

answered 2017-08-03 09:47:25 -0500

gaurav.mittal gravatar image

I am using the ocata on centos 7 and i am also getting the same error. Kindly help

[root@openstack ~(keystone_admin)]# nova list
+--------------------------------------+----------------+--------+------------+-------------+----------+
| ID                                   | Name           | Status | Task State | Power State | Networks |
+--------------------------------------+----------------+--------+------------+-------------+----------+
| 660b33fd-6f3f-4505-bba6-eccd35fe3e6e | vm1-dns-server | BUILD  | scheduling | NOSTATE     |          |
| 93cb7637-10f3-4dd9-b1b2-66f236fee6c6 | vm1-vid        | BUILD  | scheduling | NOSTATE     |          |
+--------------------------------------+----------------+--------+------------+-------------+----------+
[root@openstack ~(keystone_admin)]# nova delete 660b33fd-6f3f-4505-bba6-eccd35fe3e6e
No server with a name or ID of '660b33fd-6f3f-4505-bba6-eccd35fe3e6e' exists.
ERROR (CommandError): Unable to delete the specified server(s).
[root@openstack ~(keystone_admin)]#

[root@openstack ~(keystone_admin)]# nova reset-state --active 660b33fd-6f3f-4505-bba6-eccd35fe3e6e
Reset state for server 660b33fd-6f3f-4505-bba6-eccd35fe3e6e failed: No server with a name or ID of '660b33fd-6f3f-4505-bba6-eccd35fe3e6e' exists.
ERROR (CommandError): Unable to reset the state for the specified server(s).
[root@openstack ~(keystone_admin)]#
edit flag offensive delete link more

Comments

Hi Gaurav, please check in nova.conf file [neutron] header exists and ensure configurations are correct.

Praveen N gravatar imagePraveen N ( 2017-08-04 02:30:44 -0500 )edit

Yes that is existing and I have also verified the configuration and everything is OK.

gaurav.mittal gravatar imagegaurav.mittal ( 2017-08-04 02:49:05 -0500 )edit
0

answered 2015-11-27 11:24:22 -0500

toxickore gravatar image

updated 2015-11-27 11:51:30 -0500

After checking my neutron configurations. I figured out that the [neutron] tag on my controller node /etc/nova/nova.conf was not specified. I had only the contents but not the tag. I have included the [neutron] tag and restarted the neutron services, the error changed but I think that's out of the scope of this question.

My guess is that nova was trying to use the default hostname for neutron since it was not defined.

edit flag offensive delete link more
0

answered 2015-11-26 00:07:02 -0500

Prateek K gravatar image

As far as deletion is concerned you can delete an instance by changing its state. Neutron provides us a way to override the status of a VM to active and then delete it.

To do this run the command 'nova reset-state --active [UUID of VM]'. This will bring the VM state back to active and then you can easily delete them via nova delete command

edit flag offensive delete link more

Comments

Its not the deletion issue, looks like an issue with Neutron. Better to trouble shoot that error before proceed.

Bipin gravatar imageBipin ( 2015-11-26 00:22:31 -0500 )edit

Actually the VMs never reachs the active state since they have an error before being launched.

toxickore gravatar imagetoxickore ( 2015-11-26 08:52:58 -0500 )edit
0

answered 2015-11-25 21:50:32 -0500

Bipin gravatar image

Hi,

Its neutron. API is not able to communicate with Neutron server. Make sure the neutron server is up and running

netstat -ntlp | grep 9696 in your controller node

Regards

edit flag offensive delete link more

Comments

On the controller node # netstat -ntlp | grep 9696 tcp 0 0 0.0.0.0:9696 0.0.0.0:* LISTEN 39383/python How am I sure that the neutron server is running? I ran ps -ef | grep neutron and I have lots of processes related with neutron on the network node

toxickore gravatar imagetoxickore ( 2015-11-26 08:52:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-11-25 15:20:29 -0500

Seen: 2,404 times

Last updated: Aug 04 '17