Skip to content
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

storage: ext2/3/4 resize function doesn't work #139

Closed
yizhanglinux opened this issue Aug 3, 2020 · 2 comments
Closed

storage: ext2/3/4 resize function doesn't work #139

yizhanglinux opened this issue Aug 3, 2020 · 2 comments

Comments

@yizhanglinux
Copy link
Collaborator

#97 should fix this issue.

#cat resize.yml
---
- hosts: all
  become: true
  vars:
    mount_location: '/opt/test1'
    volume_group_size: '5g'
    volume_size_before: '10g'
    volume_size_after: '15g'
    storage_safe_mode: false

  tasks:
    - include_role:
        name: storage

    - include_tasks: get_unused_disk.yml
      vars:
        min_size: "{{ volume_group_size }}"
        max_return: 1

    - name: Create one LVM logical volume with "{{ volume_size_before }}" under one volume group
      include_role:
        name: storage
      vars:
          storage_pools:
            - name: foo
              disks: "{{ unused_disks }}"
              type: lvm
              volumes:
                - name: test1
                  fs_type: 'ext4'
                  size: "{{ volume_size_before }}"
                  mount_point: "{{ mount_location }}"

    - shell: lsblk | grep foo-test1

    - shell: mount | grep foo-test1

    - include_tasks: verify-role-results.yml

    - name: Change volume_size  "{{ volume_size_after }}"
      include_role:
        name: storage
      vars:
          storage_pools:
            - name: foo
              type: lvm
              disks: "{{ unused_disks }}"
              volumes:
                - name: test1
                  fs_type: 'ext4'
                  size: "{{ volume_size_after }}"
                  mount_point: "{{ mount_location }}"

    - shell: lsblk | grep foo-test1

    - shell: mount | grep foo-test1

    - include_tasks: verify-role-results.yml

    - name: Clean up
      include_role:
        name: storage
      vars:
          storage_pools:
            - name: foo
              disks: "{{ unused_disks }}"
              state: absent
              volumes:
                - name: test1
                  size: "{{ volume_size_after }}"
                  mount_point: "{{ mount_location }}"

    - include_tasks: verify-role-results.yml
@pcahyna
Copy link
Member

pcahyna commented Aug 13, 2020

@yizhanglinux why is volume_group_size smaller than volume_size_before and volume_size_after ?

pcahyna added a commit to pcahyna/storage that referenced this issue Aug 13, 2020
Based on @yizhanglinux's code in linux-system-roles#139.

Remove a disabled resize test from tests_lvm_errors where it does not belong
anymore.
dwlehman pushed a commit to dwlehman/storage that referenced this issue Aug 13, 2020
Based on @yizhanglinux's code in linux-system-roles#139.

Remove a disabled resize test from tests_lvm_errors where it does not belong
anymore.
@pcahyna
Copy link
Member

pcahyna commented Aug 13, 2020

Fixed in #97

@pcahyna pcahyna closed this as completed Aug 13, 2020
guazhangRH pushed a commit to guazhangRH/storage that referenced this issue Aug 17, 2020
Based on @yizhanglinux's code in linux-system-roles#139.

Remove a disabled resize test from tests_lvm_errors where it does not belong
anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants