On Tue, Oct 11, 2011 at 09:46:10PM +0100, Mark McLoughlin wrote:
$> glance add name=a-fedora-appliance-kernel < /var/lib/a-fedora-appliance/kernel Added new image with ID: 4 $> glance add name=a-fedora-appliance-initrd < /var/lib/a-fedora-appliance/initrd Added new image with ID: 5 $> glance add name=a-fedora-appliance-root < /var/lib/a-fedora-appliance/root Added new image with ID: 6
$> euca-run-instances a-fedora-appliance-root --kernel a-fedora-appliance-kernel --ramdisk a-fedora-appliance-initrd -k nova_key
$> euca-get-console-output i-00000001
A few problems, though:
- I got a kernel panic, see below
The panic seems to be because in febootstrap we always look for the last disk image as the root disk. eg. If there is /dev/vda and /dev/vdb as there appears to be here, then /dev/vdb is the one we expect as 'root'.
The reason for this is obscure -- to do with libguestfs where we always want [/dev/vda ..] to be the disks added by the user, and the last disk is the hidden appliance root.
Is it possible to rearrange the disks?
- We need to include a script which will download you public SSH key from the EC2 metadata API; see what I added with Oz. We could even use cloud-init for that instead
Yeah I guess if it was up to me I'd do it with libguestfs / virt-sysprep, but that's something to get upstream.
- The root image is still 4Gb, which means copying 4Gb to glance and then copying it back down to glance. The beauty of the tty images is that these copies are all small and then Nova resizes the image up to 10Gb automatically.
Of course it's really ~600 MB, because it's a sparse file, but yes.
[...]
febootstrap: internal insmod virtio_blk.ko [ 0.657670] vda: unknown partition table [ 0.659476] vdb: unknown partition table
^ two disks
febootstrap: internal insmod virtio_net.ko febootstrap: picked /sys/block/vdb/dev as root device
^ picks the second disk
febootstrap: creating /dev/root as block special 252:16 febootstrap: mounting new root on /root [ 0.664363] EXT4-fs (vdb): mounting ext2 file system using the ext4 subsystem [ 1.198440] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input2 [ 1.200879] EXT4-fs (vdb): mounted filesystem with ordered data mode. Opts: febootstrap: chroot /proc/uptime: No such file or directory execl: /init: No such file or directory febootstrap: debug: listing directory / 2 d .. 040755 4096 8774:8774 11 d lost+found 040700 16384 0:0 2 d . 040755 4096 8774:8774
^ tries to mount /dev/vdb, chroot and run /init, but fails in the chroot (although the mount is OK for some reason).
Rich.