When doing an lvdisplay, nova-rootwrap tries to interpret the name of the logical volume as an integer PID. See below the example nova-volume.log output when trying to delete a Volume:
root@server:/var/log/nova# tailf nova-volume.log
2012-02-06 17:31:37,816 INFO nova.volume.manager [-] Clear capabilities
2012-02-06 17:31:37,963 ERROR nova.volume.driver [-] Recovering from a failed execute. Try number 1
(nova.volume.driver): TRACE: Traceback (most recent call last):
(nova.volume.driver): TRACE: File "/usr/lib/python2.7/dist-packages/nova/volume/driver.py", line 86, in _try_execute
(nova.volume.driver): TRACE: self._execute(*command, **kwargs)
(nova.volume.driver): TRACE: File "/usr/lib/python2.7/dist-packages/nova/utils.py", line 232, in execute
(nova.volume.driver): TRACE: cmd=' '.join(cmd))
(nova.volume.driver): TRACE: ProcessExecutionError: Unexpected error while running command.
(nova.volume.driver): TRACE: Command: sudo nova-rootwrap lvdisplay vg_nova-volumes/volume-00000003
(nova.volume.driver): TRACE: Exit code: 1
(nova.volume.driver): TRACE: Stdout: ''
(nova.volume.driver): TRACE: Stderr: 'Traceback (most recent call last):\n File "/usr/bin/nova-rootwrap", line 63, in <module>\n filtermatch = wrapper.match_filter(filters, userargs)\n File "/usr/lib/python2.7/dist-packages/nova/rootwrap/wrapper.py", line 51, in match_filter\n if f.match(userargs):\n File "/usr/lib/python2.7/dist-packages/nova/rootwrap/filters.py", line 116, in match\n pid = int(args[1])\nValueError: invalid literal for int() with base 10: \'vg_nova-volumes/volume-00000003\'\n'
(nova.volume.driver): TRACE:
2012-02-06 17:31:39,005 ERROR nova.volume.driver [-] Recovering from a failed execute. Try number 2
(nova.volume.driver): TRACE: Traceback (most recent call last):
(nova.volume.driver): TRACE: File "/usr/lib/python2.7/dist-packages/nova/volume/driver.py", line 86, in _try_execute
(nova.volume.driver): TRACE: self._execute(*command, **kwargs)
(nova.volume.driver): TRACE: File "/usr/lib/python2.7/dist-packages/nova/utils.py", line 232, in execute
(nova.volume.driver): TRACE: cmd=' '.join(cmd))
(nova.volume.driver): TRACE: ProcessExecutionError: Unexpected error while running command.
(nova.volume.driver): TRACE: Command: sudo nova-rootwrap lvdisplay vg_nova-volumes/volume-00000003
(nova.volume.driver): TRACE: Exit code: 1
(nova.volume.driver): TRACE: Stdout: ''
(nova.volume.driver): TRACE: Stderr: 'Traceback (most recent call last):\n File "/usr/bin/nova-rootwrap", line 63, in <module>\n filtermatch = wrapper.match_filter(filters, userargs)\n File "/usr/lib/python2.7/dist-packages/nova/rootwrap/wrapper.py", line 51, in match_filter\n if f.match(userargs):\n File "/usr/lib/python2.7/dist-packages/nova/rootwrap/filters.py", line 116, in match\n pid = int(args[1])\nValueError: invalid literal for int() with base 10: \'vg_nova-volumes/volume-00000003\'\n'
(nova.volume.driver): TRACE:
I forgot to add, the workaround is to change the value of "--root_helper" in nova.conf as follows (so that it is using just "sudo"):
#--root_helper=sudo nova-rootwrap
--root_helper=sudo
And place the following line in sudoers (not secure, but OK in the particular R&D I am running at the moment):
nova ALL=(ALL) NOPASSWD: ALL
This system is Ubuntu 11.10x64 running trunk PPA's.
Hoping this helps others til the guru can finalise the superior "sudo nova-rootwrap" method.
Cheers,
Paul