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.
- 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
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?