Ask Your Question

execute a periodic task

asked 2012-09-29 17:50:50 -0600

jacopo85 gravatar image


i'm doing a thesis work on nova and i need to add a periodic task to execute. I'll find the decorator "@periodic_task" and it seems to do what i want. But now i don't know how to add some code to execute. I try to add a module in the source and launch a script installation, but my file isn't compiled. Then i try insert a function in a module ( whit the decorator, but also it didn't work (i insert a simple print to file to test it).

Maybe it is a really simple thing, but i'm totally new to python and openstack developing, and can't find an answer on the documentation.

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted

answered 2012-09-29 18:36:39 -0600

This might help? (

edit flag offensive delete link more

answered 2012-10-03 19:45:17 -0600

jacopo85 gravatar image

It works perfectly, thank you so much.

Can i ask you one more thing here? (Maybe i have to open another topic; if so, i'll do ti)

I have to retrieve information about hosts and instances. For the hosts i find something in, and for the instances i find it in What i want to know is if it's the correct way to retreive information, or i have to acces to the db with the nova.db module

edit flag offensive delete link more

answered 2012-10-03 19:45:31 -0600

jacopo85 gravatar image

Thanks Sandy Walsh, that solved my question.

edit flag offensive delete link more

answered 2012-10-04 12:49:04 -0600

Nova doesn't use a db service. Instead it's just a library that all modules (except Compute) can access directly.

Look at nova.db.api for the function you need. It'll all be in there.

Glad it worked for you!


edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2012-09-29 17:50:50 -0600

Seen: 89 times

Last updated: Oct 04 '12