Bug 1393458

Summary: Error in slot allocation when adding a new disk volume
Product: Red Hat Enterprise Virtualization Manager Reporter: nijin ashok <nashok>
Component: vdsmAssignee: Nir Soffer <nsoffer>
Status: CLOSED ERRATA QA Contact: Natalie Gavrielov <ngavrilo>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0.3CC: amureini, bazulay, gklein, lsurette, ratamir, srevivo, ycui, ykaul
Target Milestone: ovirt-4.1.0-alpha   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description nijin ashok 2016-11-09 15:25:56 UTC
Description of problem:

As per the size of the leases lv, we should be having 2048 leases in each storage domain. While considering the reserved slots, we can have a maximum of 1948 slots that can be used by the disk images. However if there is only one slot vacant between two occupied slot, this will not be considered.

        for offset, size in occupiedSlots:
            if offset - freeSlot > slotSize:
                break

            freeSlot = offset + size

        self.log.debug("Found freeSlot %s in VG %s", freeSlot, self.sdUUID)
        return freeSlot


For example if I have 4,5,6,8,9 acquired , it will return 10 as freeslot and not 7. If it's 4,5,6,9, this will return 7. 

Version-Release number of selected component (if applicable):

vdsm-4.18.13-1.el7ev.x86_64

How reproducible:

100%

Steps to Reproduce:

1. Check the metadata slot mapping using:

$ lvs -o tags vgname | grep MD_
MD_4
MD_5
MD_6

2. Delete the disk using slot 5 (MD_5):

Verify that the MD_5 is not used:

$ lvs -o tags vgname | grep MD_
MD_4
MD_6

3. Create new disk

Verify that slot 6 is used by the new disk

$ lvs -o tags vgname | grep MD_
MD_4
MD_5
MD_6



Actual results:

All slots are not considered while adding a new disk volume

Expected results:

All slots should be considered.

Additional info:

Comment 1 Allon Mureinik 2016-11-09 15:47:25 UTC
Nir, IIUC, https://gerrit.ovirt.org/#/c/65649/ should fix this. Can you confirm/refute?

Comment 2 Nir Soffer 2016-11-09 16:26:29 UTC
(In reply to Allon Mureinik from comment #1)
> Nir, IIUC, https://gerrit.ovirt.org/#/c/65649/ should fix this. Can you
> confirm/refute?

Yes, I asked nijin to open separate bug for this issue.

Comment 4 Natalie Gavrielov 2017-02-05 11:56:39 UTC
Performed scenario described in comment 0.

Verified, using builds:
vdsm-4.19.4-1.el7ev.x86_64
ovirt-engine-4.1.0.3-0.1.el7.noarch