-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Module][1717]new_module_zfs_resize #1767
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not have thought to make this into an object. Nicely done!
) | ||
else: | ||
if verbose: | ||
os.remove(tmp_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know tmp_file is being removed inside get_full_output, I would recommend deleting the tmp_file in this flow so other people reading the code will know for sure, instead of checking that other function.
mount_point : str | ||
The folder where the zfs is mount | ||
""" | ||
rc, stdout, stderr = module.run_command("df") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
df is the recommended method to list mount points and their corresponding data set. I double- checked, and other than df, linux version allowed mount to make the same list, but that is not true for USS/Unix... df was the official list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments on the documentation. Will continue with the review later. I really like how the module is shaping up, good work!
plugins/module_utils/zfsadm.py
Outdated
operation : str | ||
Whether the operation to execute is grow or shrink | ||
size : int | ||
Size to be assign to the zfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Size to be assign to the zfs | |
Size to be assigned to the zfs |
plugins/module_utils/zfsadm.py
Outdated
rc : int | ||
The rc of the execution of command. | ||
stdout : str | ||
The stout of the execution of command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stout of the execution of command. | |
The stdout of the execution of command. |
plugins/module_utils/zfsadm.py
Outdated
stderr : str | ||
The stderr of the execution of command. | ||
cmd_str : str | ||
The full command that was execute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The full command that was execute. | |
The full command that was executed. |
plugins/modules/zos_zfs_resize.py
Outdated
type: str | ||
size: | ||
description: | ||
- The approximate size of the data set after the resizing is performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather say something like
- The approximate size of the data set after the resizing is performed. | |
- The desired size of the data set after the resizing is performed. | |
- The size might be different than originally specified, depending on available space when performing shrink operations. | |
- If size is in k (kilobytes) the module will round up to 8K boundary. |
Given what says in the zfsadm documentation.
plugins/modules/zos_zfs_resize.py
Outdated
no_auto_increment: | ||
description: | ||
- Option to not allow auto increase on shrinking process. | ||
- When set to C(true), If during the shrinking process of a zfs aggregate more space is needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- When set to C(true), If during the shrinking process of a zfs aggregate more space is needed | |
- When set to C(true), if during the shrinking process of a zfs aggregate more space is needed |
plugins/modules/zos_zfs_resize.py
Outdated
default: false | ||
verbose: | ||
description: | ||
- Determines if verbose output should be returned from the underlying utility used by this module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is better to not mention the underlying utility per se, but better to mention it like in zos_operator.
- Determines if verbose output should be returned from the underlying utility used by this module. | |
- Return diagnostic messages that describes the module's execution. |
plugins/modules/zos_zfs_resize.py
Outdated
default: false | ||
trace_destination: | ||
description: | ||
- Determines the uss path or dataset to insert the full trace of operation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Determines the uss path or dataset to insert the full trace of operation. | |
- Determines the uss path or dataset to dump the full trace of operation. |
SUMMARY
First draft on support zfs resizing module
Fixes #1717
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
### module_util/zfsadm
As the aggregate_name is common for activities using command zfsadm, reason to use in the init function and the module to execute any command, the class is expecting to grow for other modules.
Function grow_shrink
Execute the principal function for the module resize, waiting on the confirmation of operation and the extra instructions.
### modules/zfs_resize
Function found_mount_target
Function to validate if the zfs_dataset exist and get the USS mount_point for the response
Function get_size_and_free parsing function for the response of free and use size of the zfs dataset
Function create_command function to set extra information to execute the resize
output