-
Notifications
You must be signed in to change notification settings - Fork 23.8k
-
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
lvol module: fails on repeated run #5165
Comments
Could you edit the bug so the formatting is right ( mostly using 4 spaces to handle code correctly ) |
@mscherer Copied from my config:
Can confirm that it fails. Issue is resolved by changing '70G' to '70g'. |
I just tested this against (ansible 1.5 (devel 0a83f74) last updated 2014/02/24 14:32:43 (GMT -500)) and found no issues. I was testing against a recent Debian Wheezy(64-bit) instance creating a 70G LV. I used the following playbook for testing which should have caught what you saw. Unfortunately up to three months has happened while this ticket has been open and many fixes have come through. Please feel free to retest via devel or a more recent version and reopen this issue if you can confirm that the problem is still there.
|
In my previous response I was answering a question that I don't think that you have. The behavior that you are seeing is that when you run for a second time at the same size or larger there is a failure on an existing volume. This is because the second run is trying to resize the volume. You can use a larger(if there is disk space) or a smaller size but the same size will currently fail. So keeping that in mind the module should check if the lvol exists under the expected vg and if it is the same size to exit out nicely stating that there was no changes. @inittab let me know if you think that sounds wonky. |
…e and don't fail. This addresses ansibleGH-5165 and adds the ability to check if a lvol exists. The tests for this don't fit nicely into the current integration tests so they are below. ``` --- - name: remove any existing lv=one of vg=main lvol: lv=one vg=main state=absent - name: remove any existing lv=two of vg=main lvol: lv=two vg=main state=absent - name: check to see if lv=one of vg=main exists lvol: lv=one vg=main state=present ignore_errors: true register: lvol_result0 - name: Assert that we will get a "No size given." assert: that: - "'No size given.' in lvol_result0.msg" - name: create lv=one of vg=main sized 30g lvol: lv=one size=30g vg=main state=present register: lvol_result1 - name: Assert that we made changes." assert: that: - "lvol_result1.changed == True" - name: check to see if lv=one of vg=main exists lvol: lv=one vg=main state=present register: lvol_result2 - name: Assert that we did not make changes." assert: that: - "lvol_result2.changed == False" - name: remove lv=one of vg=main lvol: lv=one vg=main state=absent - name: create lv=two of vg=main sized 30G lvol: lv=two size=30G vg=main state=present register: lvol_result3 - name: Assert that we made changes." assert: that: - "lvol_result3.changed == True" - name: reduce lv=two of vg=main to 15G lvol: lv=two size=15G vg=main state=present register: lvol_result4 - name: Assert that we made changes." assert: that: - "lvol_result4.changed == True" - name: increase lv=two of vg=main to 30G lvol: lv=two size=30G vg=main state=present register: lvol_result5 - name: Assert that we made changes." assert: that: - "lvol_result5.changed == True" - name: create lv=two of vg=main sized 30G when already exists at 30G lvol: lv=two size=30g vg=main state=present register: lvol_result6 - name: Assert that we did not make changes." assert: that: - "lvol_result6.changed == False" - name: remove lv=two of vg=main lvol: lv=two vg=main state=absent ```
Hi, the issue seems to be fixed in 1.4.5. I can run this task over and over without problems (either using g or G as units). I also tried successfully with 1.5 (6fe369f). Closing accordingly. Thanks! |
This is not fixed in my system.
This playbook fails with the output given below: - hosts: trusty5
remote_user: "{{ unpriv_user }}"
sudo: yes
tasks:
- lvol: vg=trusty5-vg lv=test size=100G state=present
- command: lvs --noheadings -o lv_name,size --units G --separator ';' trusty5-vg
register: lvs
- debug: var=lvs
- lvol: vg=trusty5-vg lv=test size=100G state=present
There is a discrepancy between
So The lvol module's docs say that it uses sizes as does A solution would be to lowercase the variable |
This hasn't yet been fixed: discussion on it appears to have moved to: ansible/ansible-modules-extras#196 |
PR ansible#5165 at ansible/ansible-modules-core#5165 adds redirection and capture of stdout during execution of docker-compose. This doesn't necessarily catch all errors, since some are printed to stderr and lost. This extends the redirection to include stderr, and does minor string processing to attempt to find a 'useful' message to present as the final Ansible error.
PR ansible#5165 at ansible/ansible-modules-core#5165 adds redirection and capture of stdout during execution of docker-compose. This doesn't necessarily catch all errors, since some are printed to stderr and lost. This extends the redirection to include stderr, and does minor string processing to attempt to find a 'useful' message to present as the final Ansible error.
PR ansible#5165 at ansible/ansible-modules-core#5165 adds redirection and capture of stdout during execution of docker-compose. This doesn't necessarily catch all errors, since some are printed to stderr and lost. This extends the redirection to include stderr, and does minor string processing to attempt to find a 'useful' message to present as the final Ansible error.
PR #5165 at ansible/ansible-modules-core#5165 adds redirection and capture of stdout during execution of docker-compose. This doesn't necessarily catch all errors, since some are printed to stderr and lost. This extends the redirection to include stderr, and does minor string processing to attempt to find a 'useful' message to present as the final Ansible error.
This task:
name: Create LVs for web2 DRBD
lvol:
vg=sistema
lv=drbd_web2
size=40G
state=present
Will create the mentioned LV on the first run, and fail in the next runs with:
failed: [patty] => {"err": " New size (10240 extents) matches existing size (10240 extents)\n Run `lvreduce --help' for more information.\n", "failed": true, "item": "", "rc": 3}
msg: Unable to resize drbd_web2 to 40G
Whereas this one, will work without problems:
name: Create LVs for web1 DRBD
lvol:
vg=sistema
lv=drbd_web1
size=7G
state=present
Main difference being the size (and name). Anything above 13-15G will fail. I say 13-15 because I could not always reproduce the issue in that range, but always above it.
Running ansible 1.4 against Debian Wheezy.
The text was updated successfully, but these errors were encountered: