LVM : can't create 2 LVs with the same name on 2 differents VGs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Triaged
|
Medium
|
Unassigned | ||
3.3 |
Won't Fix
|
Medium
|
Unassigned | ||
3.4 |
Won't Fix
|
Medium
|
Unassigned | ||
3.5 |
Won't Fix
|
Medium
|
Unassigned | ||
3.6 |
Triaged
|
Medium
|
Unassigned |
Bug Description
Hi,
Using MAAS 2.4.2 (7034-g2f5deb8b
I have 2 LVM VGs created : vg0 and vg1. When I try to add a logical volume name "lv0" on each (which is perfectly correct), it works fine for the first one, but the second one silently fails, and MAAS logs the following trace. I expect MAAS to accep vg0-lv0 and vg1-lv0 without erroring out.
Thanks !
2018-12-20 10:27:53 maasserver.
Traceback (most recent call last):
File "/usr/lib/
File "/usr/lib/
return target()
File "/usr/lib/
task()
File "/usr/lib/
task()
--- <exception caught here> ---
File "/usr/lib/
result = inContext.theWork()
File "/usr/lib/
File "/usr/lib/
return self.currentCon
File "/usr/lib/
return func(*args,**kw)
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
return func_outside_
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
return func(*args, **kwds)
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
return getattr(
File "/usr/lib/
File "/usr/lib/
return super(VirtualBl
File "/usr/lib/
File "/usr/lib/
raise ValidationError
Changed in maas: | |
status: | New → Triaged |
Changed in maas: | |
milestone: | none → 3.3.0 |
importance: | Undecided → Medium |
Changed in maas: | |
milestone: | 3.3.0 → 3.4.0 |
Changed in maas: | |
milestone: | 3.4.0 → 3.4.x |
Changed in maas: | |
milestone: | 3.4.x → 3.5.x |
no longer affects: | maas/3.3 |
This happens because BlockDevice has a unique_together on (node,name).
In this case the name would be the same, but since these are two VirtualBlockDevices with a different filesystem_group it's actually ok.
I think we need to drop the unique index and add an explicit check in BlockDevice.save() for it, and override it in VirtualBlockDev ice.save( ) so that it takes into account the filesystem_group as well.