image-volume opened too many times when image being importing which is unnecessary

Bug #2002932 reported by zhen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Unassigned

Bug Description

image-volume opened too many times when image being importing which is unnecessary.

```
# glance_store/_drivers/cinder.py #Store.add()

    def add(self, image_id, image_file, image_size, hashing_algo, context=None,
            verifier=None):
...
```

During the import image process, the 'image_size' passed to the add () method is always 0. According to the current logic, when the image is relatively large, the image-volume will be mounted/unmounted frequently because of the dynamic expansion of the mirror volume (for example, image with size 70G need to be mounted/unmounted 70/70 times)

I think when calling the add () method, we can get the actual size of 'stage_image'' in advance and pass it as' image_size''.

zhen (zhen001)
description: updated
description: updated
zhen (zhen001)
description: updated
Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

So you can confirm this because you see a lot of "Extending volume X to Y GB", right?

Could you send a patch implementing your idea?

Revision history for this message
zhen (zhen001) wrote :

Yes, in addition, after uploading a 70g image to glance (cinder backend of fcsan volume type), It's more than 70 attchments with "mountpoint" as "glance_store" in the table:

```
select count(*) from cinder.volume_attachment where volume_id="b6b7d42e-7f41-4e50-9a66-e2a51e59ec19" and mountpoint="glance_store"\G
*************************** 1. row ***************************
count(*): 73
1 row in set (0.001 sec)
```

Okay, I'll try.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.