OpenStack Compute (Nova)

libvirt rescue fails w/ Permission denied on console.log

Reported by Dan Prince on 2012-03-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Dan Prince

Bug Description

Using libvirt on Fedora 16 w/ latest Folsom source. I'm getting the following exception when trying to perform an OSAPI rescue:

2012-03-29 18:24:30 ERROR nova.rpc.amqp [req-9b09f6ad-e472-4f06-a955-a81c7c132af2 fca94f8fc77f426092a785975a56bb82 aa3ef8032a4e4ad3b68a3d6bef51cf91] Exception during message handling
(nova.rpc.amqp): TRACE: Traceback (most recent call last):
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/rpc/amqp.py", line 252, in _process_data
(nova.rpc.amqp): TRACE: rval = node_func(context=ctxt, **node_args)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/exception.py", line 114, in wrapped
(nova.rpc.amqp): TRACE: return f(*args, **kw)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 153, in decorated_function
(nova.rpc.amqp): TRACE: function(self, context, instance_uuid, *args, **kwargs)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 177, in decorated_function
(nova.rpc.amqp): TRACE: sys.exc_info())
(nova.rpc.amqp): TRACE: File "/usr/lib64/python2.7/contextlib.py", line 24, in __exit__
(nova.rpc.amqp): TRACE: self.gen.next()
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 171, in decorated_function
(nova.rpc.amqp): TRACE: return function(self, context, instance_uuid, *args, **kwargs)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1127, in rescue_instance
(nova.rpc.amqp): TRACE: self._legacy_nw_info(network_info), image_meta)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/exception.py", line 114, in wrapped
(nova.rpc.amqp): TRACE: return f(*args, **kw)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/connection.py", line 800, in rescue
(nova.rpc.amqp): TRACE: network_info=network_info)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/connection.py", line 1125, in _create_image
(nova.rpc.amqp): TRACE: libvirt_utils.write_to_file(basepath('console.log', ''), '', 007)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/utils.py", line 152, in write_to_file
(nova.rpc.amqp): TRACE: with open(path, 'w') as f:
(nova.rpc.amqp): TRACE: IOError: [Errno 13] Permission denied: '/var/lib/nova/instances/instance-00000004/console.log'

The permission in the libvirt instances directory are as follows:

-rw-rw---- 1 qemu qemu 20943 Mar 29 18:24 console.log
-rw-r--r-- 1 qemu qemu 23068672 Mar 29 18:27 disk
-rw-r--r-- 1 qemu qemu 4404752 Mar 29 18:23 kernel
-rw-r--r-- 1 nova nova 1340 Mar 29 18:23 libvirt.xml
-rw-r--r-- 1 nova nova 1510 Mar 29 18:24 libvirt.xml.rescue
-rw-r--r-- 1 qemu qemu 5882349 Mar 29 18:23 ramdisk
-rw-r--r-- 1 nova nova 2733 Mar 29 18:24 unrescue.xml

----

Allowing the nova user to read/write console.log should fix this issue....

Dan Prince (dan-prince) on 2012-03-29
Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
status: New → In Progress
Changed in nova:
milestone: none → essex-rc2
Dan Prince (dan-prince) on 2012-03-29
Changed in nova:
importance: Undecided → Medium

Reviewed: https://review.openstack.org/5969
Committed: http://github.com/openstack/nova/commit/a837f92e39c74f1a97e358f1a8ecfcdb0915bf6c
Submitter: Jenkins
Branch: master

commit a837f92e39c74f1a97e358f1a8ecfcdb0915bf6c
Author: Dan Prince <email address hidden>
Date: Thu Mar 29 16:25:10 2012 -0400

    Fix libvirt rescue.

    Updates libvirt connection.py so that it chowns console.log
    correctly when performing a rescue.

    Fixes LP Bug #968587.

    Change-Id: I38a97df92330a9f20f43e9e4598da3375c6a22dc

Changed in nova:
status: In Progress → Fix Committed

Reviewed: https://review.openstack.org/6013
Committed: http://github.com/openstack/nova/commit/f2fe34e8b0ab89d7b2605e9d4b4c7bb8ca94d5ea
Submitter: Jenkins
Branch: milestone-proposed

commit f2fe34e8b0ab89d7b2605e9d4b4c7bb8ca94d5ea
Author: Dan Prince <email address hidden>
Date: Thu Mar 29 16:25:10 2012 -0400

    Fix libvirt rescue.

    Updates libvirt connection.py so that it chowns console.log
    correctly when performing a rescue.

    Fixes LP Bug #968587.

    Change-Id: I38a97df92330a9f20f43e9e4598da3375c6a22dc

Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-rc2 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers