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

colon as a delimiter to parse lvm PV is not always working #149

Closed
Ganeti-Issues-Migrator opened this issue Jun 21, 2017 · 22 comments
Closed

Comments

@Ganeti-Issues-Migrator
Copy link

Ganeti-Issues-Migrator commented Jun 21, 2017

Originally reported of Google Code with ID 93.

What software version are you running? Please provide the output of "gnt-
cluster --version" and "gnt-cluster version".
Software version: 2.0.6
Internode protocol: 20
Configuration format: 2000000
OS api version: 10
Export interface: 0

<b>What distribution are you using?</b>
debian testing

<b>What steps will reproduce the problem?</b>
1.create a lvm inside an encrypted disk
2.pvscan => PV /dev/block/254:0   VG vg0
3.create an instance

<b>What is the expected output? What do you see instead?</b>
ganeti will chokes saying...
Can't create block device: Can't compute PV info for vg vg0

<b>Please provide any additional information below.</b>
I was trying to migrate my cluster on an encrypted filesystem so added a
node with whole disk encrypted, fine i can also see the node and its free
disk space with "gnt-node list"! ...but if I try to create a new instance
there I get this error.

but maybe I've isolated the bug because it's very close to this report
about same issue on libvirt, please verify:
https://bugzilla.redhat.com/show_bug.cgi?id=470693

kind regards

Originally added on 2010-03-12 21:52:22 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

This has been fixed in release 2.1.0, see
http://git.ganeti.org/?p=ganeti.git;a=commit;h=96c7a5b0.

I'll backport this to the 2.0 version, in the meantime you could try applying this
patch directly (I know it will be hard if you're using deb packages...).

thanks,
iustin

Originally added on 2010-03-12 22:04:09 +0000 UTC.

Changed State: Started

@Ganeti-Issues-Migrator
Copy link
Author

I tried to only make that diff but maybe it's more like the "domino" game :P also
tried substituting the whole file with the new one and got different errors... I'll
wait the new package, meanwhile I'll continue with unencrypted disks :)

tnk u a lot for your quick answer!! ^_^

Originally added on 2010-03-13 00:43:02 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

mhm... wait a moment... the patch only checks for a ":" and throw the error!
it does not solve the question.

ok, I can do a workaround maybe writing in my /etc/lvm/lvm.conf something like:
filter = [ "a/[^:]*/",  "r|/dev/block|" ]

(I can't say that for sure by now because I've to reboot the server and the w.end is
not the right moment ^_^' ...I'll tell you on Monday, stay tuned!)

but keep in mind in linux we can have devices like this:
/dev/disk/by-path/pci-0000:05:05.0-scsi-0:1:0:0-part1

;P

Originally added on 2010-03-13 09:32:43 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

Ah, I understand now.

The point is that Ganeti should accept and be able to work with PVs that contain ':'
in names. In 2.0 we crash in an ugly way, whereas in 2.1 we just refuse them.
Instead, we should accept an be able to work with them.

Thanks for the clarification, will try to make another patch.

Originally added on 2010-03-13 10:11:27 +0000 UTC.

Added Labels: Type-Enhancement Priority-Medium
Added to Milestone: Release2.1

@Ganeti-Issues-Migrator
Copy link
Author

Actually, going back to the LVM documentation, ':' cannot be used as a character in
device names since lvcreate treats it specially.

E.g., using a fake name for /dev/hdb:
gnte1:~# pvs
  PV         VG    Fmt  Attr PSize   PFree  
  /dev/hd:b  xenvg lvm2 a-   128.00G 125.12G
gnte1:/dev# lvcreate -L 1g -n test xenvg /dev/hd:b
  Physical Volume "/dev/hd" not found in Volume Group "xenvg"

That is because lvcreate uses ':' as a separator between the PV name and the extent
range.

I think the filtering out of ':' is the best option, possible coupled with the
preferred_names setting.

regards,
iustin

Originally added on 2010-03-13 10:31:10 +0000 UTC.

Removed Labels: Type-Enhancement Priority-Medium
Removed from Milestone: Release2.1

@Ganeti-Issues-Migrator
Copy link
Author

ok, unfortunately I cannot confirm right now if the filter actually solve the problem...

but if this is the final solution I suggest to modify the text of the throwed error
adding the hint to modify lvm.conf adding the regex [^:] so the administrators will
immediately know what to do.

[ot]
anyway, but this is not ganeti but lvm2 issue, it does not make sense to me why it is
possible to have PV with names not supported by lvcreate :-D lvm should filter them
out by default! :-S
[/ot]


thanks you again

Originally added on 2010-03-14 00:10:45 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

today I can say the solution for the workaround is:

preferred_names = [ "^/dev/mapper/" ]

inside lvm.conf

kind regards :)

Originally added on 2010-03-15 15:02:29 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

I've just committed patches on both devel-2.1 and devel-2.0 updating the error
message with (small) instructions on updating lvm.conf.

Let me know if you think this is enough - see http://git.ganeti.org/?
p=ganeti.git;a=commitdiff;h=0c7d03416e16c7c00f71f69875e3255ef96f7654.

Originally added on 2010-03-15 16:42:06 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

yeah, definitely :)
good job!

Originally added on 2010-03-15 18:06:59 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

Good, closing the issue then.

thanks,
iustin

Originally added on 2010-03-15 19:18:12 +0000 UTC.

Added Labels: Type-Enhancement Component-UI
Changed State: Fixed
Added to Milestone: Release2.0

@Ganeti-Issues-Migrator
Copy link
Author

Software version: 2.1.6
Internode protocol: 30
Configuration format: 2010000
OS api version: 15
Export interface: 0

What distribution are you using?
debian squeeze

What steps will reproduce the problem?
1.create a lvm inside an encrypted disk
2.pvscan => PV /dev/block/254:0   VG vg0
3.create an instance

-> gnt-instance add --node=node1:node2 -t drbd -s 5GiB -o debootstrap+default ins.stable-link.com

Can't create block device: Some of your PVs have the invalid character ':' in their name, this is not supported - please filter them out in lvm.conf using either 'filter' or 'preferred_names'

Please provide any additional information below.
lines added to /etc/lvm/lvm.conf :

filter = [ "a/[^:]*/",  "r|/dev/block|" ]

preferred_names = [ "^/dev/mapper/" ]

root@node2:/# pvdisplay
  --- Physical volume ---
  PV Name               /dev/block/104:19
  VG Name               xenvg
  PV Size               33.91 GiB / not usable 3.80 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              8681
  Free PE               8681
  Allocated PE          0
  PV UUID               8zIb9V-27tX-roOq-b56i-9OEq-n2QA-t6gk4j


please to excuse me if this is not the correct place for post my question. 

Originally added on 2011-01-17 07:52:34 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

Software version: 2.1.6
Internode protocol: 30
Configuration format: 2010000
OS api version: 15
Export interface: 0

What distribution are you using?
debian squeeze

What steps will reproduce the problem?
1.create a lvm inside an encrypted disk
2.pvscan => PV /dev/block/104:19
3.create an instance

-> gnt-instance add --node=node1:node2 -t drbd -s 5GiB -o debootstrap+default ins.example.com

Can't create block device: Some of your PVs have the invalid character ':' in their name, this is not supported - please filter them out in lvm.conf using either 'filter' or 'preferred_names'

Please provide any additional information below.
lines added to /etc/lvm/lvm.conf :

filter = [ "a/[^:]*/",  "r|/dev/block|" ]

preferred_names = [ "^/dev/mapper/" ]

root@node2:/# pvdisplay
  --- Physical volume ---
  PV Name               /dev/block/104:19
  VG Name               xenvg
  PV Size               33.91 GiB / not usable 3.80 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              8681
  Free PE               8681
  Allocated PE          0
  PV UUID               8zIb9V-27tX-roOq-b56i-9OEq-n2QA-t6gk4j


please to excuse me if this is not the correct place for posting my question.

Originally added on 2011-01-17 07:54:51 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

As described in the commit, we cannot support : in PV names, because : is a special character in lvcreate. In other words, your LVM configuration is "invalid", as it will break lvcreate with explicit PV assignment.

After adding the filter, what does pvscan say? What is actually /dev/block/194:19?

Also, this should be probably discussed on the user list :)

Originally added on 2011-01-17 09:42:01 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

I understand that the LVM configuration is invalid already.  After adding the filter, the problem is still not solved. 

root@node2:~# pvscan
  PV /dev/block/104:19   VG xenvg   lvm2 [33.91 GiB / 33.91 GiB free]
  Total: 1 [33.91 GiB] / in use: 1 [33.91 GiB] / in no VG: 0 [0   ]

Numerous times was removed PV and recreated after adding the filter and preferred_names line to lvm.conf but nothing happens.

fdisk -l

Disk /dev/cciss/c0d1: 36.4 GB, 36414750720 bytes
255 heads, 32 sectors/track, 8716 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x70f6cd68

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d1p3               1        8716    35561264   8e  Linux LVM

P.S
The editing of lvm.conf is also tested under Debian 5.0 and the problem is not solved.

With regards
Vladimir


Originally added on 2011-01-17 11:08:53 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

I understand that the LVM configuration is invalid already.  After adding the filter, the problem is still not solved. 

root@node2:~# pvscan
  PV /dev/block/104:19   VG xenvg   lvm2 [33.91 GiB / 33.91 GiB free]
  Total: 1 [33.91 GiB] / in use: 1 [33.91 GiB] / in no VG: 0 [0   ]

Numerous times was removed PV and recreated after adding the filter and preferred_names line to lvm.conf but nothing happens.

fdisk -l

Disk /dev/cciss/c0d1: 36.4 GB, 36414750720 bytes
255 heads, 32 sectors/track, 8716 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x70f6cd68

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d1p3               1        8716    35561264   8e  Linux LVM

The PV /dev/block/104:19 is created on /dev/cciss/c0d1p3

P.S
The editing of lvm.conf is also tested under Debian 5.0 and the problem is not solved.

With regards
Vladimir



Originally added on 2011-01-17 11:10:23 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

I understand that the LVM configuration is invalid already.  After adding the filter, the problem is still not solved. 

root@node2:~# pvscan
  PV /dev/block/104:19   VG xenvg   lvm2 [33.91 GiB / 33.91 GiB free]
  Total: 1 [33.91 GiB] / in use: 1 [33.91 GiB] / in no VG: 0 [0   ]

Numerous times was removed PV and recreated after adding the filter and preferred_names line to lvm.conf but nothing happens.

fdisk -l

Disk /dev/cciss/c0d1: 36.4 GB, 36414750720 bytes
255 heads, 32 sectors/track, 8716 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x70f6cd68

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d1p3               1        8716    35561264   8e  Linux LVM

The PV /dev/block/104:19 is created on /dev/cciss/c0d1p3

P.S
The editing of lvm.conf is also tested under Debian 5.0 and the problem is not solved.

lines added to /etc/lvm/lvm.conf :

filter = [ "a/[^:]*/",  "r|/dev/block|" ]

preferred_names = [ "^/dev/mapper/" ]


With regards
Vladimir

Originally added on 2011-01-17 11:14:11 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

I believe your LVM filter is invalid. You're not denying names containing : (and in case of neither accept nor reject, the name is accepted), just /dev/block. I think this would work better:

filter = [ "r|:|", "a|.*|"]

Originally added on 2011-01-17 12:01:55 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

It's a nice shot about:

filter = [ "r|:|", "a|.*|"]

root@node2:~# pvdisplay
  "/dev/cciss/c0d1p1" is a new physical volume of "33.91 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/cciss/c0d1p1
  VG Name
  PV Size               33.91 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               piPcN8-SwXe-gd57-sXFf-KSvF-tk0p-OXias7

As you see the PV the output /dev/block/104:19 is disapeared, but when create VG ( vgcreate xenvg /dev/cciss/c0d1p1 ), the output is become the same :

root@node2:~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/block/104:17
  VG Name               xenvg
  PV Size               33.91 GiB / not usable 3.80 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              8681
  Free PE               8681
  Allocated PE          0
  PV UUID               piPcN8-SwXe-gd57-sXFf-KSvF-tk0p-OXias7

P.S
It's only added the ( filter = [ "r|:|", "a|.*|"] ), in lvm.conf, without ( preferred_names ) line.  Where is my mistake, please to explain.

Kind regards
Vladimir
 

Originally added on 2011-01-17 17:16:02 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

With a lot of reading in documentations, I've managed to solve the problem. 
The key was :

preferred_names = [ "^/dev/dm-*/" , "^/dev/cciss/" ]

root@mainframe1:~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/cciss/c0d1p1
  VG Name               xenvg
  PV Size               33.91 GiB / not usable 3.80 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              8681
  Free PE               8681
  Allocated PE          0
  PV UUID               wtjoOE-dGpv-xoVK-pKa1-Bra4-dvRr-PSoO7o

As you the output /dev/block/104:17 has disapeared. So thanks again to iustinp for the given help and time.

Kind regards
Vladimir



Originally added on 2011-01-26 07:48:05 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

With a lot of reading in documentations, I've managed to solve the problem. 
The key was :

preferred_names = [ "^/dev/dm-*/" , "^/dev/cciss/" ]

root@mainframe1:~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/cciss/c0d1p1
  VG Name               xenvg
  PV Size               33.91 GiB / not usable 3.80 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              8681
  Free PE               8681
  Allocated PE          0
  PV UUID               wtjoOE-dGpv-xoVK-pKa1-Bra4-dvRr-PSoO7o

As you the output /dev/block/104:17 has disapeared. So thanks again to iustinp for the given help and time.


In summary the was adding these lines in /etc/lvm/lvm.conf :

preferred_names = [ "^/dev/dm-*/" , "^/dev/cciss/" ]
filter = [ "r|:|", "a|.*|"]


Kind regards
Vladimir


Originally added on 2011-01-26 07:52:21 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

-- Empty comment --

Originally added on 2012-10-22 08:57:07 +0000 UTC.

Changed State: Released

@Ganeti-Issues-Migrator
Copy link
Author

Thanks! 
Exactly same problem here was solved by preferred_names = [ "^/dev/dm-*/" , "^/dev/cciss/" ]

Originally added on 2015-10-29 12:56:34 +0000 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant