Ask Your Question
0

execute a periodic task

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

jacopo85 gravatar image

Hi,

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 (nova.scheduler.manager.py) 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
0

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!

-S

edit flag offensive delete link more
0

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

jacopo85 gravatar image

Thanks Sandy Walsh, that solved my question.

edit flag offensive delete link more
0

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 nova.scheduler.host_manager.py, and for the instances i find it in nova.copute.api.py. 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
0

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

This might help?

http://www.sandywalsh.com/2012/09/openstack-nova-internals-pt2-services.html (http://www.sandywalsh.com/2012/09/ope...)

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

1 follower

Stats

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

Seen: 28 times

Last updated: Oct 04 '12