Fail to boot vm, with nova compute complain: Unable to mount image
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 ...
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