bug in lvg module?

337 views
Skip to first unread message

Mark Maas

unread,
Jan 20, 2015, 7:06:19 AM1/20/15
to ansible...@googlegroups.com

Hi List,

I’m trying to create an lvg using the lvg ansible module like so:

- name: Maak een vg-tc
  lvg: vg=vg.osddata.raven pvs=/dev/xvdb,/dev/xvdc state=present

But I’m getting this error back:

failed: [10.220.225.96] => {"err": "  Device /dev/xvdb /dev/xvdc not found (or ignored by filtering).\n  Unable to add physical volume '/dev/xvdb /dev/xvdc' to volume group 'vg.osddata.raven'.\n", "failed": true, "rc": 5}

It seems like it’s looking for a device called ‘/dev/xvdb /dev/xvdc’ instead of two separate devices.

I used the example from:
http://docs.ansible.com/lvg_module.html

Am I calling it wrong or is this a bug?

Thanks,
Mark

Mark Maas

unread,
Jan 20, 2015, 7:33:20 AM1/20/15
to ansible...@googlegroups.com
BTW, using ansible 1.8.2.

Brian Coca

unread,
Jan 20, 2015, 7:36:26 AM1/20/15
to ansible...@googlegroups.com
there is current bug in = option parser, try this:

- name: Maak een vg-tc
lvg:
vg: vg.osddata.raven
pvs: /dev/xvdb,/dev/xvdc
state: present

--
Brian Coca

Mark Maas

unread,
Jan 20, 2015, 7:53:31 AM1/20/15
to ansible...@googlegroups.com

Tried it with this:

- name: Maak een vg-tc
  lvg: 
    vg: vg.osddata.raven
    pvs: /dev/xvdb,/dev/xvdc
    state: present

But still no go:

failed: [10.220.226.90] => {"err": "  Device /dev/xvdb /dev/xvdc not found (or ignored by filtering).\n  Unable to add physical volume '/dev/xvdb /dev/xvdc' to volume group 'vg.osddata.raven'.\n", "failed": true, "rc": 5}
msg: Creating volume group 'vg.osddata.raven' failed

Thanks for looking btw!

On Tuesday, January 20, 2015 at 1:36:26 PM UTC+1, Brian Coca wrote:

there is current bug in = option parser, try this:
1

Mark Maas

unread,
Jan 20, 2015, 7:57:14 AM1/20/15
to ansible...@googlegroups.com

I’ve got a bit more verbosity:

<10.220.226.90> REMOTE_MODULE lvg vg=vg.osddata.raven state=present pvs=/dev/xvdb,/dev/xvdc

looks like the module is getting the correct data?

Mark Maas

unread,
Jan 21, 2015, 1:46:03 AM1/21/15
to ansible...@googlegroups.com
It seems this was indeed a bug:
https://github.com/ansible/ansible-modules-extras/issues/50

But is was closed as fixed on the 6th of november.

So I will need to wait until this bit:
https://github.com/ansible/ansible-modules-extras/commit/664858ec20630a65bbdedbe52b79bd4e61f6ceec

Finds it's way to 1.8.3 or something?

Giovanni Tirloni

unread,
Jan 21, 2015, 8:26:58 AM1/21/15
to ansible...@googlegroups.com
On Tue, 20 Jan 2015 04:06 -0800, Mark Maas <ma...@maas-martin.nl> wrote:
> Hi List,
> I’m trying to create an lvg using the lvg ansible module like so:
> - name: Maak een vg-tc
lvg: vg=vg.osddata.raven pvs=/dev/xvdb,/dev/xvdc state=present
>
> But I’m getting this error back:
> failed: [10.220.225.96] => {"err": " Device /dev/xvdb /dev/xvdc not found (or ignored by filtering).\n Unable to add physical volume '/dev/xvdb /dev/xvdc' to volume group 'vg.osddata.raven'.\n", "failed": true, "rc": 5}
>
> It seems like it’s looking for a device called ‘/dev/xvdb /dev/xvdc’ instead of two separate devices.

It might be because parse_pvs() function is only considering devices
that start with "/dev/dm-".

Try changing it like this in
/usr/lib/python2.7/site-packages/ansible/ansible/modules/extras/system/lvg.py:

def parse_pvs(module, data):
pvs = []
- dm_prefix = '/dev/dm-'
+ dm_prefix = '/dev/'
for line in data.splitlines():
parts = line.strip().split(';')
if parts[0].startswith(dm_prefix):

I've not tested this modification. Does anyone know why it's limiting
only to dm devices?

Giovanni



Reply all
Reply to author
Forward
0 new messages