summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorDan Prince <dan.prince@rackspace.com>2011-04-11 14:16:17 -0400
committerDan Prince <dan.prince@rackspace.com>2011-04-11 14:16:17 -0400
commit1c13695a2c5e5d14ead3f5459d0b40bb875ecdf6 (patch)
tree6c1d4f079cb4fc6023ff3aefec69c0ae16a7517d /nova
parentb6c66b55af3825fa4f48208071565b0af31c0618 (diff)
Sudo chown the vbd device to the nova user before streaming data to it. This
resolves an issue where nova-compute required 'root' privs to successfully create nodes with connection_type=xenapi.
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/xenapi/vm_utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index d2045a557..50fdf3e30 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -1012,6 +1012,8 @@ def _stream_disk(dev, image_type, virtual_size, image_file):
offset = MBR_SIZE_BYTES
_write_partition(virtual_size, dev)
+ utils.execute('sudo', 'chown', os.getuid(), '/dev/%s' % dev)
+
with open('/dev/%s' % dev, 'wb') as f:
f.seek(offset)
for chunk in image_file: