Ask Your Question
0

Fail to boot vm, with nova compute complain: Unable to mount image

asked 2013-12-21 18:08:02 -0500

DennyZhang gravatar image

updated 2013-12-22 09:26:18 -0500

When booting a Fedora 17 vm, the vm console complain

,-----------
| Welcom to emergency mode. Use "systemctl default" or ^D to enter default mode.
| 
| Give root password for maintenance
| (or type Control-D to continue):
`-----------

,----------- nova compute: compute.log
| 2013-12-18 23:16:22.325 2502 DEBUG nova.virt.disk.vfs.guestfs [req-9bb7ee30-8c75-4344-a58f-7f868f7e8d4c b426464726c447239b00c6f9530ae323 67235dbad32449488e7f4b3d817266b7] Mount guest OS image /var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk partition None setup_os_static /usr/lib/python2.6/site-packages/nova/virt/disk/vfs/guestfs.py:57
| 2013-12-18 23:16:22.393 2502 DEBUG nova.virt.disk.api [req-9bb7ee30-8c75-4344-a58f-7f868f7e8d4c b426464726c447239b00c6f9530ae323 67235dbad32449488e7f4b3d817266b7] Unable to mount image /var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk with error Error mounting /var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk with libguestfs (mount_options: /dev/sda1 on / (options: ''): mount: you must specify the filesystem type). Cannot resize. is_image_partitionless /usr/lib/python2.6/site-packages/nova/virt/disk/api.py:182
`-----------

I can reproduce the problem out of nova.

,-----------
| [root@compute ~]# qemu-img create -f qcow2 -o backing_file=/var/lib/nova/instances/_base/da098c9e9b9bba6e4bcbf48e04b52e2c688f702e /var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk
| <var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk
| Formatting '/var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk', fmt=qcow2 size=10737418240 backing_file='/var/lib/nova/instances/_base/da098c9e9b9bba6e4bcbf48e04b52e2c688f702e' encryption=off cluster_size=65536 
| [root@compute ~]# env LC_ALL=C LANG=C qemu-img info /var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk
| <var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk
| image: /var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk
| file format: qcow2
| virtual size: 10G (10737418240 bytes)
| disk size: 196K
| cluster_size: 65536
| backing file: /var/lib/nova/instances/_base/da098c9e9b9bba6e4bcbf48e04b52e2c688f702e
| [root@compute ~]# cd /var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/
| <ib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/
| [root@compute 84ad06df-1223-4e49-ba83-660053f00061]# ls -lth
| ls -lth
| total 7.0M
| -rw-r--r--. 1 root root 257K Dec 19 00:29 disk
| -rw-rw----. 1 qemu qemu    0 Dec 18 23:17 console.log
| -rw-r--r--. 1 nova nova 1.5K Dec 18 23:17 libvirt.xml
| [root@compute 84ad06df-1223-4e49-ba83-660053f00061]# qemu-img resize /var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk 21474836480
| <ova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk 21474836480
| Image resized.
| [root@compute 84ad06df-1223-4e49-ba83-660053f00061]# ls -lth
| ls -lth
| total 7.0M
| -rw-r--r--. 1 root root 257K Dec 19 00:29 disk
| -rw-rw----. 1 qemu qemu    0 Dec 18 23:17 console.log
| -rw-r--r--. 1 nova nova 1.5K Dec 18 23:17 libvirt.xml
| [root@compute 84ad06df-1223-4e49-ba83-660053f00061]# python
| python
| Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22) 
| [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
| Type "help", "copyright", "credits" or "license" for more information.
| >>> import guestfs
| from eventlet import tpool
| 
| image="/var/lib/nova/instances/84ad06df-1223-4e49-ba83-660053f00061/disk"
| 
| import guestfs
| >>> from eventlet import tpool
| >>> 
| <stances/84ad06df-1223-4e49-ba83-660053f00061/disk"
| >>> 
| >>> handle = tpool.Proxy(guestfs.GuestFS())
| handle = tpool.Proxy(guestfs.GuestFS())
| >>> handle.add_drive_opts(image, format="qcow2")
| handle.add_drive_opts(image, format="qcow2")
| >>> handle.launch()
| handle.launch()| 
| >>> 
| >>> 
| >>> 
| >>> handle.mount_options("", "/dev/sda", "/")
| handle.mount_options("", "/dev/sda", "/")
| Traceback (most recent call last):
|   File "<stdin>", line 1, in <module>
|   File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 187, in doit
|     result = proxy_call(self._autowrap, f, *args, **kwargs)
|   File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 147, in proxy_call
|     rv = execute(f ...
(more)
edit retag flag offensive close merge delete

Comments

The error message of unmount is the same as bug 1246852, but applying the patch doesn't work. https://bugs.launchpad.net/nova/+bug/1246852

DennyZhang gravatar imageDennyZhang ( 2013-12-22 00:24:50 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-12-22 05:14:56 -0500

rwmjones gravatar image

With the latest version of openstack, if libvirt_inject_partition is -1 then libguestfs should use inspection to determine the correct mounts. So you should check /etc/nova/nova.conf to find out what that setting is.

edit flag offensive delete link more

Comments

@rwmjones, seems the default value of libvirt_inject_partition in nova.conf option is -1.

DennyZhang gravatar imageDennyZhang ( 2013-12-22 09:23:45 -0500 )edit

I have the same problem as described above ("must specify filetype" error) with Icehouse on Ubuntu 14.04. The default of libvirt_inject_partition is -2 (found in /usr/lib/python2.6/dist-packages/nova/virt/libvirt/driver.py). Setting it to -1 in /etc/nova/nova.conf sadly didn't fix the error for me.

I see other people having the same error but there haven't been answers.

misterblueguy gravatar imagemisterblueguy ( 2014-06-24 16:45:55 -0500 )edit

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

2 followers

Stats

Asked: 2013-12-21 18:08:02 -0500

Seen: 1,915 times

Last updated: Dec 22 '13