Glance image create fails with No space left on device error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glance_store |
Fix Released
|
Undecided
|
Rajat Dhasmana |
Bug Description
When configured to use cinder as glance backend, the image create operation fails with the following error.
91d - a5e795241efa48e
Changed in glance-store: | |
assignee: | nobody → Rajat Dhasmana (whoami-rajat) |
Changed in glance-store: | |
status: | New → In Progress |
Reviewed: https:/ /review. opendev. org/c/openstack /glance_ store/+ /826290 /opendev. org/openstack/ glance_ store/commit/ f3433ed1a5176bf f85b3fe04dba2d4 c76618a299
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit f3433ed1a5176bf f85b3fe04dba2d4 c76618a299
Author: whoami-rajat <email address hidden>
Date: Tue Jan 25 19:24:30 2022 +0530
Cinder store: Wait for device resize
When we have an image with size > 1 GB, we follow the following steps
to accomodate the image:
1) Detach the volume
2) extend the volume
3) Attach the volume
4) Open the volume device as a file and resume writing the image
Sometimes due to several reasons (mostly network related), the
size of the device file could mismatch with the actual volume size
(or the backend LUN size). This can happen if the extend was performed
(i.e. the control path) but it takes the time to reflect that into
the mapped device (i.e. the data path). This mismatch can cause the
issue "IOError: [Errno 28] No space left on device".
To avoid this scenario, we check if the device size is less than the
volume size, we wait for the extended LUN to show up in mapped device
and then continue the image writing operation.
Closes-Bug: #1959913
Change-Id: I206580f6be615e bc5e15b546b9c23 728d4116a5d