Bug 986747

Summary: ssm: ssm -f doesn't work when creating or adding
Product: Red Hat Enterprise Linux 7 Reporter: Jimmy Pan <jipan>
Component: system-storage-managerAssignee: Lukáš Czerner <lczerner>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Beňas <pbenas>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: ccui, kzhang, pbenas, pstehlik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: system-storage-manager-0.4-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 09:46:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jimmy Pan 2013-07-22 02:41:33 UTC
Description of problem:
ssm -f should answer y to interactive questions, but it doesn't work when in create or add command when removing device from existent 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 add /dev/loop{0,1,2}
3. ssm -f create -p pool2 /dev/loop1
4. ssm -f add -p pool3 /dev/loop2

Actual results:
ssm still ask user to confirm whether remove device from another pool when use create or add command

ssm -f create -p pool2 /dev/loop1
Device '/dev/loop1' is already used in the 'lvm_pool'! Remove (N/y/q) ? N
Device '/dev/loop1' can not be used!!
"Error (2001): Device '/dev/loop1' can not be used!!"

ssm -f add -p pool3 /dev/loop2
Device '/dev/loop2' is already used in the 'lvm_pool'! Remove (N/y/q) ? N
No devices available to use for the 'pool3' pool!
Traceback (most recent call last):
  File "/usr/bin/ssm", line 33, in <module>
    sys.exit(main.main())
  File "/usr/lib/python2.7/site-packages/ssmlib/main.py", line 1485, in main
    args.func(args)
  File "/usr/lib/python2.7/site-packages/ssmlib/main.py", line 1008, in add
    PR.check(PR.NO_DEVICES, args.pool.name)
  File "/usr/lib/python2.7/site-packages/ssmlib/problem.py", line 275, in check
    raise exc(message)
  File "/usr/lib/python2.7/site-packages/ssmlib/problem.py", line 108, in __init__
    super(NoDevice, self).__init__(msg, errcode)
NameError: global name 'NoDevice' is not defined


Expected results:
Devices should be removed without confirmation and used to create the new pool

Additional info:

Comment 2 Lukáš Czerner 2013-07-31 11:12:04 UTC
This was fixed upstream with ea0d52abdfaa90b727f31bb81770951738281439.

-Lukas

Comment 3 Lukáš Czerner 2013-07-31 11:17:17 UTC
Correction, the trace was fixed by that commit. However you'll be still prompted even though -f has been provided.

Problem with making 'force' to work for everything is that we're actually using stack of tools and in this case you usually want to 'force' only the removal. However what if you're creating a file system, do you want to force it as well ? There is actually no way to tell.

No sure how to resolve this right now...

-Lukas

Comment 4 Lukáš Czerner 2013-08-06 13:40:56 UTC
Fixed upstream with https://sourceforge.net/p/storagemanager/code/ci/bb76641a30ff428021df6f99b0f3e32211e1e9a6/

-Lukas

Comment 5 Lukáš Czerner 2013-08-08 12:29:59 UTC
Building in system-storage-manager-0.4-1.el7

Comment 8 Petr Beňas 2013-10-31 16:14:35 UTC
Reproduced in system-storage-manager-0.3-1.el7.noarch and verified in system-storage-manager-0.4-1.el7.noarch.

Comment 9 Ludek Smid 2014-06-13 09:46:08 UTC
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.