Description of problem: With the current gdeploy i see that if there is already an existing vg, vgcreate does not fail,instead it just extends the vg. Version-Release number of selected component (if applicable): gdeploy-2.0.1-7.el7rhgs.noarch How reproducible: Always Steps to Reproduce: 1. Create a vg with name RHGS_vg1 by running the command 'vgcreate RHGS_vg1 /dev/vdb' 2. In the vg section of hc.conf file give a different disk name i.e /dev/vdc 3. Now run hc.conf file by running the command 'gdeploy -c hc.conf' Actual results: I see that vgcreate does not fail instead the vg gets extended with the new disk given. Expected results: vgcreate should fail with error 'vg already exists' Additional info:
Following is the code where the bug exists "/usr/lib/python2.7/site-packages/ansible/modules/extras/system/glusterfs/vg.py" def vg_presence_check(self, vg): rc, out, err = self.run_command('vgdisplay', ' ' + vg) ret = 0 if self.action == 'create' and not rc: self.action = 'extend' self.op = 'vgextend' return elif self.action == 'extend' and rc: self.action = 'create' self.op = 'vgcreate' return elif self.action == 'remove' and rc: self.module.exit_json(changed=changed, rc=1, msg="%s Volume Group Doesn't Exists!" % disk) else: ret = 1 return ret
Is there an option in vg section to indicate if user wants to extend or create?
Yes. [vg] action=extend
Commit: https://github.com/gluster/gdeploy/commit/c7c81fe fixes the issue.
Verified and works fine with build gdeploy-2.0.2-10.el7rhgs.noarch. vgcreate fails with the error, "failed: [host_name] (item={u'brick': u'/dev/sdd', u'vg': u'RHGS_vg1'}) => {"changed": false, "failed": true, "item": {"brick": "/dev/sdd", "vg": "RHGS_vg1"}, "msg": "A volume group called RHGS_vg1 already exists", "rc": 1}"
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2777