$ cat /etc/ganeti/instance-debootstrap/variants/default.conf
ARCH="amd64"
EXTRA_PKGS="sudo,vim,openssh-server"
$ gnt-instance add -t drbd -o debootstrap+default -n kvm1.local:kvm2.local -s 4g instance2
Tue Feb 10 19:32:38 2015 * creating instance disks...
Tue Feb 10 19:32:45 2015 adding instance instance2 to cluster config
Tue Feb 10 19:32:51 2015 - INFO: Waiting for instance instance2 to sync disks
Tue Feb 10 19:32:59 2015 - INFO: - device disk/0: 20.70% done, 50s remaining (estimated)
Tue Feb 10 19:33:49 2015 - INFO: Instance instance2's disks are in sync
Tue Feb 10 19:33:49 2015 * running the instance OS create scripts...
Failure: command execution error:
Could not add os for instance instance2 on node kvm1.local: OS create script failed (exited with exit code 1), last lines in the log file:
Setting up os-prober (1.63ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up grub2-common (2.02~beta2-9) ...
Setting up grub-pc-bin (2.02~beta2-9) ...
Setting up grub-gfxpayload-lists (0.6) ...
Setting up grub-pc (2.02~beta2-9) ...
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?).
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Generating grub configuration file ...
/proc/devices: fopen failed: No such file or directory
device node not found
device node not found
/proc/devices: fopen failed: No such file or directory
device node not found
grub-probe: error: cannot find a GRUB drive for /dev/vda1. Check your device.map.
run-parts: /etc/ganeti/instance-debootstrap/hooks/grub exited with return code 1
Fri Feb 6 00:39:56 2015 * running the instance OS create scripts...
Failure: command execution error:
Could not add os for instance instance3 on node kvm1.local: OS create script failed (exited with exit code 1), last lines in the log file:
...
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
root@kvm1:~# gnt-instance start -H kernel_path=/boot/vmlinuz-3.13.0-44-generic,initrd_path=/boot/initrd.img-3.13.0-44-generic,kernel_args="ro single" instance3
Waiting for job 507 for instance3 ...
root@kvm1:~# gnt-instance console instance3
[ 31.094613] random: lvm urandom read with 29 bits of entropy available
Gave up waiting for root device. Common problems:
- Boot args (cat /proc/cmdline)
- Check rootdelay= (did the system wait long enough?)
- Check root= (did the system wait for the right device?)
- Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/vda1 does not exist. Dropping to a shell!
BusyBox v1.21.1 (Ubuntu 1:1.21.0-1ubuntu1) built-in shell (ash)
Enter 'help' for a list of built-in commands.
(initramfs)
/dev/vda1 doesn't exist in /dev
root@instance3:/dev# ls -l vda*
brw-rw---- 1 root disk 253, 0 Feb 6 05:41 vda
root@instance2:/dev# fdisk -l
Disk /dev/vda: 4294 MB, 4294967296 bytes
16 heads, 63 sectors/track, 8322 cylinders, total 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/vda doesn't contain a valid partition table
$ grep -v ^# /etc/default/ganeti-instance-debootstrap
ARCH=""
SUITE="trusty"
EXTRA_PKGS=""
CUSTOMIZE_DIR="/etc/ganeti/instance-debootstrap/hooks"
GENERATE_CACHE="yes"
CLEAN_CACHE="14"
PARTITION_STYLE="msdos"
$ cat /etc/ganeti/instance-debootstrap/variants/trusty.conf
MIRROR="http://archive.ubuntu.com/ubuntu/"
SUITE="trusty"
EXTRA_PKGS="openssh-server,htop"
COMPONENTS="main,restricted,universe,multiverse"
ARCH="amd64"
Did you configure it to install without a partition table, i.e. so /dev/vda is the whole filesystem? (To test this, you should be able to find the ganeti device node and mount it directly. Given that you're using drbd, you should activate the disks first. To be honest, it would be simpler to start with -t plain and then when you have the problem cracked move onto -t drbd)
But the default today should be to use a partition table. From /etc/default/ganeti-instance-debootstrap:# PARTITION_STYLE: whether and how the target device should be partitioned.# Allowed values:# 'none': just format the device, but don't partition it# 'msdos': install an msdos partition table on the device, with a single# partition on it# (more styles may be added in the future)# The default is "msdos" from ganeti 2.0 onwards, but none if installing under# Ganeti 1.2 (os api version 5)# PARTITION_STYLE="none"
With plain, added set -x to the grub hook:
$ gnt-instance add -t plain -o debootstrap+default -s 4g instance2
Could not add os for instance instance2 on node kvm2.local: OS create script failed (exited with exit code 1), last lines in the log file:
+ chroot /tmp/tmp.CBlfxXFrvn update-grub
Generating grub.cfg ...
cat: /boot/grub/video.lst: No such file or directory
grep: /proc/mounts: No such file or directory
Cannot find list of partitions! (Try mounting /sys.)
done
+ grub-install --no-floppy --root-directory=/tmp/tmp.CBlfxXFrvn /tmp/tmp.CBlfxXFrvn/dev/vda
Installing for i386-pc platform.
grub-install: error: disk `lvmid/25U3El-4gv1-3RLJ-pfZd-Uptq-pxQ5-SxAbb4/9q8W78-gofx-qvhS-TSYV-IGi5-rjRo-4N7NNp' not found.
+ cleanup
+ '[' 2 -gt 0 ']'
+ LAST_ELEMENT=1
++ seq 1 -1 0
+ REVERSE_INDEXES='1
0'
+ for i in '$REVERSE_INDEXES'
+ rm -f /tmp/tmp.CBlfxXFrvn/dev/vda1
+ for i in '$REVERSE_INDEXES'
+ rm -f /tmp/tmp.CBlfxXFrvn/dev/vda
Wed Feb 11 17:29:01 2015 * disk 0, size 4.0G
Wed Feb 11 17:29:01 2015 * creating instance disks...
Wed Feb 11 17:29:02 2015 adding instance instance3 to cluster config
Wed Feb 11 17:29:03 2015 - INFO: Waiting for instance instance3 to sync disks
Wed Feb 11 17:29:03 2015 - INFO: Instance instance3's disks are in sync
Wed Feb 11 17:29:03 2015 * running the instance OS create scripts...
Wed Feb 11 17:29:09 2015 * starting instance...
log file:
BLKRRPART: Invalid argument
Disk /dev/xenvg/3313e707-7a9b-430a-8029-e748afe9b6c7.disk0: 4096 cylinders, 64 heads, 32 sectors/track
sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/xenvg/3313e707-7a9b-430a-8029-e748afe9b6c7.disk0: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = sectors of 512 bytes, counting from 0
Device Boot Start End #sectors Id System
/dev/xenvg/3313e707-7a9b-430a-8029-e748afe9b6c7.disk0p1 * 2048 8388607 8386560 83 Linux
/dev/xenvg/3313e707-7a9b-430a-8029-e748afe9b6c7.disk0p2 0 - 0 0 Empty
/dev/xenvg/3313e707-7a9b-430a-8029-e748afe9b6c7.disk0p3 0 - 0 0 Empty
/dev/xenvg/3313e707-7a9b-430a-8029-e748afe9b6c7.disk0p4 0 - 0 0 Empty
Successfully wrote the new partition table
Re-reading the partition table ...
BLKRRPART: Invalid argument
passwd: password expiry information changed.
Where are the ganeti device nodes?
On Wednesday, 11 February 2015 23:24:58 UTC, Jon Schipp wrote:Where are the ganeti device nodes?# gnt-node volumeswill list all the instances and their LVM volumes.For a "plain" instance you can access/dev/<volgroup>/<uuid>.disk0But *never* access this for a drbd instance. Instead use gnt-instance activate-disks, following the instructions atSo you can try fdisk or kpartx on this node to see if it's really partitioned or not, and there's no need to start any VM.If you're not getting a partition table then you need to sort this out first, before you look at any grub hooks.
$ fdisk -l /dev/xenvg/8464a193-5e24-4a40-8909-7a35ec607f30.disk0 /mnt/
Disk /dev/xenvg/8464a193-5e24-4a40-8909-7a35ec607f30.disk0: 4294 MB, 4294967296 bytes
64 heads, 32 sectors/track, 4096 cylinders, total 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/xenvg/8464a193-5e24-4a40-8909-7a35ec607f30.disk0p1 * 2048 8388607 4193280 83 Linux
Note also: when you do get to the point of using the grub hook, last time I tried it was broken:
There was a version added to this ticket which worked with -t plain but not with -t drbd. I see that now someone has added a version which is supposed to work with both.However I've long since moved away from debootstrap, and am using snf-image instead. Since snf-image unpacks an existing image containing partition table and boot loader, this sort of issue simply doesn't happen.
root@instance2:~# cat /boot/grub/device.map
(hd0) /tmp/tmp.Q8kqtHw8tj/dev/vda
root@instance2:~# ls -l /boot/
total 4
drwxr-xr-x 5 root 114 4096 Feb 13 00:32 grub
I'm able to fix this by
root@instance2:~# apt-get install linux-image-generic
root@instance2:~# cat /boot/grub/device.map
(hd0) /dev/vda
root@instance2:~# update-grub
root@instance2:~# grub-install --no-floppy /dev/vda
Installation finished. No error reported.
...
Ubuntu 14.04 LTS instance2 ttyS0
instance2 login:
Selecting previously unselected package linux-image-3.13.0-24-generic.
Preparing to unpack .../linux-image-3.13.0-24-generic_3.13.0-24.46_amd64.deb ...
grep: /proc/cpuinfo: No such file or directory
This kernel does not support a non-PAE CPU.
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.13.0-24-generic_3.13.0-24.46_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Setting up grub2-common (2.02~beta2-9) ...
Setting up grub-pc-bin (2.02~beta2-9) ...
Setting up grub-gfxpayload-lists (0.6) ...
Setting up grub-pc (2.02~beta2-9) ...
Creating config file /etc/default/grub with new version
grub-probe: error: failed to get canonical path of `/dev/mapper/xenvg-ba3ee6b1--5643--4e74--838d--52c0e1402347.disk0-1'.
grub-probe: error: failed to get canonical path of `/dev/mapper/xenvg-ba3ee6b1--5643--4e74--838d--52c0e1402347.disk0-1'.
grub-probe: error: failed to get canonical path of `/dev/mapper/xenvg-ba3ee6b1--5643--4e74--838d--52c0e1402347.disk0-1'.
Processing triggers for libc-bin (2.19-0ubuntu6) ...
+ CLEANUP+=("umount $TARGET/proc")
+ CLEANUP+=("umount $TARGET/sys")
++ stat -L -c '0x%t 0x%T' /dev/xenvg/ba3ee6b1-5643-4e74-838d-52c0e1402347.disk0
+ mknod /tmp/tmp.OsrzuBUhBm/dev/vda b 0xfc 0x3
+ CLEANUP+=("rm -f $TARGET/dev/vda")
++ stat -L -c '0x%t 0x%T' /dev/mapper/xenvg-ba3ee6b1--5643--4e74--838d--52c0e1402347.disk0-1
+ mknod /tmp/tmp.OsrzuBUhBm/dev/vda1 b 0xfc 0x4
+ CLEANUP+=("rm -f $TARGET/dev/vda1")
+ chroot /tmp/tmp.OsrzuBUhBm update-grub
/usr/sbin/grub-probe: error: failed to get canonical path of `/dev/mapper/xenvg-ba3ee6b1--5643--4e74--838d--52c0e1402347.disk0-1'.
...
run-parts: /etc/ganeti/instance-debootstrap/hooks/grub exited with return code 1