rbd: No available space check for image_conversion_dir in cinder-volume on upload-to-image

Bug #1798589 reported by s10
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Cinder
In Progress
Low
Sofia Enriquez

Bug Description

image_conversion_dir of the cinder-volume service can be filled up while performing upload-to-image of the large volume, because there is no check_available_space() being executed during this operation.

By default policy volume_extension:volume_actions:upload_image is being set to the admin_or_owner be default, so everyone can perform this operation. Also option image_upload_use_cinder_backend is being set to false.

How to reproduce:
1) Create a large volume (for example 4Tb)
2) Execute cinder upload-to-image for this volume
3) See, that image_conversion_dir is being filled up until all free space on the image_conversion_dir is gone, even if there was no enough free space on the partition with image_conversion_dir.

https://github.com/openstack/cinder/blob/stable/rocky/cinder/volume/driver.py#L866
https://github.com/openstack/cinder/blob/stable/rocky/cinder/volume/drivers/rbd.py#L1451

On the Glance side, there is a possibility to limit the maximum size of the uploaded image with image_size_cap option defaulted to 1Tb. But, for example, for rbd driver rbd export operation will be executed before glanceclient invocation and request to the Glance API, which can refuse to create a large image because of the overall limit or image_size_cap option.

This issue affects all Cinder releases at least since Pike.

s10 (vlad-esten)
description: updated
Pavel Abalikhin (anpavl)
Changed in cinder:
status: New → Confirmed
Changed in cinder:
assignee: nobody → Naga Samyuktha (samyukthae)
s10 (vlad-esten)
Changed in cinder:
assignee: Naga Samyuktha (samyukthae) → nobody
Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote :
tags: added: glance image
Changed in cinder:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/816898

Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote : Re: No available space check for image_conversion_dir in cinder-volume on upload-to-image
Changed in cinder:
assignee: nobody → Sofia Enriquez (lsofia-enriquez)
summary: - No available space check for image_conversion_dir in cinder-volume on
- upload-to-image
+ rbd: No available space check for image_conversion_dir in cinder-volume
+ on upload-to-image
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.