Ask Your Question

How to remove a physical compute node from production OpenStack cluster safely

asked 2014-07-23 10:59:26 -0500

hi ,

i have set up a openstack (Havana) use Dev/QA in my company. but there are haveware must be switch to other organization. so the running VM host on the servers will be migrated other compute node server. i think it should have below steps:

1.Distable the compute service at the compute node which will be removed.

2.Migrated all of the VMs from this server.

3.Remove the host record from nova database

So I am not sure that it's a right solution, i want to know what guys to do usually? Can you give me you steps??


edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2014-07-28 14:07:47 -0500

rooter gravatar image

Be sure to migrate the instance before you remove the service.

The tricky part is to remove (decommission) a nova-compute service from the openstack hypervisor list. Not sure about Havana, but in Icehouse there's a freshly added API extension for that. It might also work in Havana, though. Sure, you could also just remove entries from the database, but that's gnarly.

As far as I know there's no novaclient python module support for that API call yet, so you might have to call it via raw HTTP call, as show below:

(code is a courtesy of a colleague of mine, thanks N.!)

1st, get the token from keystone:

(Use a tenant for which you have admin privileges.)

curl -d '{"auth":{"passwordCredentials":{"username": "admin","password": "42"},"tenantName": "myTenant"}}'  -H "Content-Type: application/json" http://openstack:5000/v2.0/tokens

2nd, identify the id of the compute service you want to remove

(do this one way, or the other. Here's what worked for us -- using novaclient python module)

import novaclient.v1_1.client as nvclient
nova = nvclient.Client(**creds)
services =
for service in services:
   if == "node-to-remove": print

3rd, get the tenant-id (you will need it later)

keystone tenant-list | grep myTenant

4th, use token, tenant-id, and the service-id to gracefully remove service from nova

curl -i -H "Content-Type: application/json" -X DELETE http://openstack:8774/v2/{tenant-id}/os-services/{service-id} -H "User-Agent: python-keystoneclient" -H "X-Auth-Token: {token}"

You're done.

If everything worked fine, you should no longer see your nova-compute service in the output of the

nova service-list

nor in the hypervisor list in the dashboard.

edit flag offensive delete link more

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



Asked: 2014-07-23 10:59:26 -0500

Seen: 4,115 times

Last updated: Jul 23 '14