Skip to content

Instantly share code, notes, and snippets.

@jpmx
Last active December 14, 2015 19:18
Show Gist options
  • Save jpmx/5135047 to your computer and use it in GitHub Desktop.
Save jpmx/5135047 to your computer and use it in GitHub Desktop.
nova fails to boot a VM with "OSError: [Errno 2] No such file or directory" When I launch a VM with --flavor 0 (no disk) it works, but fail when the flavor has disk
2013-03-11 11:22:00 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Result was 0 execute /usr/lib/python2.7/dist-packages/nova/utils.py:203
2013-03-11 11:22:00 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Running cmd (subprocess): env LC_ALL=C LANG=C qemu-img info /var/lib/nova/instances/_base/876d0b1240b2bfa3bb04fa14f184db987604d322.converted execute /usr/lib/python2.7/dist-packages/nova/utils.py:187
2013-03-11 11:22:00 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Result was 0 execute /usr/lib/python2.7/dist-packages/nova/utils.py:203
2013-03-11 11:22:00 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Got semaphore "/var/lib/nova/instances/_base/876d0b1240b2bfa3bb04fa14f184db987604d322" for method "copy_qcow2_image"... inner /usr/lib/python2.7/dist-packages/nova/utils.py:765
2013-03-11 11:22:00 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Attempting to grab file lock "/var/lib/nova/instances/_base/876d0b1240b2bfa3bb04fa14f184db987604d322" for method "copy_qcow2_image"... inner /usr/lib/python2.7/dist-packages/nova/utils.py:769
2013-03-11 11:22:00 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Got file lock "/var/lib/nova/instances/_base/876d0b1240b2bfa3bb04fa14f184db987604d322" for method "copy_qcow2_image"... inner /usr/lib/python2.7/dist-packages/nova/utils.py:795
2013-03-11 11:22:00 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Running cmd (subprocess): cp /var/lib/nova/instances/_base/876d0b1240b2bfa3bb04fa14f184db987604d322 /var/lib/nova/instances/_base/876d0b1240b2bfa3bb04fa14f184db987604d322_40 execute /usr/lib/python2.7/dist-packages/nova/utils.py:187
2013-03-11 11:22:07 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Result was 0 execute /usr/lib/python2.7/dist-packages/nova/utils.py:203
2013-03-11 11:22:07 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Running cmd (subprocess): env LC_ALL=C LANG=C qemu-img info /var/lib/nova/instances/_base/876d0b1240b2bfa3bb04fa14f184db987604d322_40 execute /usr/lib/python2.7/dist-packages/nova/utils.py:187
2013-03-11 11:22:07 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Result was 0 execute /usr/lib/python2.7/dist-packages/nova/utils.py:203
2013-03-11 11:22:07 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Running cmd (subprocess): qemu-img resize /var/lib/nova/instances/_base/876d0b1240b2bfa3bb04fa14f184db987604d322_40 42949672960 execute /usr/lib/python2.7/dist-packages/nova/utils.py:187
2013-03-11 11:22:07 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Result was 0 execute /usr/lib/python2.7/dist-packages/nova/utils.py:203
2013-03-11 11:22:07 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Running cmd (subprocess): e2fsck -fp /var/lib/nova/instances/_base/876d0b1240b2bfa3bb04fa14f184db987604d322_40 execute /usr/lib/python2.7/dist-packages/nova/utils.py:187
2013-03-11 11:22:07 ERROR nova.compute.manager [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] Instance failed to spawn
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] Traceback (most recent call last):
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 747, in _spawn
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] block_device_info)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 117, in wrapped
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] temp_level, payload)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] self.gen.next()
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 92, in wrapped
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] return f(*args, **kw)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 1090, in spawn
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] admin_pass=admin_password)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 1356, in _create_image
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] project_id=instance['project_id'])
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/imagebackend.py", line 126, in cache
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] *args, **kwargs)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/imagebackend.py", line 175, in create_image
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] copy_qcow2_image(base, self.path, size)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/utils.py", line 796, in inner
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] retval = f(*args, **kwargs)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/imagebackend.py", line 170, in copy_qcow2_image
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] disk.extend(qcow2_base, size)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/virt/disk/api.py", line 127, in extend
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] resize2fs(image)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/virt/disk/api.py", line 104, in resize2fs
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] utils.execute('e2fsck', '-fp', image, check_exit_code=check_exit_code)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/nova/utils.py", line 195, in execute
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] shell=shell)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/dist-packages/eventlet/green/subprocess.py", line 25, in __init__
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] subprocess_orig.Popen.__init__(self, args, 0, *argss, **kwds)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] errread, errwrite)
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] raise child_exception
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee] OSError: [Errno 2] No such file or directory
2013-03-11 11:22:07 1693 TRACE nova.compute.manager [instance: ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee]
2013-03-11 11:22:07 DEBUG nova.utils [req-0918d30d-00b8-45b0-b2b8-a4743c879ac6 50398e8030bb497a9a4bbd1429576ad2 411625da55b546e2ba68b8dc9e111ab6] Got semaphore "compute_resources" for method "abort_resource_claim"... inner /usr/lib/python2.7/dist-packages/nova/utils.py:765
root@host3:~# uname -a
Linux host3 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
root@host3:~# nova-manage version
2012.2.2-dev (2012.2.2-LOCALBRANCH:LOCALREVISION)
root@host3:/var/lib/nova/instances/instance-00000005# nova list
+--------------------------------------+------+--------+----------+
| ID | Name | Status | Networks |
+--------------------------------------+------+--------+----------+
| ab2bf4b8-b103-4ce6-8b7d-d883a135c4ee | vm1 | ERROR | |
+--------------------------------------+------+--------+----------+
root@host3:~# nova-manage service list
Binary Host Zone Status State Updated_At
nova-cert host3 nova enabled :-) 2013-03-11 15:25:09
nova-compute host3 nova enabled :-) 2013-03-11 15:25:02
nova-consoleauth host3 nova enabled :-) 2013-03-11 15:25:09
nova-scheduler host3 nova enabled :-) 2013-03-11 15:25:09
nova-network host3 nova enabled :-) 2013-03-11 15:25:09
root@host3:~# glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
be091987-c055-43f8-8bc4-75cf4593d779 Ubuntu 12.04.2 LTS (Precise Pa qcow2 ovf 251068416
root@host3:/var/lib/nova# ls -la
total 200
drwxr-xr-x 9 nova nova 4096 Mar 11 11:07 .
drwxr-xr-x 45 root root 4096 Mar 11 11:08 ..
drwxr-xr-x 2 nova nova 4096 Feb 22 03:58 buckets
drwxr-xr-x 8 nova nova 4096 Mar 11 11:07 CA
drwxr-xr-x 2 nova nova 4096 Feb 22 03:58 images
drwxr-xr-x 4 nova nova 4096 Mar 11 11:22 instances
drwxr-xr-x 2 nova nova 4096 Feb 22 03:58 keys
drwxr-xr-x 2 nova nova 4096 Mar 11 11:11 networks
-rw-r----- 1 nova nova 158720 Mar 11 11:07 nova.sqlite
-rw------- 1 nova nova 1024 Mar 11 11:07 .rnd
drwxr-xr-x 2 nova nova 4096 Feb 22 03:58 tmp
root@host3:/var/lib/nova/instances# ls -la
total 16
drwxr-xr-x 4 nova nova 4096 Mar 11 11:22 .
drwxr-xr-x 9 nova nova 4096 Mar 11 11:07 ..
drwxrwxr-x 2 nova nova 4096 Mar 11 11:22 _base
drwxrwxr-x 2 nova nova 4096 Mar 11 11:21 instance-00000005
root@host3:/var/lib/nova/instances/instance-00000005# ls -la
total 12
drwxrwxr-x 2 nova nova 4096 Mar 11 11:21 .
drwxr-xr-x 4 nova nova 4096 Mar 11 11:22 ..
-rw-rw---- 1 nova nova 0 Mar 11 11:21 console.log
-rw-rw-r-- 1 nova nova 1342 Mar 11 11:21 libvirt.xml
root@host3:/var/lib/nova/instances/_base# ls -la
total 1041264
drwxrwxr-x 2 nova nova 4096 Mar 11 11:22 .
drwxr-xr-x 4 nova nova 4096 Mar 11 11:22 ..
-rw-r--r-- 1 nova nova 2147483648 Mar 11 11:22 876d0b1240b2bfa3bb04fa14f184db987604d322
-rw-rw-r-- 1 nova nova 251068416 Mar 11 11:21 876d0b1240b2bfa3bb04fa14f184db987604d322.part
root@host3:/var/lib/nova/instances/_base# qemu-img info 876d0b1240b2bfa3bb04fa14f184db987604d322
image: 876d0b1240b2bfa3bb04fa14f184db987604d322
file format: raw
virtual size: 2.0G (2147483648 bytes)
disk size: 777M
root@host3:/var/lib/nova/instances/_base# qemu-img info 876d0b1240b2bfa3bb04fa14f184db987604d322.part
image: 876d0b1240b2bfa3bb04fa14f184db987604d322.part
file format: qcow2
virtual size: 2.0G (2147483648 bytes)
disk size: 239M
cluster_size: 65536
[DEFAULT]
# LOGS/STATE
debug=false
verbose=true
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/var/lock/nova
rootwrap_config=/etc/nova/rootwrap.conf
# SCHEDULER
compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler
# DATABASE
sql_connection=mysql://nova:[email protected]/nova
# COMPUTE
libvirt_type=kvm
libvirt_inject_key=true
libvirt_inject_password=true
compute_driver=libvirt.LibvirtDriver
instance_name_template=instance-%08x
api_paste_config=/etc/nova/api-paste.ini
#cpu_allocation_ratio=16.0
#max_cores=6
resume_guests_state_on_host_boot=true
# COMPUTE/APIS: if you have separate configs for separate services
# this flag is required for both nova-api and nova-compute
allow_resize_to_same_host=True
# APIS
# volume_api_class=nova.volume.api.API
enabled_apis=ec2,osapi_compute
osapi_compute_extension=nova.api.openstack.compute.contrib.standard_extensions
ec2_dmz_host=127.0.0.1
s3_host=127.0.0.1
api_rate_limit=false
# RABBITMQ
rpc_backend=nova.rpc.impl_kombu
rabbit_host=127.0.0.1
# GLANCE
image_service=nova.image.glance.GlanceImageService
glance_api_servers=127.0.0.1:9292
glance_host=127.0.0.1
# NETWORK SETUP
injected_network_template = /usr/share/nova/interfaces.template
firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
network_manager=nova.network.manager.FlatDHCPManager
force_dhcp_release=false
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
# dnsmasq_config_file=/etc/dnsmasq-nova.conf
# NETWORK ADDRESSES
flat_network_bridge=br100
public_interface=br100
flat_interface=eth0
fixed_range=192.168.0.0/24
# METADATA
metadata_host=127.0.0.1
# VOLUMES
volume_api_class=nova.volume.cinder.API
enabled_apis=ec2,osapi_compute,metadata
volume_group=cinder-volumes
volume_name_template=volume-%s
# We're not using shared storage
# https://wiki.openstack.org/wiki/ReleaseNotes/2012.2.3
image_cache_manager_interval=40
# AUTHENTICATION
auth_strategy=keystone
[keystone_authtoken]
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
admin_tenant_name = admin
admin_user = admin
admin_password = 931710891e24187a9c2fbe32c9f9f37f756f1e51
signing_dir = /tmp/keystone-signing-nova
@jpmx
Copy link
Author

jpmx commented Mar 11, 2013

I found this question on Devstack with the same problem,
https://answers.launchpad.net/devstack/+question/221341

I tried to add this line to /etc/nova/rootwrap.conf as Devstack has:
exec_dirs "/sbin,/usr/sbin,/bin,/usr/bin"

But didn't work, finally this fixed it:

ln -s /sbin/e2fsck /usr/bin/e2fsck
ln -s /sbin/resize2fs /usr/bin/resize2fs

wtf... ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment