Error: unable to parse value for 'vgname'

Blinkiz

Renowned Member
Jan 23, 2010
32
1
73
Stockholm Sweden
Trying to add an existing volume group to Proxmox VE 1.5.

pix1.png

When trying to add it, I get the error:
Code:
[B]Error: unable to parse value for 'vgname'[/B]
Here is my output from vgs:
Code:
  VG   #PV #LV #SN Attr   VSize   VFree  
  pve    1   3   0 wz--n-   6.89G 888.00M
  vg     1  13   0 wz--n- 419.05G 204.05G
Output from vgdisplay on vg:
Code:
  --- Volume group ---
  VG Name               vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  17
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                13
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               419.05 GB
  PE Size               4.00 MB
  Total PE              107277
  Alloc PE / Size       55040 / 215.00 GB
  Free  PE / Size       52237 / 204.05 GB
  VG UUID               JTQTZQ-NFzr-pjKn-xrrc-Bub2-k8bt-FVqPBh
Output when running the console program pvesm:
Can write whatever at --vgname parameter. Same error each time.
Code:
# pvesm add vg6 lvm --vgname vg
unable to parse value for 'vgname'
  • Running with 2.6.32 kernel.
  • "vg" is in a encrypted container at /dev/sda4. Opened with dm-crypt+luks into /dev/mapper/vm. vgscan and then trying to add it in proxmox.
  • Logical volumes is inactive in "vg". No problem activating them and working with the volume group from console.
  • Tried different storages names. It does not matter. Same error message.
 
Last edited:
Output when running the console program pvesm:
Can write whatever at --vgname parameter. Same error each time.
Code:
# pvesm add vg6 lvm --vgname vg
unable to parse value for 'vgname'

Same problem here - seems like there is a bug in
Code:
 PVE::Storage::parse_lvm_name:
1241:        if ($name !~ m/^[a-z][a-z0-9\-\_\.]+[a-z0-9]$/i) {
1242:            return undef if $noerr;
1243:            die "lvm name '$name' contains illegal characters\n";
1244         }
The regex requires a vg name of at least 3 characters, so "vg" does not work here. This patch fixes the regex:

Code:
- if ($name !~ m/^[a-z][a-z0-9\-\_\.]+[a-z0-9]$/i) {
+ if ($name !~ m/^[a-z][a-z0-9]*([a-z0-9\-\_\.]+[a-z0-9])?$/i) {
 
Yeah, also found this regex today.
Fixed the problem at console level. But adding from webgui still does not work for me.

Wonder if there exist any special reason why three or more characters is needed in the name of a volume group? I have always just had two and it has worked great.
 
Many thanks for that bug report - i guess the correct fix is

Code:
-       if ($name !~ m/^[a-z][a-z0-9\-\_\.]+[a-z0-9]$/i) {
+       if ($name !~ m/^[a-z][a-z0-9\-\_\.]*[a-z0-9]$/i) {

will upload the fix on monday.