Bug 987228 - ssm: resize will remove device from other pool even if it don't want to add it to current pool
ssm: resize will remove device from other pool even if it don't want to add i...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: system-storage-manager (Show other bugs)
7.0
All All
medium Severity medium
: rc
: ---
Assigned To: Lukáš Czerner
Zorro Lang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-22 23:08 EDT by Jimmy Pan
Modified: 2015-07-19 20:55 EDT (History)
3 users (show)

See Also:
Fixed In Version: system-storage-manager-0.4-2.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 07:30:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jimmy Pan 2013-07-22 23:08:52 EDT
Description of problem:
ssm resize will remove device from other pool when even if after it find out the size didn't change and refused to add it to current pool

Version-Release number of selected component (if applicable):
system-storage-manager-0.2-2.el7

How reproducible:
Always

Steps to Reproduce:
1. setup loop devices with dd (/dev/loop0, /dev/loop1, /dev/loop2)
2. ssm create -s 100M /dev/loop0
3. ssm add -p pool1 /dev/loop1 /dev/loop2
4. ssm resize -s 100M lvm_pool:lvol001 /dev/loop2
5. ssm add -p pool1 /dev/loop2
5. ssm resize -s 20M lvm_pool:lvol001 /dev/loop1

Actual results:
Because the resize size didn't change from original or size reduced from original, /dev/loop2 and /dev/loop1 was not added to lvm_pool, but it was removed from pool1.

[root@ibm-x3550m3-03 ~]# ssm resize -s 100M lvm_pool/lvol001 /dev/loop2
Device '/dev/loop2' is already used in the 'pool1'! Remove (N/y/q) ? Y
  Removed "/dev/loop2" from volume group "pool1"
'lvm_pool/lvol001' is already 102400.0 KB long, there is nothing to resize!
"Error (2006): 'lvm_pool/lvol001' is already 102400.0 KB long, there is nothing to resize!"
[root@ibm-x3550m3-03 ~]# ssm list dev
---------------------------------------------------------------------------
Device         Free       Used      Total  Pool                 Mount point  
---------------------------------------------------------------------------
/dev/loop0  2.90 GB  100.00 MB    3.00 GB  lvm_pool                          
/dev/loop1  3.00 GB    0.00 KB    3.00 GB  pool1                             
/dev/loop2                        3.00 GB                                    
/dev/sda                        279.40 GB                       PARTITIONED  
/dev/sda1                       500.00 MB                       /boot        
/dev/sda2   0.00 KB  278.91 GB  278.91 GB  rhel_ibm-x3550m3-03               
---------------------------------------------------------------------------

[root@ibm-x3550m3-03 ~]# ssm resize -s 20M lvm_pool/lvol001 /dev/loop1
Device '/dev/loop1' is already used in the 'pool1'! Remove (N/y/q) ? Y
  Removed "/dev/loop1" from volume group "pool1"
  WARNING: Reducing active logical volume to 20.00 MiB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lvol001? [y/n]: y
  Reducing logical volume lvol001 to 20.00 MiB
  Logical volume lvol001 successfully resized
[root@ibm-x3550m3-03 ~]# ssm list dev
---------------------------------------------------------------------------
Device         Free       Used      Total  Pool                 Mount point  
---------------------------------------------------------------------------
/dev/loop0  2.98 GB   20.00 MB    3.00 GB  lvm_pool                          
/dev/loop1                        3.00 GB                                    
/dev/loop2  3.00 GB    0.00 KB    3.00 GB  pool1                             
/dev/sda                        279.40 GB                       PARTITIONED  
/dev/sda1                       500.00 MB                       /boot        
/dev/sda2   0.00 KB  278.91 GB  278.91 GB  rhel_ibm-x3550m3-03               
---------------------------------------------------------------------------


Expected results:
If the device is not going to be added to new pool, it should not be remove from old pool.

Additional info:
Comment 2 Lukáš Czerner 2013-07-30 11:52:02 EDT
Patch sent upstream http://sourceforge.net/mailarchive/message.php?msg_id=31232488
Comment 3 Lukáš Czerner 2013-08-08 08:36:15 EDT
Building in system-storage-manager-0.4-1.el7
Comment 4 Jimmy Pan 2013-09-29 03:03:11 EDT
reproduced with system-storage-manager-0.2-2.el7
use steps in comment0, result:

