Add Copy Offload support for Glance Image Cache to netapp unified driver
I know that a copy offload does not run when I use a glance image cache directory (image_cache_dir) for a filesystem.
I would like to propose to support it.
I tried to edit nfs.py and add one metadata to metadata.json.
It appeared that it works good.
If some glance image has already been prefetched to a cache directory from the glance repository and the cached directory exists on flex volume of clustered Data ONTAP, the netapp driver can do copy from a cached to cinder volume by using the copy offload.
Edit nfs.py
# diff -c orig_nfs.py nfs.py
*** orig_nfs.py 2014-10-03 09:59:56.200632632 +0900
--- nfs.py 2014-10-07 13:12:28.673414532 +0900
***************
*** 1199,1210 ****
--- 1199,1219 ----
(vserver, exp_volume) = self._get_
+ def _get_img_
+ direct_url, locations = image_location
+ if not direct_url and not locations:
+ raise exception.
+ location = locations[0]
+ location_cache_path = location[
+ return (location_
def _copy_from_
"""Copies from the image service using copy offload."""
image_loc = image_service.
+ img_cache_path = self._get_
+ LOG.debug(_("Image Cache Path %s"), img_cache_path)
image_loc = self._construct
conn, dr = self._check_
if conn:
***************
*** 1212,1218 ****
else:
raise exception.
(__, ___, img_file) = image_loc.
! src_path = os.path.join(dr, img_file)
dst_ip = self._get_
# tmp file is required to deal with img formats
--- 1221,1230 ----
else:
raise exception.
(__, ___, img_file) = image_loc.
! if img_cache_path:
! src_path = os.path.
! else:
! src_path = os.path.join(dr, img_file)
dst_ip = self._get_
# tmp file is required to deal with img formats
for example : glance-api.conf
filesystem_
show_image_
show_multiple_
filesystem_
for example : metadata.json
{
"type": "nfs",
"cache_path": "/cache_vol"
}
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Takeshi.K
- Direction:
- Needs approval
- Assignee:
- Bob Callaway
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- Sean McGinnis
Related branches
Related bugs
Sprints
Whiteboard
(smcginnis): Marking obsolete as this has been sitting out there for a long time. If this is still needed, please submit a new bp.
None