Status: New
Owner: ----

New issue 347 by [email protected]: can't grow ganeti disks on lvm pv's with < 1MB physical extent size
http://code.google.com/p/ganeti/issues/detail?id=347

What software version are you running? Please provide the output of "gnt-
cluster --version" and "gnt-cluster version".

What distribution are you using? CentOS 5

What steps will reproduce the problem?
1. Have ganeti use an LVM group with a PE size of 64KB
2. Run gnt-instance grow-disk foobar 0 10g

What is the expected output? What do you see instead?
I would expect the operation to succeed but it fails with:

2013-01-15 16:03:37,934: gnt-instance grow-disk pid=24468 cli:2020 INFO run with arguments '-d asktest1 0 10g' 2013-01-15 16:03:55,554: gnt-instance grow-disk pid=24468 cli:2029 ERROR Error during command processing
Traceback (most recent call last):
File "/opt/python-2.5/lib/python2.5/site-packages/ganeti/cli.py", line 2025, in GenericMain
    result = func(options, args)
File "/opt/python-2.5/lib/python2.5/site-packages/ganeti/client/gnt_instance.py", line 651, in GrowDisk
    SubmitOrSend(op, opts)
File "/opt/python-2.5/lib/python2.5/site-packages/ganeti/cli.py", line 1840, in SubmitOrSend
    return SubmitOpCode(op, cl=cl, feedback_fn=feedback_fn, opts=opts)
File "/opt/python-2.5/lib/python2.5/site-packages/ganeti/cli.py", line 1817, in SubmitOpCode
    reporter=reporter)
File "/opt/python-2.5/lib/python2.5/site-packages/ganeti/cli.py", line 1798, in PollJob
    return GenericPollJob(job_id, _LuxiJobPollCb(cl), reporter)
File "/opt/python-2.5/lib/python2.5/site-packages/ganeti/cli.py", line 1620, in GenericPollJob
    errors.MaybeRaise(msg)
File "/opt/python-2.5/lib/python2.5/site-packages/ganeti/errors.py", line 486, in MaybeRaise
    raise errcls(*args)
OpExecError: Grow request failed to node foo.bar: Error while executing backend function: integer division or modulo by zero
Failure: command execution error:
Grow request failed to node foo.bar: Error while executing backend function: integer division or modulo by zero


Please provide any additional information below.
The issue appears to be because LogicalVolume.Attach in bdev.py is calling lvs and specifying a unit of megabytes (which returns 0.06 for a 64k PE size) that is then converted to an integer resulting in the value 0. The exception is caused in LogicalVolume.Grow when amount amount is %'d by full_strip_size the value of which is 0. Attached is a patch that uses kb for the units of pe_size and in Grow() converts 'amount' from mb into kb.

Attachments:
        pe_size_units.patch  918 bytes

Reply via email to