Change in ovirt-engine[ovirt-engine-4.1]: merge: validate available space before merge

Code Review gerrit at ovirt.org
Mon May 22 08:58:18 UTC 2017


>From Tal Nisan <tnisan at redhat.com>:

Tal Nisan has submitted this change and it was merged.

Change subject: merge: validate available space before merge
......................................................................


merge: validate available space before merge

Introducing StorageDomainValidator#hasSpaceForMerge method for
calculating required space when performing live/cold merge.

The calculation is performed adhering to these rules when performing new
(4.1+) merge operation:

     | File Domain                                      | Block Domain
-----|--------------------------------------------------|--------------
qcow | min(virtual_size(top) * 1.1 - actual_size(base), |
     |  actual_size(top))                               | same as file
-----|--------------------------------------------------|--------------
raw  | min(virtual_size(top) / 1.1,                     |
     |  virtual_size(base) - actual_size(base))         | 0
     |                                                  |

* The qcow/raw refers to the base snapshot format
* base/top - base snapshot/ top snapshot
* 1.1 - qcow2 overhead

This is made for both live and cold merge 4.1+. If we are performing
cold merge pre-4.1, we take min(actual(base) + actual(top),
        virtual(top))

Squashed in this patch are commits:
9eccf2a0e17b4bae8d4418f1e008cab6e16eaa16
5526a78581cf40c5611412b673803ebd2953f06f

Change-Id: Ib0f41199708593b2df671e1f0132ae813c2e996d
Bug-Url: https://bugzilla.redhat.com/1450674
Signed-off-by: Benny Zlotnik <bzlotnik at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/RemoveSnapshotCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/storage/MultipleStorageDomainsValidator.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/storage/StorageDomainValidator.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/snapshots/RemoveSnapshotCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/storage/MultipleStorageDomainsValidatorTest.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDao.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDaoImpl.java
M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskImageDaoTest.java
M packaging/dbscripts/disk_images_sp.sql
9 files changed, 246 insertions(+), 15 deletions(-)

Approvals:
  Benny Zlotnik: Verified
  Jenkins CI: Passed CI tests
  Allon Mureinik: Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/76613
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0f41199708593b2df671e1f0132ae813c2e996d
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-4.1
Gerrit-Owner: Benny Zlotnik <bzlotnik at redhat.com>
Gerrit-Reviewer: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Benny Zlotnik <bzlotnik at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list