tests: (lvm_setup.yml), don't shrink lvol

when rerunning lvm_setup.yml on existing cluster with OSDs already
deployed, it fails like following:

```
fatal: [osd0]: FAILED! => changed=false
  msg: Sorry, no shrinking of data-lv2 to 0 permitted.
```

because we are asking `lvol` module to create a volume on an empty VG
with size extents = `100%FREE`.

The default behavior of `lvol` is to shrink the volume if the LV's current
size is greater than the requested size.

Given the requested size is calculated like this:

`size_requested = size_percent * this_vg['free'] / 100`

in our case, it is similar to:

`size_requested = 100 * 0 / 100` which basically means `0`

So the current LV size is well greater than the requested size which
leads the module to attempt to shrink it to 0 which isn't obviously now
allowed.

Adding `shrink: false` to the module calls fixes this issue.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/5582/head
Guillaume Abrioux 2020-07-22 01:51:20 +02:00
parent 18e3c7a0a2
commit 218f4ae361
1 changed files with 3 additions and 0 deletions

View File

@ -35,11 +35,13 @@
vg: test_group vg: test_group
lv: data-lv1 lv: data-lv1
size: 50%FREE size: 50%FREE
shrink: false
- name: create logical volume 2 - name: create logical volume 2
lvol: lvol:
vg: test_group vg: test_group
lv: data-lv2 lv: data-lv2
size: 100%FREE size: 100%FREE
shrink: false
- name: partition "{{ pv_devices[1] | default('/dev/sdc') }}"for journals - name: partition "{{ pv_devices[1] | default('/dev/sdc') }}"for journals
parted: parted:
device: "{{ pv_devices[1] | default('/dev/sdc') }}" device: "{{ pv_devices[1] | default('/dev/sdc') }}"
@ -69,3 +71,4 @@
vg: journals vg: journals
lv: journal1 lv: journal1
size: 100%FREE size: 100%FREE
shrink: false