Request #1008

Provide hook feature for IMAGE management

Added by Maxence Dunnewind over 9 years ago. Updated about 8 years ago.

Status:ClosedStart date:11/25/2011
Priority:NormalDue date:
Assignee:-% Done:


Category:Core & System
Target version:-
Pull request:


It would be really nice to have hook feature for the IMAGEs, as already provided for almost all other "objects".

One usecase we have is that we make a local copy of each image on the workers the first time and instance of this image is deployed on the worker, so that the next deployment will only need a snapshot. One missing feature there is to be able to delete the local copy on all workers when an image is deleted.


#1 Updated by Ruben S. Montero over 9 years ago


Although hooks for image management are definitively a very nice feature, the use case you describe should be address by customizing the TM scripts. These modifications should be at the tm level where the actual copy from the image repo to the host happens. It should be fairly straight forward to MD5 the source in tm_clone, check that a file with that MD5 is in a local directory in the DST and if so instead of scp o cp you can snapshot the disk file.



#2 Updated by Ruben S. Montero over 9 years ago

  • Tracker changed from Feature to Request

BTW, I'll move this to request till it is moved to the OpenNebula backlog...

#3 Updated by Maxence Dunnewind over 9 years ago

There are 2 differents things :
- copy the image to the node the first time it is used on this host.
As you said, I implemented this in (based on image filename which is supposed to be unique).

- when an image is deleted from the pool (oneimage delete XX), delete it on all nodes
This is where hooks for images will be usefull. I may be wrong, but I don't think TM scripts are called when you delete an image. At the moment, the only way we have to remove deleted images on nodes is to run a cron script which lists the files in /var/lib/one/images, connect on each node and list the LVs, then remove those with no corresponding image existing.

#4 Updated by Ruben S. Montero about 8 years ago

  • Status changed from New to Closed

This is now implemented

Also available in: Atom PDF