[root@hp-dl388g8-15 ~]# ssm -f resize -s 100M  pool1/lvol001 /dev/loop1
Device '/dev/loop1' is already used in the 'lvm_pool'! Remove (N/y/q) ? Y
  Removed "/dev/loop1" from volume group "lvm_pool"
'pool1/lvol001' is already 102400.0 KB long, there is nothing to resize!
"Error (2006): 'pool1/lvol001' is already 102400.0 KB long, there is nothing to resize!"

reproduced with system-storage-manager-0.4-1.el7
use steps in comment0, result:
[root@hp-dl388g8-15 ~]# ssm list
-----------------------------------------------------------------------------
Device            Free       Used      Total  Pool                Mount point
-----------------------------------------------------------------------------
/dev/loop0  1020.00 MB    0.00 KB    1.00 GB  lvm_pool                       
/dev/loop1  1020.00 MB    0.00 KB    1.00 GB  lvm_pool                       
/dev/loop2   920.00 MB  100.00 MB    1.00 GB  pool1                          
/dev/sda                             3.64 TB                      PARTITIONED
/dev/sda1                            1.00 MB                                 
/dev/sda2                          500.00 MB                      /boot      
/dev/sda3      0.00 KB    3.64 TB    3.64 TB  rhel_hp-dl388g8-15             
-----------------------------------------------------------------------------
-------------------------------------------------------------------
Pool                Type  Devices       Free       Used       Total  
-------------------------------------------------------------------
lvm_pool            lvm   2          1.99 GB    0.00 KB     1.99 GB  
pool1               lvm   1        920.00 MB  100.00 MB  1020.00 MB  
rhel_hp-dl388g8-15  lvm   1          0.00 KB    3.64 TB     3.64 TB  
-------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
Volume                        Pool                Volume size  FS      FS size       Free  Type    Mount point
--------------------------------------------------------------------------------------------------------------
/dev/rhel_hp-dl388g8-15/swap  rhel_hp-dl388g8-15      7.88 GB                              linear             
/dev/rhel_hp-dl388g8-15/root  rhel_hp-dl388g8-15     50.00 GB  ext4   50.00 GB   45.06 GB  linear  /          
/dev/rhel_hp-dl388g8-15/home  rhel_hp-dl388g8-15      3.58 TB  ext4    3.58 TB    3.35 TB  linear  /home      
/dev/pool1/lvol001            pool1                 100.00 MB                              linear             
/dev/sda2                                           500.00 MB  xfs   495.25 MB  470.32 MB  part    /boot      
--------------------------------------------------------------------------------------------------------------
[root@hp-dl388g8-15 ~]# ssm -f resize -s 100M  pool1/lvol001 /dev/loop1
'pool1/lvol001' is already 102400.0 KB long, there is nothing to resize!
[root@hp-dl388g8-15 ~]# ssm -f resize -s 90M  pool1/lvol001 /dev/loop1
Device '/dev/loop1' is already used in the 'lvm_pool'! Remove (N/y/q) ? Y
  Removed "/dev/loop1" from volume group "lvm_pool"
  Rounding size to boundary between physical extents: 92.00 MiB
  WARNING: Reducing active logical volume to 92.00 MiB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
  Reducing logical volume lvol001 to 92.00 MiB
  Logical volume lvol001 successfully resized
