Project

General

Profile

Actions

Bug #36283

closed

--journal-size flag broken when less than 1GB

Added by Alfredo Deza over 5 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

If the --journal-size for lvm batch is used with less than 1GB the command breaks:

TASK [ceph-osd : use ceph-volume lvm batch to create filestore osds] ***********
task path: /home/jenkins-build/build/workspace/ceph-ansible-scenario/roles/ceph-osd/tasks/scenarios/lvm-batch.yml:3
Monday 01 October 2018  19:03:56 +0000 (0:00:00.093)       0:09:41.832 ******** 
fatal: [osd0]: FAILED! => {
    "changed": true, 
    "cmd": [
        "ceph-volume", 
        "--cluster", 
        "ceph", 
        "lvm", 
        "batch", 
        "--filestore", 
        "--yes", 
        "--crush-device-class", 
        "test", 
        "--journal-size", 
        "100", 
        "/dev/sdb", 
        "/dev/sdc" 
    ], 
    "delta": "0:00:00.692538", 
    "end": "2018-10-01 19:03:59.096335", 
    "rc": 1, 
    "start": "2018-10-01 19:03:58.403797" 
}

STDOUT:

Running command: /usr/sbin/vgcreate --force --yes ceph-filestore-3d39ac0e-7fae-40d8-9c75-2d8fad08a94b /dev/sdb
 stdout: Physical volume "/dev/sdb" successfully created.
 stdout: Volume group "ceph-filestore-3d39ac0e-7fae-40d8-9c75-2d8fad08a94b" successfully created
Running command: /usr/sbin/vgcreate --force --yes ceph-filestore-fb33b35a-d836-48f7-9a69-5095f86892a1 /dev/sdc
 stdout: Physical volume "/dev/sdc" successfully created.
 stdout: Volume group "ceph-filestore-fb33b35a-d836-48f7-9a69-5095f86892a1" successfully created

STDERR:

Traceback (most recent call last):
  File "/sbin/ceph-volume", line 6, in <module>
    main.Volume()
  File "/usr/lib/python2.7/site-packages/ceph_volume/main.py", line 40, in __init__
    self.main(self.argv)
  File "/usr/lib/python2.7/site-packages/ceph_volume/decorators.py", line 59, in newfunc
    return f(*a, **kw)
  File "/usr/lib/python2.7/site-packages/ceph_volume/main.py", line 151, in main
    terminal.dispatch(self.mapper, subcommand_args)
  File "/usr/lib/python2.7/site-packages/ceph_volume/terminal.py", line 182, in dispatch
    instance.main()
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/main.py", line 40, in main
    terminal.dispatch(self.mapper, self.argv)
  File "/usr/lib/python2.7/site-packages/ceph_volume/terminal.py", line 182, in dispatch
    instance.main()
  File "/usr/lib/python2.7/site-packages/ceph_volume/decorators.py", line 16, in is_root
    return func(*a, **kw)
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/batch.py", line 265, in main
    self.execute(args)
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/batch.py", line 151, in execute
    strategy.execute()
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/strategies/filestore.py", line 147, in execute
    journal_lv_extents = device_vg.sizing(size=self.journal_size.gb.as_int())['extents']
  File "/usr/lib/python2.7/site-packages/ceph_volume/api/lvm.py", line 1057, in sizing
    size = int(self.free / parts)
TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'

Because self.journal_size.gb.as_int() would return something like 0.097 (for 100 megabytes) which would make the "if" clause
not execute because Python treats 0 as a false.

That "if" condition should be changed to an if size is not None

Actions #1

Updated by Alfredo Deza over 5 years ago

  • Description updated (diff)
Actions #2

Updated by Guillaume Abrioux over 4 years ago

still seeing this error in ceph-ansible CI :

https://2.jenkins.ceph.com/job/ceph-ansible-prs-centos-non_container-filestore_to_bluestore/11/consoleFull#6685120064574abcf-086e-4053-9702-6f4b34086ae8

fatal: [osd2]: FAILED! => changed=true 
cmd:
- ceph-volume
- --cluster
- ceph
- lvm
- batch
- --filestore
- --yes
- --journal-size
- '100'
- /dev/sda
- /dev/sdb
- --db-devices
- /dev/sdc
delta: '0:00:00.799728'
end: '2019-12-10 16:18:44.451500'
msg: non-zero return code
rc: 1
start: '2019-12-10 16:18:43.651772'
stderr: |-
Running command: /usr/sbin/vgcreate -s 1G --force --yes ceph-filestore-3e809a9d-0634-4efa-bdc5-0560c30d069b /dev/sda
stdout: Physical volume "/dev/sda" successfully created.
stdout: Volume group "ceph-filestore-3e809a9d-0634-4efa-bdc5-0560c30d069b" successfully created
Running command: /usr/sbin/vgcreate -s 1G --force --yes ceph-filestore-c1242d8c-7863-4b5a-8c2f-fe74ce47ffcd /dev/sdb
stdout: Physical volume "/dev/sdb" successfully created.
stdout: Volume group "ceph-filestore-c1242d8c-7863-4b5a-8c2f-fe74ce47ffcd" successfully created
Traceback (most recent call last):
File "/sbin/ceph-volume", line 9, in &lt;module&gt;
load_entry_point('ceph-volume==1.0.0', 'console_scripts', 'ceph-volume')()
File "/usr/lib/python2.7/site-packages/ceph_volume/main.py", line 38, in init
self.main(self.argv)
File "/usr/lib/python2.7/site-packages/ceph_volume/decorators.py", line 59, in newfunc
return f(*a, **kw)
File "/usr/lib/python2.7/site-packages/ceph_volume/main.py", line 149, in main
terminal.dispatch(self.mapper, subcommand_args)
File "/usr/lib/python2.7/site-packages/ceph_volume/terminal.py", line 194, in dispatch
instance.main()
File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/main.py", line 40, in main
terminal.dispatch(self.mapper, self.argv)
File "/usr/lib/python2.7/site-packages/ceph_volume/terminal.py", line 194, in dispatch
instance.main()
File "/usr/lib/python2.7/site-packages/ceph_volume/decorators.py", line 16, in is_root
return func(*a, **kw)
File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/batch.py", line 325, in main
self.execute()
File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/batch.py", line 288, in execute
self.strategy.execute()
File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/strategies/filestore.py", line 146, in execute
journal_lv_extents = device_vg.sizing(size=self.journal_size.gb.as_int())['extents']
File "/usr/lib/python2.7/site-packages/ceph_volume/api/lvm.py", line 644, in sizing
size = int(self.free / parts)
TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'
stderr_lines: &lt;omitted&gt;
stdout: ''
stdout_lines: &lt;omitted&gt;
Actions #3

Updated by Jan Fajerski over 3 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 34740
Actions #4

Updated by Jan Fajerski over 3 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF