From b1dc9bd5e43568e0fc96b4e2be4520be12a1d955 Mon Sep 17 00:00:00 2001 From: Mate Lakat Date: Thu, 29 Aug 2013 11:52:20 +0100 Subject: [PATCH] xenapi: enable block device access for stack user Although nova is setting the permissions on block devices, sometimes it fails, and that results in an instance failing to launch. It is only an issue for 3-part images, and images accessed through block devices. This patch adds an udev rule, so that devices will be accessible. fixes bug 1218251 Change-Id: I837ea515457fbfc50e9ce138ea9de9db12baa8be --- tools/xen/prepare_guest.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/xen/prepare_guest.sh b/tools/xen/prepare_guest.sh index f109d723d9..6ec5ffa546 100755 --- a/tools/xen/prepare_guest.sh +++ b/tools/xen/prepare_guest.sh @@ -48,6 +48,11 @@ useradd $STACK_USER -s /bin/bash -d /opt/stack -G libvirtd echo $STACK_USER:$GUEST_PASSWORD | chpasswd echo "$STACK_USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +# Add an udev rule, so that new block devices could be written by stack user +cat > /etc/udev/rules.d/50-openstack-blockdev.rules << EOF +KERNEL=="xvd[b-z]", GROUP="$STACK_USER", MODE="0660" +EOF + # Give ownership of /opt/stack to stack user chown -R $STACK_USER /opt/stack