-
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
storage: role doesn't support 78 characters' length for volume name #84
Comments
@yizhanglinux What platform are you running ansible-playbook on? What version of ansible? What platform are you trying to configure storage on? What version of the storage role are you using? |
I have tried running the latest master storage role - ansible host is fedora 31 with ansible 2.9.6 - managed host fedora 31 and centos 7 - in both cases I get past - name: get required packages
blivet:
pools: "{{ _storage_pools }}"
volumes: "{{ _storage_volumes }}"
use_partitions: "{{ storage_use_partitions }}"
disklabel_type: "{{ storage_disklabel_type }}"
packages_only: true
register: package_info it should not be trying to set up a volume - with |
Hi @richm The error is from: https://github.com/linux-system-roles/storage/blob/master/library/blivet.py#L339 , seems it's one limitation from Blivet.new_lv |
If you have it handy, the /tmp/blivet.log would be helpful. Blivet does limit names for new devices to 96 characters, so your name should be acceptable. Are you sure the disk has space for an 80 GiB volume? |
I retest it on the same server with fresh installed RHEL-7.8, but cannot reproduce it now. |
@yizhanglinux can you please add a test for this, or modify an existing test (i.e. use a longer volume name in an existing test)? |
Sure, will try it next week. |
Reopen this issue as I reproduced this issue again. playbook
$ ansible-playbook --flush-cache -i inventory tests/temp.yml -vvvv
blivert.log
|
From my testing, I found the rules for VolumeGroup and LogicalVolume name length during lvm creating.
Will follow above rules to design test cases for vg/lv name length |
Length of VG and LV names is intentionally limited to 55 characters by blivet. According to the LVM developers, vgname + lvname is limited to 126 characters minus the number of hyphens, and possibly minus up to another 8 characters in some unspecified set of situations. Instead of figuring all of that out, no one gets a vg or lv name longer than 55. |
To prevent user confusion from generic error message I have included more information into the message. |
playbook:
hosts: all
become: true
vars:
volume_group_size: '10g'
volume_size: '80g'
storage_safe_mode: false
tasks:
include_role:
name: storage
include_tasks: get_unused_disk.yml
vars:
min_size: "{{ volume_group_size }}"
max_return: 2
name: Create three LVM logical volumes under one volume group
include_role:
name: storage
vars:
storage_pools:
- name: foo1
disks: ["{{ unused_disks[0] }}"]
volumes:
- name: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
size: "{{ volume_size }}"
mount_point: '/opt/test1'
name: Clean up
include_role:
name: storage
vars:
storage_pools:
- name: foo1
disks: ["{{ unused_disks[0] }}"]
state: absent
volumes: []
Execution log:
TASK [storage : Apply defaults to pools and volumes [6/6]] **************************************************************************************************************************************************
TASK [storage : debug] **************************************************************************************************************************************************************************************
ok: [localhost] => {
"_storage_pools": [
{
"disks": [
"sdd"
],
"name": "foo1",
"state": "present",
"type": "lvm",
"volumes": [
{
"fs_create_options": "",
"fs_label": "",
"fs_overwrite_existing": true,
"fs_type": "xfs",
"mount_check": 0,
"mount_device_identifier": "uuid",
"mount_options": "defaults",
"mount_passno": 0,
"mount_point": "/opt/test1",
"name": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
"pool": "foo1",
"size": "80g",
"state": "present",
"type": "lvm"
}
]
}
]
}
TASK [storage : debug] **************************************************************************************************************************************************************************************
ok: [localhost] => {
"_storage_volumes": []
}
TASK [storage : get required packages] **********************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"actions": [], "changed": false, "leaves": [], "mounts": [], "msg": "failed to set up volume 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'", "packages": [], "pools": [], "volumes": []}
PLAY RECAP **************************************************************************************************************************************************************************************************
localhost : ok=33 changed=0 unreachable=0 failed=1 skipped=12 rescued=0 ignored=0
The text was updated successfully, but these errors were encountered: