Skip to content

Commit

Permalink
Merge pull request #538 from openvstorage/clone_scrub
Browse files Browse the repository at this point in the history
Add a snapshot after writing data
  • Loading branch information
Philippe authored May 30, 2017
2 parents b4ab706 + 8e40543 commit 8dcfc56
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ci/scenarios/vmachine/check_scrubbing_test/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def start_test(cls):
vdisks = created_vdisks['clones']
else:
vdisks = created_vdisks['parents']
stored_map = cls._prepare_for_scrubbing(vdisks, storagedriver, fio_bin_loc, is_ee)
stored_map = cls._prepare_for_scrubbing(vdisks, storagedriver, fio_bin_loc, is_ee, api)
cls._validate_scrubbing(stored_map)
finally:
for vdisk_type, vdisk_list in created_vdisks.iteritems():
Expand Down Expand Up @@ -131,7 +131,7 @@ def _validate_scrubbing(vdisk_stored_mapper, amount_checks=MAX_SCRUBBING_CHECKS,
raise RuntimeError(error_msg)

@classmethod
def _prepare_for_scrubbing(cls, vdisks, storagedriver, fio_bin_location, is_ee):
def _prepare_for_scrubbing(cls, vdisks, storagedriver, fio_bin_location, is_ee, api):
"""
Writes data to the vdisks
:param vdisks: list of vdisks
Expand All @@ -152,6 +152,10 @@ def _prepare_for_scrubbing(cls, vdisks, storagedriver, fio_bin_location, is_ee):
edge_configuration=edge_configuration,
screen=False,
loop_screen=False)
for vdisk in vdisks: # Snapshot to give the volumedriver a point of reference to scrub towards
VDiskSetup.create_snapshot(snapshot_name='{}_snapshot01'.format(vdisk.name),
vdisk_name=vdisk.name,
vpool_name=vdisk.vpool.name, api=api, consistent=False, sticky=False)
stored_map = {}
for vdisk in vdisks:
stored_map[vdisk.guid] = vdisk.statistics['stored']
Expand Down

0 comments on commit 8dcfc56

Please sign in to comment.