Your message dated Thu, 19 Aug 2021 13:29:46 +0200
with message-id <2703017.2mr1OYDnrm@bagend>
and subject line Re: vmdb2: grub fails on an LV image
has caused the Debian Bug report #945581,
regarding vmdb2: grub fails on an LV image
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
945581: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=945581
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: vmdb2
Version: 0.13.2+git20190215-1
Hi,
I pre-created my LV using the same lvcreate syntax that doesn't work from
within vmdb2 (see previous bug filed), and used with the invocation:
% sudo vmdb2 foo-bar-1.vmdb.yml --image /dev/vg0/foo-bar-1-root --verbose
--log=foo-bar-1.vmd.log
The boot loader step in foo-bar-1.vmdb.yml was the default one from the
manual:
- grub: bios
tag: root
console: serial
But the log said:
2019-11-27 11:38:31 INFO Installing GRUB for BIOS
2019-11-27 11:38:31 ERROR Do not understand partition device name
/dev/mapper/vg0-foo--bar--1--root1
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/vmdb/app.py", line 107, in
run_steps_helper
method(step, self.settings, state)
File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 98,
in run
self.install_bios(step, settings, state)
File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 115,
in install_bios
self.install_grub(step, settings, state, grub_package, grub_target)
File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 128,
in install_grub
image_dev = self.get_image_loop_device(root_dev)
File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 204,
in get_image_loop_device
partition_device))
Exception: Do not understand partition device name
/dev/mapper/vg0-foo--bar--1--root1
2019-11-27 11:38:31 INFO Something went wrong, cleaning up!
I remembered I used to be able to work around these kinds of problems in
similar situations by doing sudo losetup /dev/loop0 /dev/$vg/$host-root
and then operating on /dev/loop0. (That's what worked with vmdebootstrap.)
However, with vmdb2, that doesn't work either, the log says:
2019-11-27 11:41:09 INFO Running step: {'mklabel': 'gpt', 'device':
'/dev/loop0'}
2019-11-27 11:41:09 INFO Calling <bound method MklabelStepRunner.run of
<partition_plugin.MklabelStepRunner object at 0x7f4ba4587828>>
2019-11-27 11:41:09 INFO Exec: ['parted', '-s', '/dev/loop0', 'mklabel', 'gpt']
2019-11-27 11:41:09 DEBUG run external command: [['parted', '-s', '/dev/loop0',
'mklabel', 'gpt']]
2019-11-27 11:41:09 INFO Calling <bound method
StepRunnerInterface.run_even_if_skipped of <partition_plugin.MklabelStepRunner
object at 0x7f4ba4587828>>
2019-11-27 11:41:09 INFO Running step: {'mkpart': 'primary', 'device':
'/dev/loop0', 'start': '0%', 'end': '100%', 'tag': 'root'}
2019-11-27 11:41:09 INFO Calling <bound method MkpartStepRunner.run of
<partition_plugin.MkpartStepRunner object at 0x7f4ba4587978>>
2019-11-27 11:41:09 INFO Exec: ['parted', '-m', '/dev/loop0', 'print']
2019-11-27 11:41:09 DEBUG run external command: [['parted', '-m', '/dev/loop0',
'print']]
2019-11-27 11:41:09 DEBUG STDOUT:
b'BYT;\n/dev/loop0:4295MB:loopback:512:512:gpt:Loopback device:;\n'
2019-11-27 11:41:09 INFO Exec: ['parted', '-s', '/dev/loop0', 'mkpart',
'primary', 'ext2', '0%', '100%']
2019-11-27 11:41:09 DEBUG run external command: [['parted', '-s', '/dev/loop0',
'mkpart', 'primary', 'ext2', '0%', '100%']]
2019-11-27 11:41:10 INFO Exec: ['parted', '-m', '/dev/loop0', 'print']
2019-11-27 11:41:10 DEBUG run external command: [['parted', '-m', '/dev/loop0',
'print']]
2019-11-27 11:41:10 DEBUG STDOUT:
b'BYT;\n/dev/loop0:4295MB:loopback:512:512:gpt:Loopback
device:;\n1:1049kB:4294MB:4293MB:ext4:primary:;\n'
2019-11-27 11:41:10 INFO remembering partition /dev/loop01 as root
2019-11-27 11:41:10 INFO Calling <bound method
StepRunnerInterface.run_even_if_skipped of <partition_plugin.MkpartStepRunner
object at 0x7f4ba4587978>>
2019-11-27 11:41:10 INFO Running step: {'kpartx': '/dev/loop0'}
2019-11-27 11:41:10 INFO Calling <bound method KpartxStepRunner.run of
<partition_plugin.KpartxStepRunner object at 0x7f4ba4587940>>
2019-11-27 11:41:10 INFO Exec: ['kpartx', '-asv', '/dev/loop0']
2019-11-27 11:41:10 DEBUG run external command: [['kpartx', '-asv',
'/dev/loop0']]
2019-11-27 11:41:10 DEBUG STDOUT: b'add map loop0p1 (253:3): 0 8384512 linear
7:0 2048\n'
2019-11-27 11:41:10 INFO remembering /dev/mapper/loop0p1 as root
2019-11-27 11:41:10 ERROR Already has device: root
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/vmdb/app.py", line 107, in
run_steps_helper
method(step, self.settings, state)
File "/usr/lib/python3/dist-packages/vmdb/plugins/partition_plugin.py", line
109, in run
state.tags.set_dev(tag, dev)
File "/usr/lib/python3/dist-packages/vmdb/tags.py", line 61, in set_dev
raise AlreadyHasDev(tag)
vmdb.tags.AlreadyHasDev: Already has device: root
2019-11-27 11:41:10 INFO Something went wrong, cleaning up!
This latter part is clearly a failure to recognize that the partition number
suffixes cannot be concatenated onto a base device name that ends in a
number. Note how kpartx adds the letter 'p' inbetween.
Please fix it. TIA.
--
Josip Rodin
--- End Message ---
--- Begin Message ---
Version: 0.16-1
On 14 Apr 2020 21:15:10 +0200 Sebastian Bachmann <[email protected]> wrote:
> I found out that this helps to work around it:
>
> - grub: bios
> tag: root
> console: serial
> image-dev: "{{ image }}"
>
> In the documentation it says "device", but seems to be wrong. (Compare
> https://vmdb2-manual.liw.fi/#step-grub, lateron image-dev is mentioned)
It was indeed shown correctly in the example below and fixed with commit
http://git.liw.fi/vmdb2/commit/?id=a7eda9ffa3a93dd14499d2ead5b23addc55047ed
and the first release uploaded to Debian that contained that commit, was
0.16-1, so closing with that version.
signature.asc
Description: This is a digitally signed message part.
--- End Message ---