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

ganeti-instance-debootstrap grub hook fails: "unable to resolve UUID", "could not find menu.lst" #605

Closed
Ganeti-Issues-Migrator opened this issue Jun 23, 2017 · 18 comments

Comments

@Ganeti-Issues-Migrator
Copy link

Originally reported of Google Code with ID 549.

What software version are you running? Please provide the output of "gnt-
cluster --version" and "gnt-cluster version".

root@wrn-vm1:~# gnt-cluster --version
gnt-cluster (ganeti v2.6.2) 2.6.2
root@wrn-vm1:~# gnt-cluster version
Software version: 2.6.2
Internode protocol: 2060000
Configuration format: 2060000
OS api version: 20
Export interface: 0

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

Debian Wheezy (host), Ubuntu Precise (guest)

<b>What steps will reproduce the problem?</b>

1. Install /etc/ganeti/instance-debootstrap/hooks/grub from the examples/hooks directory. (Note: I also have the 'defaultpasswords' and 'timezone' hooks installed, and they work fine)

2. Build an Ubuntu VM. I have /etc/ganeti/instance-debootstrap/variants/precise.conf containing

MIRROR="http://archive.ubuntu.com/ubuntu/"
SUITE="precise"
EXTRA_PKGS="acpid,console-tools,udev,linux-image-virtual,openssh-server"
COMPONENTS="main,universe"
ARCH="amd64"

<b>What is the expected output? What do you see instead?</b>

The VM creation fails at the following point:

---- 8< ----
...
Searching for GRUB installation directory ... found: /boot/grub
findfs: unable to resolve 'UUID=310dafbb-8de6-42af-bf27-4c5752c99a94'
Cannot determine root device.  Assuming /dev/hda1
This error is probably caused by an invalid /etc/fstab
Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
Searching for GRUB installation directory ... found: /boot/grub
Testing for an existing GRUB menu.lst file ...

Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/update-grub: line 1094: read: read error: 0: Bad file descriptor
run-parts: /etc/ganeti/instance-debootstrap/hooks/grub exited with return code 1

Current default time zone: 'Europe/London'
Local time is now:      Sun Jul 14 11:10:12 BST 2013.
Universal Time is now:  Sun Jul 14 10:10:12 UTC 2013.
---- 8< ----

As a result, the VM won't boot. You need to boot it temporarily with an external kernel, and then run grub within the VM.

<b>Please provide any additional information below.</b>

I tried changing "sda" to "vda" in the grub script, but it didn't make a difference. Also reported at https://groups.google.com/forum/#!topic/ganeti/Wmyb_5dLvaI


Originally added on 2013-08-07 18:58:05 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

It also fails when making a default Debian guest (-o debootstrap+default), although with a slightly different error.

root@wrn-vm1:~# gnt-instance add --no-start -n wrn-vm1.int.example.com:wrn-vm2.int.example.com -o debootstrap+default -t drbd -s 10G --net 0:mode=bridged,link=mgmt-br0 testvm.int.example.com
Wed Aug  7 20:13:28 2013 * creating instance disks...
Wed Aug  7 20:13:35 2013 adding instance testvm.int.example.com to cluster config
Wed Aug  7 20:13:39 2013  - INFO: Waiting for instance testvm.int.example.com to sync disks.
Wed Aug  7 20:13:40 2013  - INFO: - device disk/0:  2.90% done, 2m 21s remaining (estimated)
Wed Aug  7 20:14:40 2013  - INFO: - device disk/0: 38.20% done, 1m 44s remaining (estimated)
Wed Aug  7 20:15:41 2013  - INFO: - device disk/0: 73.80% done, 42s remaining (estimated)
Wed Aug  7 20:16:24 2013  - INFO: - device disk/0: 98.70% done, 2s remaining (estimated)
Wed Aug  7 20:16:26 2013  - INFO: Instance testvm.int.example.com's disks are in sync.
Wed Aug  7 20:16:26 2013 * running the instance OS create scripts...
Failure: command execution error:
Could not add os for instance testvm.int.example.com on node wrn-vm1.int.example.com: OS create script failed (exited with exit code 1), last lines in the log file:
Setting up gettext-base (0.18.1.1-9) ...
Setting up os-prober (1.58) ...
Setting up dmsetup (2:1.02.74-7) ...
update-initramfs: deferring update (trigger activated)
Setting up libdevmapper1.02.1:amd64 (2:1.02.74-7) ...
Setting up grub-common (1.99-27+deb7u1) ...
Setting up grub-legacy (0.97-67) ...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-4-amd64
df: Warning: cannot read table of mounted file systems: No such file or directory
warning: failed to read mtab
Searching for GRUB installation directory ... found: /boot/grub
warning: grub-probe can't find drive for /dev/sda1.
grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
run-parts: /etc/ganeti/instance-debootstrap/hooks/grub exited with return code 1

Current default time zone: 'Europe/London'
Local time is now:      Wed Aug  7 20:17:02 BST 2013.
Universal Time is now:  Wed Aug  7 19:17:02 UTC 2013.
root@wrn-vm1:~#

Originally added on 2013-08-07 19:19:08 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

-- Empty comment --

Originally added on 2013-08-20 10:02:55 +0000 UTC.

Added Labels: Type-Defect Priority-Medium Component-instances
Changed State: Accepted
Added to Milestone: Release2.9

@Ganeti-Issues-Migrator
Copy link
Author

-- Empty comment --

Originally added on 2013-08-20 10:05:08 +0000 UTC.

Added Labels: SmallTask

@Ganeti-Issues-Migrator
Copy link
Author

Still doesn't work in ganeti-2.9.0b1

Originally added on 2013-09-13 07:07:32 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

Attached comes my modified version of the grub hook script which works here for
Debian Wheezy (host) and Ubuntu Precise (guest). 
Package 'grub-pc' is used in the guest, because that fits the 'grub-install'-version of the host (1.99-27+deb7u2). Apart from that, I changed 'hda' to 'vda' and corrected some parameters accordingly.

Hope that helps!

Originally added on 2013-10-30 09:10:17 +0000 UTC.

Attachments:
grub

@Ganeti-Issues-Migrator
Copy link
Author

Move non-critical bugs scheduled for 2.8 or 2.9 to 2.11, as in those versions only critical bug fixes will be integrated.

Originally added on 2013-10-30 09:48:16 +0000 UTC.

Added to Milestone: Release2.11
Removed from Milestone: Release2.9

@Ganeti-Issues-Migrator
Copy link
Author

@kackhau...
I tried your updated hooks/grub, together with ganeti 2.6.2 and instance-debootstrap 0.14, but it doesn't work for me building Ubuntu Precise.

Mon Nov  4 16:22:11 2013  - INFO: Instance briantest.int.example.com's disks are in sync.
Mon Nov  4 16:22:11 2013 * running the instance OS create scripts...
Failure: command execution error:
Could not add os for instance briantest.int.example.com on node wrn-vm1.int.example.com: OS create script failed (exited with exit code 1), last lines in the log file:
Generating grub.cfg ...
cat: /boot/grub/video.lst: No such file or directory
Found linux image: /boot/vmlinuz-3.2.0-23-virtual
Found initrd image: /boot/initrd.img-3.2.0-23-virtual
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/vda1.  Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/vda1.  Check your device.map.
grep: /proc/mounts: No such file or directory
grep: /proc/swaps: No such file or directory
Cannot find list of partitions!  (Try mounting /sys.)
done
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/mapper/drbd0-1.  Check your device.map.
Auto-detection of a filesystem of /dev/mapper/drbd0-1 failed.
Try with --recheck.
If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/tmp/tmp.HLF5nnWeHw/boot/grub/device.map" --target=fs -v /tmp/tmp.HLF5nnWeHw/boot/grub" to <bug-grub@gnu.org>
run-parts: /etc/ganeti/instance-debootstrap/hooks/grub exited with return code 1

Current default time zone: 'Europe/London'
Local time is now:      Mon Nov  4 16:22:33 GMT 2013.
Universal Time is now:  Mon Nov  4 16:22:33 UTC 2013.

I have checked that "gnt-cluster show" include "disk_type: paravirtual" under kvm

Originally added on 2013-11-04 16:29:45 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

Modified the script with
exec >/tmp/grubdebug 2>&1
set -ex

Now get the following output (starting from the package installation point):

----
Processing triggers for ureadahead ...
Setting up libfreetype6 (2.4.8-1ubuntu2) ...
Setting up gettext-base (0.18.1.1-5ubuntu3) ...
Setting up libfuse2 (2.8.6-2ubuntu2) ...
Setting up grub-common (1.99-21ubuntu3) ...
Setting up grub2-common (1.99-21ubuntu3) ...
Setting up grub-pc-bin (1.99-21ubuntu3) ...
Setting up os-prober (1.51ubuntu3) ...
Setting up grub-pc (1.99-21ubuntu3) ...

Creating config file /etc/default/grub with new version
grub-probe: error: cannot find a device for / (is /dev mounted?).
grub-probe: error: cannot find a device for /boot (is /dev mounted?).
grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).
Setting up grub-gfxpayload-lists (0.6) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
++ stat -L -c '0x%t 0x%T' /dev/drbd0
+ mknod /tmp/tmp.GofquXDGLS/dev/vda b 0x93 0x0
+ CLEANUP+=("rm -f $TARGET/dev/vda")
++ stat -L -c '0x%t 0x%T' /dev/mapper/drbd0-1
+ mknod /tmp/tmp.GofquXDGLS/dev/vda1 b 0xfd 0x9
+ CLEANUP+=("rm -f $TARGET/dev/vda1")
+ mkdir -p /tmp/tmp.GofquXDGLS/boot/grub
+ cat
+ chroot /tmp/tmp.GofquXDGLS update-grub
Generating grub.cfg ...
cat: /boot/grub/video.lst: No such file or directory
Found linux image: /boot/vmlinuz-3.2.0-23-virtual
Found initrd image: /boot/initrd.img-3.2.0-23-virtual
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/vda1.  Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/vda1.  Check your device.map.
grep: /proc/mounts: No such file or directory
grep: /proc/swaps: No such file or directory
Cannot find list of partitions!  (Try mounting /sys.)
done
+ grub-install --no-floppy --root-directory=/tmp/tmp.GofquXDGLS /tmp/tmp.GofquXDGLS/dev/vda
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/mapper/drbd0-1.  Check your device.map.
Auto-detection of a filesystem of /dev/mapper/drbd0-1 failed.
Try with --recheck.
If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/tmp/tmp.GofquXDGLS/boot/grub/device.map" --target=fs -v /tmp/tmp.GofquXDGLS/boot/grub" to <bug-grub@gnu.org>
+ cleanup
+ '[' 2 -gt 0 ']'
+ LAST_ELEMENT=1
++ seq 1 -1 0
+ REVERSE_INDEXES='1
0'
+ for i in '$REVERSE_INDEXES'
+ rm -f /tmp/tmp.GofquXDGLS/dev/vda1
+ for i in '$REVERSE_INDEXES'
+ rm -f /tmp/tmp.GofquXDGLS/dev/vda
----

I note that update-grub returns zero even on error, so "set -e" does not stop the script at that point. (Confirmed by running update-grub manually within the chroot)

Originally added on 2013-11-04 22:13:44 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

Here comes my log (last lines):
----
Setting up grub-pc (1.99-21ubuntu3) ...

Creating config file /etc/default/grub with new version
grub-probe: error: cannot find a device for / (is /dev mounted?).
grub-probe: error: cannot find a device for /boot (is /dev mounted?).
grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).
Setting up grub-gfxpayload-lists (0.6) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
++ stat -L -c '0x%t 0x%T' /dev/vg1/f48ca8a9-6dd3-4053-bad4-d75549db0d03.disk0
+ mknod /tmp/tmp.EaJjYQNPWc/dev/vda b 0xfd 0x3
+ CLEANUP+=("rm -f $TARGET/dev/vda")
++ stat -L -c '0x%t 0x%T' /dev/mapper/vg1-f48ca8a9--6dd3--4053--bad4--d75549db0d03.disk0-1
+ mknod /tmp/tmp.EaJjYQNPWc/dev/vda1 b 0xfd 0x4
+ CLEANUP+=("rm -f $TARGET/dev/vda1")
+ mkdir -p /tmp/tmp.EaJjYQNPWc/boot/grub
+ cat
+ chroot /tmp/tmp.EaJjYQNPWc update-grub
Generating grub.cfg ...
cat: /boot/grub/video.lst: No such file or directory
Found linux image: /boot/vmlinuz-3.2.0-23-virtual
Found initrd image: /boot/initrd.img-3.2.0-23-virtual
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/vda1.  Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/vda1.  Check your device.map.
grep: /proc/mounts: No such file or directory
grep: /proc/swaps: No such file or directory
Cannot find list of partitions!  (Try mounting /sys.)
done
+ grub-install --no-floppy --root-directory=/tmp/tmp.EaJjYQNPWc /tmp/tmp.EaJjYQNPWc/dev/vda
Installation finished. No error reported.
+ cleanup
+ '[' 2 -gt 0 ']'
+ LAST_ELEMENT=1
++ seq 1 -1 0
+ REVERSE_INDEXES='1
0'
+ for i in '$REVERSE_INDEXES'
+ rm -f /tmp/tmp.EaJjYQNPWc/dev/vda1
+ for i in '$REVERSE_INDEXES'
+ rm -f /tmp/tmp.EaJjYQNPWc/dev/vda
+ trap - EXIT
+ exit 0
----
@bcandler...
Note that I get similar messages from update-grub, but these seem not to be fatal errors.
The notable difference is that grub-install succeds. Unfortunately, I don't know why. Perhaps becaue I am not using DRBD, just plain LVM-volumes.
What is the version of your grub-install?
I wonder why it compains about /dev/mapper/drbd0-1. IIRC, there have been some recent changes concerning the parameter '--root-directory' or '--boot-directory'.

Originally added on 2013-11-05 09:10:42 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

You've hit on it: it works with type 'plain' but not with type 'drbd'.

Since the drbd functionality is the main reason I use ganeti, this is unfortunate. I suppose I could create images as plain and then convert them to drbd.

Originally added on 2013-11-14 15:40:32 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

-- Empty comment --

Originally added on 2014-01-23 17:17:54 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

Moving all issues that won't be addressed in 2.11 anymore to 2.12.

Originally added on 2014-05-14 11:28:37 +0000 UTC.

Added to Milestone: Release2.12
Removed from Milestone: Release2.11

@Ganeti-Issues-Migrator
Copy link
Author

I ran into this exact issue, and decided to spend some time to fix it. I created a hook script that works for me(TM) using drbd and lvm. There are several issues/quirks to 'fake' everything such that grub works in a chroot:

- For drbd, grub-2.00 is needed from testing, this is installed by this script. For lvm, it is assumed that grub is available (put it in your EXTRA_PKGS in /etc/default/ganeti-instance-debootstrap). 
- There is no symlink created under $TARGET/dev/disk/by-uuid, this causes grub to use the device name in the kernel boot arguments instead of the uuid
- LVM needs a loop device, otherwise grub thinks we're installing to a partition
- For LVM, the create scripts mount /dev/<vgname>/<lvname>, but for some reason grub looks in device.map for /dev/mapper/<vgname>-<mangled-lvname> ...
- Two runs of grub-install are needed, the first one installs serial.mod, then the serial port can be added to the config, and then we run again

Originally added on 2014-08-05 14:17:21 +0000 UTC.

Attachments:
grub-hook

@Ganeti-Issues-Migrator
Copy link
Author

I have tested the attached hook script above on drbd instances. It works. Thanks.

Note: The installation of grub is done by the hook script. If the installation of grub gives a prompt, then the hook script will hang forever. This can be fixed by changing the 'apt-get install' line to something like this: 

chroot "$TARGET" /usr/bin/env DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -t testing install grub2

Originally added on 2015-02-25 18:58:41 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

Unfortunately, what I wrote above is not entirely correct. The hook script above does work, but since it installs grub2 from testing along with its dependencies, it breaks wheezy packages by introducing conflicts.

That said, I have come to a solution with two hook scripts:

* One hook script that runs only when debootstraping wheezy instances and installs extlinux instead of grub (if one needs absolutely grub, they can still install it after booting the instance).
* Another hook script that runs only when debootstraping non-wheezy instances and installs grub2. This will do the job for debootstring instances with testing/jessie (tested) and possibly sid (not tested).

Debootstrapping squeeze instances could be supported with small changes at the top of these hook scripts where checking for suite is taking place. I have not made these changes though as I am not interested in deploying squeeze instances.

You can find both scripts attached to this post.

Originally added on 2015-02-26 12:14:36 +0000 UTC.

Attachments:
extlinux
grub

@Ganeti-Issues-Migrator
Copy link
Author

petros, thanks for your scripts in #15, there is just a couple problems with the grub script. In the $DISKTYPE case, you have this:

