-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: Support for creating volumes without a FS #400
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #400 +/- ##
==========================================
- Coverage 13.67% 13.66% -0.01%
==========================================
Files 8 8
Lines 1733 1734 +1
Branches 79 79
==========================================
Hits 237 237
- Misses 1496 1497 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
ca2930a
to
494ce56
Compare
tests/tests_change_fs.yml
Outdated
volumes: | ||
- name: test1 | ||
size: "{{ volume_size }}" | ||
fs_type: None |
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.
Does this require storage_safe_mode: false
? Seems kinda dangerous
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.
Yes, it does. In code the behavior extends the functionality of _reformat
method which handles the safe_mode
.
Still, fs_type: None
'creation' on empty device will work even with safe_mode
on since it is a no-op.
I have added the safe_mode requirement into the commit message, worth mentioning there.
What happens now if the fs_type is not specified? e.g. if you use storage_pools:
- name: foo
disks: "{{ unused_disks }}"
volumes:
- name: test1
size: "{{ volume_size }}" what happens? Does the role do nothing? Does it remove the fs? Does it create a volume with no fs? What happens when a user has a playbook with the above, which was working and creating file systems with fs_type I think a better option to avoid breaking the api is to use a special value for fs_type e.g. |
Using None is in this case recognized and processed differently than when For idempotency reasons we already have to be able to identify the situations when some variable is omitted. When that happens, any value found (on possibly already existing device) should remain unchanged. Otherwise, for example running the role over pre-existing encrypted volume without |
494ce56
to
1c70a5a
Compare
The way the current role (current contents of |
We are currently using |
1c70a5a
to
191d17b
Compare
Using ansible 'false' equivalents might be interchangeable with None, so based on discussion with vtrefny I have changed the string from None to all case variations of |
191d17b
to
a919bd4
Compare
@@ -143,6 +143,7 @@ variables: | |||
This indicates the desired file system type to use, e.g.: "xfs", "ext4", "swap". | |||
The default is determined according to the OS and release | |||
(currently `xfs` for all the supported systems). | |||
Use "unformatted" if you do not want file system to be present. |
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.
or maybe this should be "unconfigured"
?
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.
Not sure how we note destructive operations elsewhere, but seems to me like we should say something like **WARNING**: Using "unconfigured" on an existing filesystem will remove the filesystem.
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.
Thanks. The correct value is actually 'unformatted' in the code. I made sure the value is unified.
I have also added a warning note into the README.
a919bd4
to
cd84a91
Compare
Currently whenever volume is created without fs_type specification, a filesystem of default type (i.e. xfs) is automatically put on it. This change allows user to prevent FS creation by explicitly using "unformatted" value as a fs_type option. In the same manner it also allows to remove an existing FS. To be able to do that the safe mode has to be off.
cd84a91
to
c320742
Compare
ok - I also did a test with storage_pools:
- name: foo
disks: "{{ unused_disks }}"
volumes:
- name: test1
size: "{{ volume_size }}"
fs_type: unformatted i.e. create a volume without an FS - it worked fine |
Currently whenever volume is created without fs_type specification, a filesystem of default type (i.e. xfs) is automatically put on it.
This change allows user to prevent FS creation by using "unformatted" value as a fs_type option. In the same manner it also allows to remove an existing FS. To be able to do that the safe mode has to be off.
Enhancement:
Reason:
Result:
Issue Tracker Tickets (Jira or BZ if any):