is disk reduce command while VM is active after snapshot deletion save?

When creating a snapshot, the volume gets two lv extents (2GB) . But after deleting the snapshot, the extents are kept and with every Snapshot creation the volume size increases. This is really annoying, especially when using snapshot for nightly backup. we are using oVirt 4.3.10 and we can't upgrade to 4.4 I have read that to shrink the volume the disk reduce command is what helps here, but the rest api documentation says, that this is only applicable while vm is not running. crazy as i am, i have called the reduce command while the vm was running, and it seemed to work. the volume has shrunk and the vm didn't crash. But is it save to do so? and why isn't the reduce command is called after deletion of a snapshot?

On Wed, Nov 3, 2021 at 2:51 PM <christian.peater@gmx.de> wrote:
When creating a snapshot, the volume gets two lv extents (2GB) . But after deleting the snapshot, the extents are kept and with every Snapshot creation the volume size increases. This is really annoying, especially when using snapshot for nightly backup. we are using oVirt 4.3.10 and we can't upgrade to 4.4
I have read that to shrink the volume the disk reduce command is what helps here, but the rest api documentation says, that this is only applicable while vm is not running. crazy as i am, i have called the reduce command while the vm was running, and it seemed to work. the volume has shrunk and the vm didn't crash.
But is it save to do so? and why isn't the reduce command is called after deletion of a snapshot? It actually is called, except when the active layer participates in
it's actually blocked only for the active volume of a running VM, I suppose you did not run it on the active volume? but it seems like the documentation needs to be fixed the live merge (or the SD isn't block SD)

thnx for the quick answer. the two disk volumes i have reduced are active. the response of the curl command is saying <status>complete</status>. i have set async to false to get a response from the rest api. when i called lvdisplay on the image_id of the volumes i was able to see that the images got shrank. SD is Fibre Channel so it is block SD the vms are running oracle databases. maybe i should freeze fs bevor calling reduce command? is it possible to call fsfreeze via rest api? best regards

On Wed, Nov 3, 2021 at 3:58 PM <christian.peater@gmx.de> wrote:
thnx for the quick answer.
the two disk volumes i have reduced are active. the response of the curl command is saying <status>complete</status>. i have set async to false to get a response from the rest api. when i called lvdisplay on the image_id of the volumes i was able to see that the images got shrank.
SD is Fibre Channel so it is block SD
the vms are running oracle databases. maybe i should freeze fs bevor calling reduce command? is it possible to call fsfreeze via rest api?
Reducing active volume is blocked in 4.4 since this is completely unsafe operation that is likely to corrupt the disk. See the patch fixing this: https://gerrit.ovirt.org/c/ovirt-engine/+/111541 It is possible that this is not blocked in older 4.3 versions. This is the risk of running 4.3. There is no reason to freeze the file system, reducing is an operation that cannot affect the guest if done safely (on read only layer). Nir
participants (3)
-
Benny Zlotnik
-
christian.peater@gmx.de
-
Nir Soffer