case $DISKTYPE in
    lvm)

        # When using LVM, grub thinks we're installing to a partition. Using a loop dev fools it
        LODEV=$(losetup --show -f $BLOCKDEV)
        CLEANUP+=("losetup -d $LODEV")


        # BLOCKDEV has the format /dev/<vgname>/<lvname>, but Grub will be looking
        # for /dev/mapper/<vgname>-<mangled-lvname> ...
        # This adds the mapper device to device.map, which is used to translate
        # the root device node into grub-syntax (i.e., (hd0))

        MAPPERDEV=/dev/mapper/$(dmsetup info -C --noheadings -o name $BLOCKDEV)
        echo "(hd0) $MAPPERDEV" > $TARGET/boot/grub/device.map
        ;;
    drbd)
        chroot "$TARGET" apt-get update
        chroot "$TARGET" /usr/bin/env DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install grub2

        ;;
esac

but then you call grub later:

# install grub to make all the modules available ... serial.mod is not available otherwise
chroot "$TARGET" update-grub

case $DISKTYPE in
    lvm)
        chroot "$TARGET" grub-install $LODEV
        ;;
    drbd)
        chroot "$TARGET" grub-install $BLOCKDEV
        ;;
esac


For a LVM system, it wont have grub installed, because you only installed it in the drbd case above. Its also a little strange to have two 'case $DISKTYPE' blocks right after each other, so I'd say it should be changed to this instead:

...
CLEANUP+=("rm /dev/disk/by-uuid/$ROOTUUID")
chroot "$TARGET" apt-get update
chroot "$TARGET" /usr/bin/env DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install grub2

# install grub to make all the modules available ... serial.mod is not available otherwise
chroot "$TARGET" update-grub

case $DISKTYPE in
    lvm)
        
        # When using LVM, grub thinks we're installing to a partition. Using a loop dev fools it
        LODEV=$(losetup --show -f $BLOCKDEV)
        CLEANUP+=("losetup -d $LODEV")


        # BLOCKDEV has the format /dev/<vgname>/<lvname>, but Grub will be looking
        # for /dev/mapper/<vgname>-<mangled-lvname> ...
        # This adds the mapper device to device.map, which is used to translate
        # the root device node into grub-syntax (i.e., (hd0))

        MAPPERDEV=/dev/mapper/$(dmsetup info -C --noheadings -o name $BLOCKDEV)
        echo "(hd0) $MAPPERDEV" > $TARGET/boot/grub/device.map
        chroot "$TARGET" grub-install $LODEV 
        ;;
    drbd)
        chroot "$TARGET" grub-install $BLOCKDEV
        ;;
esac
cat >> $TARGET/etc/default/grub <<EOF
...

additionally, I had a problem with this line:

ln -s $FSYSDEV /dev/disk/by-uuid/$ROOTUUID

when that is there, and I'm using lvm, the following happens on install:

Fri Jun  5 09:57:14 2015 * running the instance OS create scripts...
2015-06-05 09:57:23,473: gnt-instance add pid=1821 cli:2713 ERROR Error during command processing
Traceback (most recent call last):
  File "/usr/share/ganeti/2.12/ganeti/cli.py", line 2709, in GenericMain
    result = func(options, args)
  File "/usr/share/ganeti/2.12/ganeti/client/gnt_instance.py", line 263, in AddInstance
    return GenericInstanceCreate(constants.INSTANCE_CREATE, opts, args)
  File "/usr/share/ganeti/2.12/ganeti/cli.py", line 2934, in GenericInstanceCreate
    SubmitOrSend(op, opts)
  File "/usr/share/ganeti/2.12/ganeti/cli.py", line 2499, in SubmitOrSend
    return SubmitOpCode(op, cl=cl, feedback_fn=feedback_fn, opts=opts)
  File "/usr/share/ganeti/2.12/ganeti/cli.py", line 2464, in SubmitOpCode
    reporter=reporter)
  File "/usr/share/ganeti/2.12/ganeti/cli.py", line 2443, in PollJob
    return GenericPollJob(job_id, _LuxiJobPollCb(cl), reporter)
  File "/usr/share/ganeti/2.12/ganeti/cli.py", line 2265, in GenericPollJob
    errors.MaybeRaise(msg)
  File "/usr/share/ganeti/2.12/ganeti/errors.py", line 519, in MaybeRaise
    raise errcls(*args)
OpExecError: Could not add os for instance testvm.riseup.net on node weaver.riseup.net: OS create script failed (exited with exit code 1), last lines in the log file:
+ DISKTYPE=lvm
+ mount -o bind /dev /tmp/tmp.xzJ5STx6JM/dev
+ CLEANUP+=("umount $TARGET/dev")
+ mount -t proc proc /tmp/tmp.xzJ5STx6JM/proc
+ CLEANUP+=("umount $TARGET/proc")
++ blkid -o value -s UUID /dev/mapper/ganetivg0-8c44f4b5--9c9f--4b12--9f95--0ca0d113b3e1.disk0-1
+ ROOTUUID=61c7ebf5-e1dc-4182-b4bd-a0b6fdb8b896
+ ln -s /dev/mapper/ganetivg0-8c44f4b5--9c9f--4b12--9f95--0ca0d113b3e1.disk0-1 /dev/disk/by-uuid/61c7ebf5-e1dc-4182-b4bd-a0b6fdb8b896
ln: failed to create symbolic link '/dev/disk/by-uuid/61c7ebf5-e1dc-4182-b4bd-a0b6fdb8b896': File exists
+ cleanup
+ '[' 2 -gt 0 ']'
+ LAST_ELEMENT=1
++ seq 1 -1 0
+ REVERSE_INDEXES='1
0'
+ for i in '$REVERSE_INDEXES'
+ umount /tmp/tmp.xzJ5STx6JM/proc
+ for i in '$REVERSE_INDEXES'
+ umount /tmp/tmp.xzJ5STx6JM/dev
run-parts: /etc/ganeti/instance-debootstrap/hooks/grub exited with return code 1
Failure: command execution error:
Could not add os for instance testvm.riseup.net on node weaver.riseup.net: OS create script failed (exited with exit code 1), last lines in the log file:
+ DISKTYPE=lvm
+ mount -o bind /dev /tmp/tmp.xzJ5STx6JM/dev
+ CLEANUP+=("umount $TARGET/dev")
+ mount -t proc proc /tmp/tmp.xzJ5STx6JM/proc
+ CLEANUP+=("umount $TARGET/proc")
++ blkid -o value -s UUID /dev/mapper/ganetivg0-8c44f4b5--9c9f--4b12--9f95--0ca0d113b3e1.disk0-1
+ ROOTUUID=61c7ebf5-e1dc-4182-b4bd-a0b6fdb8b896
+ ln -s /dev/mapper/ganetivg0-8c44f4b5--9c9f--4b12--9f95--0ca0d113b3e1.disk0-1 /dev/disk/by-uuid/61c7ebf5-e1dc-4182-b4bd-a0b6fdb8b896
ln: failed to create symbolic link '/dev/disk/by-uuid/61c7ebf5-e1dc-4182-b4bd-a0b6fdb8b896': File exists
+ cleanup
+ '[' 2 -gt 0 ']'
+ LAST_ELEMENT=1
++ seq 1 -1 0
+ REVERSE_INDEXES='1
0'
+ for i in '$REVERSE_INDEXES'
+ umount /tmp/tmp.xzJ5STx6JM/proc
+ for i in '$REVERSE_INDEXES'
+ umount /tmp/tmp.xzJ5STx6JM/dev
run-parts: /etc/ganeti/instance-debootstrap/hooks/grub exited with return code 1
root@weaver:/etc/ganeti/instance-debootstrap/hooks# 

so I just removed that line, I'm not sure what it is for, maybe it is needed for drbd?

Originally added on 2015-06-05 16:58:24 +0000 UTC.

@Ganeti-Issues-Migrator
Copy link
Author

The script as Micah modified it works for me.  I did not have to remove the line:

ln -s $FSYSDEV /dev/disk/by-uuid/$ROOTUUID

I've attached the script as it works for me...  tested with drbd, plain (lvm) with jessie & trusty.

Thanks!

Originally added on 2015-06-24 21:35:13 +0000 UTC.

Attachments:
grub

@geor-g
Copy link

geor-g commented Sep 26, 2018

This should be closed, as this works if using the correct hook.

New state: should be closed

@iustin iustin closed this as completed Sep 26, 2018
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

3 participants