| ... | ... |
@@ -53,9 +53,15 @@ fi |
| 53 | 53 |
# set root password to password |
| 54 | 54 |
echo root:pass | chroot $DEST chpasswd |
| 55 | 55 |
|
| 56 |
-# create a stack user |
|
| 57 |
-chroot $DEST useradd stack -s /bin/bash -d /opt |
|
| 56 |
+# Create a stack user that is a member of the libvirtd group so that stack |
|
| 57 |
+# is able to interact with libvirt. |
|
| 58 |
+chroot $DEST groupadd libvirtd |
|
| 59 |
+chroot $DEST useradd stack -s /bin/bash -d /opt -G libvirtd |
|
| 60 |
+# a simple password - pass |
|
| 58 | 61 |
echo stack:pass | chroot $DEST chpasswd |
| 62 |
+# give stack ownership over /opt so it may do the work needed |
|
| 59 | 63 |
chroot $DEST chown -R stack /opt |
| 60 | 64 |
|
| 65 |
+# and has sudo ability (in the future this should be limited to only what |
|
| 66 |
+# stack requires) |
|
| 61 | 67 |
echo "stack ALL=(ALL) NOPASSWD: ALL" >> $DEST/etc/sudoers |
| ... | ... |
@@ -92,6 +92,8 @@ cd $DASH_DIR/openstack-dashboard; sudo python setup.py develop |
| 92 | 92 |
# device - used to manage qcow images) |
| 93 | 93 |
sudo modprobe nbd || true |
| 94 | 94 |
sudo modprobe kvm || true |
| 95 |
+# user needs to be member of libvirtd group for nova-compute to use libvirt |
|
| 96 |
+sudo usermod -a -G libvirtd `whoami` |
|
| 95 | 97 |
# if kvm wasn't running before we need to restart libvirt to enable it |
| 96 | 98 |
sudo /etc/init.d/libvirt-bin restart |
| 97 | 99 |
|
| ... | ... |
@@ -105,6 +107,7 @@ mkdir -p $NOVA_DIR/instances |
| 105 | 105 |
# FIXME: if already mounted this blows up... |
| 106 | 106 |
if [ -L /dev/disk/by-label/nova-instances ]; then |
| 107 | 107 |
sudo mount -L nova-instances $NOVA_DIR/instances |
| 108 |
+ sudo chown -R `whoami` $NOVA_DIR/instances |
|
| 108 | 109 |
fi |
| 109 | 110 |
|
| 110 | 111 |
# *Dashboard*: setup django application to serve via apache/wsgi |
| ... | ... |
@@ -187,6 +190,8 @@ $NOVA_DIR/bin/nova-manage db sync |
| 187 | 187 |
|
| 188 | 188 |
# initialize keystone with default users/endpoints |
| 189 | 189 |
rm -f /opt/keystone/keystone.db |
| 190 |
+# FIXME keystone creates a keystone.log wherever you run it from (bugify) |
|
| 191 |
+cd /tmp |
|
| 190 | 192 |
BIN_DIR=$KEYSTONE_DIR/bin bash $DIR/files/keystone_data.sh |
| 191 | 193 |
|
| 192 | 194 |
# create a small network |
| ... | ... |
@@ -197,7 +202,10 @@ $NOVA_DIR/bin/nova-manage floating create $FLOATING_RANGE |
| 197 | 197 |
|
| 198 | 198 |
# delete existing glance images/database. Glance will recreate the db |
| 199 | 199 |
# when it is ran. |
| 200 |
-#rm -rf /var/lib/glance/images/* |
|
| 200 |
+# FIXME: configure glance not to shove files in /var/lib/glance? |
|
| 201 |
+sudo mkdir -p /var/lib/glance |
|
| 202 |
+sudo chown -R `whoami` /var/lib/glance |
|
| 203 |
+rm -rf /var/lib/glance/images/* |
|
| 201 | 204 |
rm -f $GLANCE_DIR/glance.sqlite |
| 202 | 205 |
|
| 203 | 206 |
# nova api crashes if we start it with a regular screen command, |
| ... | ... |
@@ -209,13 +217,15 @@ function screen_it {
|
| 209 | 209 |
|
| 210 | 210 |
screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf" |
| 211 | 211 |
screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=etc/glance-registry.conf" |
| 212 |
-screen_it key "$KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_DIR/etc/keystone.conf" |
|
| 212 |
+# keystone drops a keystone.log where if it is run, so change the path to |
|
| 213 |
+# where it can write |
|
| 214 |
+screen_it key "cd /tmp; $KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_DIR/etc/keystone.conf" |
|
| 213 | 215 |
screen_it n-api "$NOVA_DIR/bin/nova-api" |
| 214 | 216 |
screen_it n-cpu "$NOVA_DIR/bin/nova-compute" |
| 215 | 217 |
screen_it n-net "$NOVA_DIR/bin/nova-network" |
| 216 | 218 |
screen_it n-sch "$NOVA_DIR/bin/nova-scheduler" |
| 217 | 219 |
screen_it n-vnc "$NOVA_DIR/bin/nova-vncproxy" |
| 218 |
-screen_it dash "/etc/init.d/apache2 restart; tail -f /var/log/apache2/error.log" |
|
| 220 |
+screen_it dash "sudo /etc/init.d/apache2 restart; tail -f /var/log/apache2/error.log" |
|
| 219 | 221 |
|
| 220 | 222 |
|
| 221 | 223 |
# ---- download an install images ---- |