Copy links as links rather than files when registering an image
|Assignee:||Ruben S. Montero||% Done:|
|Category:||Core & System|
Quick background : I'm writing a TM driver that uses iscsi to store VM images. This TM driver relies on links to the /dev/disk/by-path/ip* tree.
I have the following link structure :
/srv/cloud/1/images/disk.0 -> /dev/disk/by-path/ip-126.96.36.199:3260-iscsi-iqn.1992-08.com.filer:cloudfiler01-lun-0
/dev/disk/by-path/ip-188.8.131.52:3260-iscsi-iqn.1992-08.com.filer:cloudfiler01-lun-0 -> /dev/sdb
Preliminary tests seem to indicate it works. My TM connects to the filer, adds/clones/deletes LUNs efficiently, and manages permissions on said LUNs.
Now, to the issue at hand. What I would like, is the ability to provision images that are "LUNs on a filer".
The problem is that when "oneimage register" is run, the content of the LUN is copied to the disk.
Browsing through the code, it appears that the code responsible for this is OpenNebula::ImageRepository#copy(). This method calls Fileutils.copy(), which, according to documentation will read the content pointed to by a symlink, and write it to a new file.
The Fileutils.copy_entry() method, on the other hand, will actually keep the link.
I'm using the attached patch. I'm aware all this code no longer exists in soon-to-be 2.4, and it's unlikely to be merged in anything, so I'm leaving this here in case someone else needs it.
#1 Updated by Ruben S. Montero over 8 years ago
- Status changed from New to Closed
We have been working on this for the next release. The image repository has been decoupled and architected using a plugin approach similar to the other OpenNebula components. In this way there are external programs called to cp, mv, rm, mkfs images in the repo that implements specific operations depending on the storage backend for the repo.
This is already in master. I am closing this issue, as the changes you propose can be easily included in the new structure.
Thanks for your feedback!