-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new module: AIX Volume Group creating, resizing, removing #30381
Conversation
It is a module to manage Volume Groups to AIX Logical Volume Manager. With this module is able to create, reisize and remove a Volume Group.
@AugustusKling @ColOfAbRiX @DavidWittman @EvanK @LinusU @abulimov @adejoux @agaffney @ahtik @Akasurde @azaghal @dankeder @david_obrien @davixx @dougluce @dsummersl @giovannisciortino @goozbach @groks @haad @hryamzik @jasperla @jhoekx @jsumners @jtyr @kevensen @lberruti @matze @maxamillion @mcv21 @molekuul @mpdehaan @mulby @natefoo @nibalizer @ovcharenko @pmarkham @pyykkis @risaacson @rosmo @saito-hideki @sfromm @srvg @tdtrask @tmshn @xen0l As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add |
Hi, I have some remarks on the module: When a disk is in use by a volumegroup, you exit the module with a fail, If you give a list of disks, the module will fail if even one disk will fail the "usage check" is this wat you want? Checkmode is a mode in Ansible where you check what will be changed when you run the module with these parameters, without actually doing the action. You didn't incorporate this in the module, however you state that you support checkmode. There are limits of how many PP's a disk can contain. An AIX system calulates the PP size from the size of the disk if you do not specify this. why not let the system decide the value of the PP-size if not specified in the playbook? When you are removing a pv from a volumegroup, you do not check if the pv is within this volumegroup, so the command will fail, but the result is correct, the disk is not part of the volumegroup, as you want, you should handle this situation better. Take into account that a volumegroup must be varyon before taking actions on a volumegroup. I hope you can do anything with my remarks. Kind regards, Joris Weijters |
Working on @molekuul remarks. |
@kairoaraujo This PR contains |
fixed suggestion on PR according with standards and PEP8
Removed blank space in the end of line.
135a6df
to
49682f0
Compare
Hi @molekuul I would like ask somethings regarding your remarks
I agree with that point and I'm implementing it.
My approach is wrong, should be the same return for ASM and VG use. IMHO If you give a list of disks and one disk is wrong it should fail and forces the administrator correct the pool and avoid wrong resizes. Anyway, I'm opened to opinions.
I want to implement it, but I'm quite confused how to do it.
Totally agree, I'm changing it.
It is treated by AIX as well, but for sure I do it also.
We will have also this situation when the volume group still having filesystems mounted or open lv. I think is better leave it up to AIX, no?
Including this verification on the top. Kind regards, |
- fixed pep8 and non-written conventions; - fixed RETURN doc indentation for msg; - fixed and improved the physical volume verification; - pp_size, when not specified, is followed from AIX side; - included volume group verification in the top; - included state varyon and varyoff to be easy in playbooks; - removed check_mode
The Check Mode should be implemented the way that if using def state_vg(...):
changed = False
...
if state == 'varyon':
if vg_state is False:
changed = True
if not module.check_mode:
varyonvg_cmd = module.get_bin_path("varyonvg", True)
rc, varyonvg_out, err = module.run_command(
"%s %s" % (varyonvg_cmd, vg))
if rc != 0:
module.failed_json(msg="...", stdout=out, stderr=err)
...
return changed
def main():
if state == 'present':
changed = create_extend_vg(...)
elif state == 'absent':
changed = reduce_vg(...)
elif state == 'varyon' or 'varyoff':
 changed = state_vg(...)
module.exit_json(changed=True, state=state) |
Implemented back the module.check_module to permit be used. Some corrections regarding module.exit_json() and module.fail_json(). Some pep8 and non-written conventions
- ordered option parameters and pep8 compliance - removed exit_json() from functions and moved to main()
pep8, two spaces before function
I will write the integration test for this module as well before merge. |
This comment has been minimized.
This comment has been minimized.
rebuild_merge |
SUMMARY
It is a module to manage Volume Groups to AIX Logical Volume
Manager. With this module is able to create, resize and
remove a Volume Group.
ISSUE TYPE
COMPONENT NAME
aix_lvg
ANSIBLE VERSION
ADDITIONAL INFORMATION
None