Bug 990828 - Cannot use "-" (simple dash/minus) character for volume group name in kickstart partitioning
Cannot use "-" (simple dash/minus) character for volume group name in kicksta...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: doc-Installation_Guide (Show other bugs)
All Linux
unspecified Severity low
: rc
: ---
Assigned To: Petr Bokoc
: Documentation
Depends On:
  Show dependency treegraph
Reported: 2013-08-01 01:21 EDT by Gilles Dubreuil
Modified: 2014-05-21 01:54 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-11-26 07:07:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gilles Dubreuil 2013-08-01 01:21:53 EDT
Description of problem:
When partitioning in a Kickstart file with volume group names containing a dash or minus sign, the sign is ignored by anaconda during the build.

The two issues with this are:
1. It's not documented therefore not expected
2. Can it be fixed or is this an anconda limitation?

Version-Release number of selected component (if applicable):

How reproducible:
Steps to Reproduce:
1. Create a kickstart file,
   In the partitioning,
   use a "-" in a volume group name, for instance:
   part pv.2 --ondrive=sda --size=10240
   volgroup cinder-volume --pesize=4096 pv.2
2. Install

Actual results:
The installation will go through without error and will simply remove the character.

Expected results:
Obvioulsy, the "-" character to stay in place and not being removed.
Comment 2 David Cantrell 2013-08-02 10:00:42 EDT
This is a restriction imposed by anaconda and we've been doing this for a very long time.  I think the best way to approach this is to update the documentation.
Comment 3 Petr Bokoc 2013-08-06 12:21:08 EDT
Hello David,

does this restriction apply only to volume group names, or to volume names as well?
Comment 4 pada 2013-08-07 04:30:58 EDT
Unfortunately, the behaviour was different in RHEL 6.0 to 6.3 so I vote for the bug to be fixed instead of the

* fresh systems with volgroup foo-bar created foo-bar as volume group (OK)
* reinstalled systems kept dashes foo-bar in existing volume groups (OK)
* Linux LVM Tools accept dashes inside of volume group names (OK)

RHEL 6.4 shows the following anomalous behaviour and there breaks cobbler "reinstallation" on upgrade from 6.3 to 6.4 wich expected the volume groups to be existing with a dash.

* fresh systems with configured volgroup foo-bar get volume group named foobar (FAIL)
* reinstalled systems with --noformat keep the dash in volume group foo-bar (OK)
* Linux LVM Tools accept dashes inside of volume group names (OK)

This is very inconsistent behaviour (especially the difference between noformat and format), which has been introduced with Release 6.4.

In cannot tell anything about the logical volume names, since we have only been using dashes in our volume group names (for years now) and we would like to continue doing so, since the volumes exist on many systems, automatically installed with cobbler and our cobbler preinstallation scripts expect the data volumes to contain a dash on existing machines. For now we needed to implement a very dirty workaround which renames the volume group back from foobar to foo-bar in the cobbler postinstall section.
Comment 5 pada 2013-08-07 04:48:55 EDT
Yes, logical volume names are also affected.
Dashes get removed from logvol names on fresh RHEL 6.4 installs.
Comment 6 Gilles Dubreuil 2013-08-07 21:20:29 EDT
This limitation actually causes trouble down the road with potentially any system provisionning solution.

For instance, on top of Foreman, I have the case where Openstack Cinder expects a "cinder-volume" to be present for automated installation. Of course Cinder default could be changed but the why not fix the trouble at the bottom of the stack, for good? 

Can someone, please, explain/check why the "-" is an issue in Anaconda and why it cannot be escaped?

Comment 7 A. R. Thomas 2013-08-19 17:39:25 EDT
Here's what I've run into, which can hopefully help others seeking answers.

It appears (not to point fingers) that when lvm creates the new volume group, if there's a "-" in the name, it somehow doubles that up.  (vg_foo-bar becomes vg_foo--bar)

To recreate, create a physical volume (e.g. pv.01), a volume group, and a a logical volume.

vgcreate foo-bar pv.01
lvcreate -L10m foo-bar

The VG Name in vgdisplay and lvdisplay will show as foo-bar but a quick check under /dev/mapper/ will show a dynamic link for foo--bar-lvol0.

udev is understandably confused as a query reports the following:

udev info --query=all --name=/dev/mapper/foo--bar-lvol0 | grep foo
S:  mapper/foo--bar-lvol0
S:  foo-bar/lvol0
S:  disk/by-id/dm-name-foo--bar-lvol0
E:  DM_NAME=foo--bar-lvol0
E:  DM_VG_NAME=foo-bar

So, in summation, I'm not certain what's causing the issue, however I believe when lvm writes the block information, it adds an additional "-" to the VG Name.  It appears Red Hat was trying to protect us by removing "-" from VG names.

As a workaround, you can rename the volume group (vgrename), however you will also need to change your grub.conf and /etc/fstab to reflect.  I'm not a big fan of naming the VG "foo-bar" and then putting "foo--bar" in /etc/fstab as that could be confusing, so I change fstab and grub to point to /dev/foo-bar/root.  The issue there is, the mount command still reports /dev/mapper/foo--bar-root.  It's something you have to live with, unless you can remove "-" from your volumegroup name altogether without issue.
Comment 8 Gilles Dubreuil 2013-08-20 03:15:54 EDT
Thanks, thomas, that's interesting and good to know to help the workaround.

Maybe someone can explain why this is an Anaconda restriction and if there is any way we could ultimately (RFE) see if the "part" parameter can be fully escaped?
Comment 18 Ramon Acedo 2014-05-20 16:14:17 EDT
I'm using RHEL 6.5 provisioned via Foreman with this disk layout template:

clearpart --all --initlabel
part /boot --fstype ext4 --size=150
part swap --recommended
part pv.01 --size=5120
part pv.02 --size=1 --grow
volgroup vg_root pv.01
logvol  /  --fstype=ext4 --vgname=vg_root  --name=lv_root --size=1 --grow --percent=100
volgroup cinder-volumes pv.02

The VG is still created without the "-" and I have to manually "vgrename cindervolumes cinder-volumes" after the systems are provisioned.

Is is possible that some packages need to be updated in the provisioning media created from the current rhel-server-6.5-x86_64-dvd.iso?
Comment 19 Gilles Dubreuil 2014-05-21 01:54:04 EDT
(In reply to Ramon Acedo from comment #18)
> The VG is still created without the "-" and I have to manually "vgrename
> cindervolumes cinder-volumes" after the systems are provisioned.

This was a fix to the documentation not to anaconda.

Note You need to log in before you can comment on or make changes to this bug.