[root@hp-dl388g8-15 ~]# ssm list
----------------------------------------------------------------------------
Device            Free      Used      Total  Pool                Mount point
----------------------------------------------------------------------------	
/dev/loop0  1020.00 MB   0.00 KB    1.00 GB  lvm_pool                       
/dev/loop1                          1.00 GB                                 
/dev/loop2   928.00 MB  92.00 MB    1.00 GB  pool1                          
/dev/sda                            3.64 TB                      PARTITIONED
/dev/sda1                           1.00 MB                                 
/dev/sda2                         500.00 MB                      /boot      
/dev/sda3      0.00 KB   3.64 TB    3.64 TB  rhel_hp-dl388g8-15             
----------------------------------------------------------------------------
-------------------------------------------------------------------
Pool                Type  Devices        Free      Used       Total  
-------------------------------------------------------------------
lvm_pool            lvm   1        1020.00 MB   0.00 KB  1020.00 MB  
pool1               lvm   1         928.00 MB  92.00 MB  1020.00 MB  
rhel_hp-dl388g8-15  lvm   1           0.00 KB   3.64 TB     3.64 TB  
-------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
Volume                        Pool                Volume size  FS      FS size       Free  Type    Mount point
--------------------------------------------------------------------------------------------------------------
/dev/rhel_hp-dl388g8-15/swap  rhel_hp-dl388g8-15      7.88 GB                              linear             
/dev/rhel_hp-dl388g8-15/root  rhel_hp-dl388g8-15     50.00 GB  ext4   50.00 GB   45.06 GB  linear  /          
/dev/rhel_hp-dl388g8-15/home  rhel_hp-dl388g8-15      3.58 TB  ext4    3.58 TB    3.35 TB  linear  /home      
/dev/pool1/lvol001            pool1                  92.00 MB                              linear             
/dev/sda2                                           500.00 MB  xfs   495.25 MB  470.32 MB  part    /boot      
--------------------------------------------------------------------------------------------------------------
Comment 5 Lukáš Czerner 2013-10-14 13:17:45 EDT
Build in system-storage-manager-0.4-2.el7
Comment 7 Zorro Lang 2014-02-08 01:11:31 EST
1) test environment:
[root@hp-dl380eg8-03 images]# rpm -qa system-storage-manager
system-storage-manager-0.4-2.el7.noarch
[root@hp-dl380eg8-03 images]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.0 Beta (Maipo)
[root@hp-dl380eg8-03 images]# uname -r
3.10.0-64.el7.x86_64


2) prepare three loop devices, like below:
[root@hp-dl380eg8-03 images]# ssm list dev
-----------------------------------------------------------------------------
Device           Free       Used      Total  Pool                 Mount point
-----------------------------------------------------------------------------
/dev/dm-3                         100.00 MB                                  
/dev/loop0  408.00 MB  100.00 MB  512.00 MB  lvm_pool                        
/dev/loop1  508.00 MB    0.00 KB  512.00 MB  pool1                           
/dev/loop2  508.00 MB    0.00 KB  512.00 MB  pool1                           
...
...           
-----------------------------------------------------------------------------

3) begin to test:
[root@hp-dl380eg8-03 images]# ssm resize -s 100M lvm_pool/lvol001 /dev/loop2                                                                                              
SSM Error (2006): 'lvm_pool/lvol001' is already 102400.0 KB long, there is nothing to resize!
[root@hp-dl380eg8-03 images]# ssm list dev
-----------------------------------------------------------------------------
Device           Free       Used      Total  Pool                 Mount point
-----------------------------------------------------------------------------
/dev/dm-3                         100.00 MB                                  
/dev/loop0  408.00 MB  100.00 MB  512.00 MB  lvm_pool                        
/dev/loop1  508.00 MB    0.00 KB  512.00 MB  pool1                           
/dev/loop2  508.00 MB    0.00 KB  512.00 MB  pool1                           
...
...            
-----------------------------------------------------------------------------

[root@hp-dl380eg8-03 images]# ssm resize -s 20M lvm_pool/lvol001/dev/loop2                                                                                               
  WARNING: Reducing active logical volume to 20.00 MiB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lvol001? [y/n]: y
  Reducing logical volume lvol001 to 20.00 MiB
  Logical volume lvol001 successfully resized
[root@hp-dl380eg8-03 images]# ssm list dev
-----------------------------------------------------------------------------
Device           Free       Used      Total  Pool                 Mount point
-----------------------------------------------------------------------------
/dev/dm-3                          20.00 MB                                  
/dev/loop0  488.00 MB   20.00 MB  512.00 MB  lvm_pool                        
/dev/loop1  508.00 MB    0.00 KB  512.00 MB  pool1                           
/dev/loop2  508.00 MB    0.00 KB  512.00 MB  pool1                           
...
...           
-----------------------------------------------------------------------------


The loop1 or loop2 not be deleted from pool1, when resize the size of lvm_pool/lvol001 less than loop0's size.

test successfully.
Comment 8 Ludek Smid 2014-06-13 07:30:24 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Note You need to log in before you can comment on or make changes to this bug.