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

Insufficient space when lv size matches vg #13

Closed
tabowling opened this issue Nov 24, 2018 · 4 comments
Closed

Insufficient space when lv size matches vg #13

tabowling opened this issue Nov 24, 2018 · 4 comments
Milestone

Comments

@tabowling
Copy link
Contributor

Playbook fails when lv size is equal to vg size.

TASK [linux-system-roles.storage : Make sure LV exists] ***************************************************************************************************************************
fatal: [rhel7]: FAILED! => {"changed": false, "err": "  Volume group \"composer\" has insufficient free space (5119 extents): 5120 required.\n", "msg": "Creating logical volume 'composer' failed", "rc": 5}

[root@rhel7 ~]# vgs
  VG       #PV #LV #SN Attr   VSize   VFree  
  composer   1   0   0 wz--n- <20.00g <20.00g
  rhel       1   2   0 wz--n-  <7.00g      0 

Playbook used was:

- hosts: all
  become: yes
  become_method: sudo
  become_user: root

  vars:
    use_partitions: false
  tasks:
    - name: Configure Composer Storage
      include_role:
        name: linux-system-roles.storage
      vars:
        storage_pools:
          - name: composer
            disks: ['vdb']
            # type: lvm
            state: present
            volumes:
              - name: composer
                size: 20G
                # type: lvm
                # fs_type: xfs
                fs_label: "composer"
                mount_point: '/var/lib/lorax/composer'
@dwlehman
Copy link
Collaborator

IMO this is an LVM bug, and they've agreed there should be an option to interpret size as "up to this size" for several years now, but no code has been written. We can try to handle this in the role, but it will take a bit of work (which is fraught with danger due to guesswork).

@pcahyna
Copy link
Member

pcahyna commented Jan 9, 2019

Is there any bug actually? The output <20.00g indicates there is not exactly 20g of space, it is rounded and there is actually less space than that. I think it is better to let the role fail than let it create a smaller volume than what you asked for.

@dwlehman dwlehman added this to the 2.0 milestone Aug 24, 2020
@dwlehman
Copy link
Collaborator

The percentage-based size work (#39) will address this issue in another way, but I am also open to truncating sizes as needed up to some agreed-upon percentage to make things work seamlessly without requiring the user to predict the total space used by metadata .

When I wrote blivet many years ago I was determined to create volumes/devices the exact size requested by the user. Over the years I have gradually shifted to the view that it does not strictly matter for any tangible reason whether you get the full size you request or whether the volume you get is actually short -- even by as much as 100 MiB in most cases. Of course not everyone will be pleased by such a convention, but in this role we have a mandate to make it easy to use for the majority of cases. We could also introduce a switch to enable/disable size fuzzing if we want to try to please everyone.

@vojtechtrefny
Copy link
Collaborator

Closed via #199

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

4 participants