Ask Your Question
0

Boot VM using LXC, mount: wrong fs type, bad option, bad superblock

asked 2015-03-16 12:46:25 -0500

ashu gravatar image

updated 2015-03-17 13:21:20 -0500

smaffulli gravatar image

I need to boot Vm using LXC with Openstack Havana.I'm configuring Openstack LXC by specifying libvirt_type=lxc in /etc/nova/nova.conf.When I'm booting VM,i'm getting following error..

2015-03-16 19:42:54.116 10438 TRACE nova.compute.manager [instance: b6ea4d32-f740-4657-8d35-8b855e8767d6] NovaException: 
2015-03-16 19:42:54.116 10438 TRACE nova.compute.manager [instance: b6ea4d32-f740-4657-8d35-8b855e8767d6] --
2015-03-16 19:42:54.116 10438 TRACE nova.compute.manager [instance: b6ea4d32-f740-4657-8d35-8b855e8767d6] Failed to mount filesystem: Unexpected error while running command.
2015-03-16 19:42:54.116 10438 TRACE nova.compute.manager [instance: b6ea4d32-f740-4657-8d35-8b855e8767d6] Command: mount /dev/nbd2 /var/lib/nova/instances/b6ea4d32-f740-4657-8d35-8b855e8767d6/rootfs
2015-03-16 19:42:54.116 10438 TRACE nova.compute.manager [instance: b6ea4d32-f740-4657-8d35-8b855e8767d6] Exit code: 32
2015-03-16 19:42:54.116 10438 TRACE nova.compute.manager [instance: b6ea4d32-f740-4657-8d35-8b855e8767d6] Stdout: ''
2015-03-16 19:42:54.116 10438 TRACE nova.compute.manager [instance: b6ea4d32-f740-4657-8d35-8b855e8767d6] Stderr: 'mount: wrong fs type, bad option, bad superblock on /dev/nbd2,\n       missing codepage or helper program, or other error\n\n       In some cases useful info is found in syslog - try\n       dmesg | tail or so.\n'
2015-03-16 19:42:54.116 10438 TRACE nova.compute.manager [instance: b6ea4d32-f740-4657-8d35-8b855e8767d6] 
2015-03-16 19:43:05.681 10438 AUDIT nova.compute.resource_tracker [-] Auditing locally available compute resources

I'm using below glance commands to upload images:

glance add name="kernel" is_public=true container_format=aki disk_format=aki < /boot/uImage 
glance add name="rootfs_suricata" is_public=true container_format=ovf disk_format=qcow2  < rootfs.ext2.gz

I'm able to generate libvirt.xml file and able to boot VM manually from the libvirt.xml file. Below is the libvirt.xml file..

cat */libvirt.xml
<domain type="lxc">
  <uuid>c20e9668-f8b5-41d6-b62f-5ded651cdbaa</uuid>
  <name>instance-0000000b</name>
  <memory>524288</memory>
  <vcpu>1</vcpu>
  <os>
    <type machine="ppce500">exe</type>
    <cmdline>root=/dev/ram console=tty0 console=ttyS0,115200</cmdline>
    <init>/bin/sh</init>
  </os>
  <clock offset="utc"/>
  <devices>
    <filesystem type="mount">
      <source dir="/var/lib/nova/instances/c20e9668-f8b5-41d6-b62f-5ded651cdbaa/rootfs"/>
      <target dir="/"/>
    </filesystem>
    <interface type="bridge">
      <mac address="fa:16:3e:07:c0:98"/>
      <source bridge="br-int"/>
      <target dev="tapdf6a4bdc-ec"/>
      <virtualport type="openvswitch">
        <parameters interfaceid="df6a4bdc-ec88-43b9-b4bd-d9a0410df405"/>
      </virtualport>
    </interface>
    <console type="pty"/>
  </devices>
</domain>
edit retag flag offensive close merge delete

Comments

What format has been used for glance uploading image for your VM ?

dbaxps gravatar imagedbaxps ( 2015-03-16 13:10:21 -0500 )edit

hi

I'm able to sove this.

Thanks Abhishek Jain

ashu gravatar imageashu ( 2015-03-16 23:13:58 -0500 )edit

@ashu it would be good if you added the solution as an answer below, so that others will find it in the future

smaffulli gravatar imagesmaffulli ( 2015-03-17 13:22:12 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-17 23:14:05 -0500

ashu gravatar image

I have fixed this issue. The block devices can br mounted by passing -t devtmpfs as the mount parameter.

eg mount -t devtmpfs /dev/nbd8 /home/root/mnt

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2015-03-16 12:46:25 -0500

Seen: 626 times

Last updated: Mar 17 '15