Cinder-Volumes not freeing space upon volume delete

asked 2019-05-14 15:55:18 -0500

Hadron_Collide gravatar image

Greetings,

I am running Openstack Ocata installed via Packstack, and have run into an issue with the cinder-volumes file which is in var/lib/cinder allowing me to create volumes (and the instances that they serve) until the partition which holds var/lib/cinder is completely full, and then it errors out.

Two questions - What is the fix? Of more interest here, what extra data can I append to this question to clarify further?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-05-14 19:06:18 -0500

updated 2019-05-14 21:11:36 -0500

First, some background.

A Packstack answer file contains a parameter CONFIG_CINDER_VOLUMES_SIZE. My Rocky Packstack deployment uses the default size, which is 20GB.

Here is my cinder-volumes file:

$ ls -lsh /var/lib/cinder/cinder-volumes
256K -rw-r-----. 1 root root 21G May 14 19:33 /var/lib/cinder/cinder-volumes

The 256K figure is the actual space this file currently uses in the filesystem. It's a sparse file that fills up as you allocate Cinder volumes. I don't think that Linux has a mechanism to release space in a file.

The fix is to provide enough space in /var/lib/cinder so that the file can grow up to its 20GB. Or you set a smaller CONFIG_CINDER_VOLUMES_SIZE when deploying Packstack, knowing that this will limit the amount of volume data that you can create.

More background information: Packstack deploys LVM as the Cinder backend and enables thin provisioning by default. The cinder-volumes file is used as the LVM physical volume:

# pvs
  PV         VG             Fmt  Attr PSize   PFree
  /dev/loop1 cinder-volumes lvm2 a--  <20.60g 1012.00m
# lvs
  LV                  VG             Attr       LSize   Pool Origin Data%  Meta%  (...)
  cinder-volumes-pool cinder-volumes twi-a-tz--  19.57g             0.00   10.55

cinder-volumes-pool is the LVM pool from which thin logical volumes are allocated, each representing a Cinder volume.

edit flag offensive delete link more

Comments

What if my system has 1tb HDD & i have alloted 950 to cinder volumes and using packstack -allinone. What could be a possible solution is 90% of those 950gb to cinder is full, I dont have another disk to add. Can I delete the data inside 950gb?

jamil gravatar imagejamil ( 2020-03-30 11:05:25 -0500 )edit

You can delete data inside the cinder-volumes file by deleting volumes, but that won't shrink the file. Perhaps pvresize --setphysicalvolumesize 800G /dev/loop1 does the trick, but I have never tried it.

Bernd Bausch gravatar imageBernd Bausch ( 2020-03-30 14:08:09 -0500 )edit

Found the fix I had deleted the old file created new cinder volume using dd, attaching it to /dev/loop1 Created physical vol of the new volume. Changed its partition table to LVM. Created volume group & reattached it as cinder-volumes service restarted

Voila new image of same or bigger size

jamil gravatar imagejamil ( 2020-04-01 12:12:52 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-05-14 15:55:18 -0500

Seen: 542 times

Last updated: May 14 '19