[openstack-nova] Initial Import

Mark McLoughlin markmc at fedoraproject.org
Tue Aug 30 05:22:28 UTC 2011


commit 430fcdb4f519438525bc3bbccc6480dcbce8bfd8
Author: Mark McLoughlin <markmc at redhat.com>
Date:   Tue Aug 30 06:08:56 2011 +0100

    Initial Import

 .gitignore                                         |    1 +
 ...uire-bridge_interface-for-flatdhcpmanager.patch |   28 ++
 nova-fix-flavorid-migration-failure.patch          |   51 +++
 nova-fix-quotas-migration-failure.patch            |   84 +++++
 nova-ifc-template                                  |   15 +
 nova-polkit.pkla                                   |    6 +
 nova-sudoers                                       |   44 +++
 nova.conf                                          |   10 +
 nova.logrotate                                     |    9 +
 openstack-nova-ajax-console-proxy.init             |  102 ++++++
 openstack-nova-api.init                            |  110 ++++++
 openstack-nova-compute.init                        |  118 ++++++
 openstack-nova-direct-api.init                     |  110 ++++++
 openstack-nova-network.init                        |  116 ++++++
 openstack-nova-objectstore.init                    |  102 ++++++
 openstack-nova-scheduler.init                      |  102 ++++++
 openstack-nova-vncproxy.init                       |  102 ++++++
 openstack-nova-volume.init                         |  110 ++++++
 openstack-nova.spec                                |  376 ++++++++++++++++++++
 sources                                            |    1 +
 20 files changed, 1597 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..9c1b658 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/nova-2011.3~d4.tar.gz
diff --git a/nova-do-not-require-bridge_interface-for-flatdhcpmanager.patch b/nova-do-not-require-bridge_interface-for-flatdhcpmanager.patch
new file mode 100644
index 0000000..f58d2bf
--- /dev/null
+++ b/nova-do-not-require-bridge_interface-for-flatdhcpmanager.patch
@@ -0,0 +1,28 @@
+From ba747c32c7d9bfb89c3e5f8d62e5aa831af97cf9 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Wed, 17 Aug 2011 06:40:03 +0100
+Subject: [PATCH] Do not require --bridge_interface for FlatDHCPManager
+
+Unlike VlanManager, FlatDHCPManager actually works fine without a bridge
+interface on single host deployments.
+---
+ bin/nova-manage |    3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/bin/nova-manage b/bin/nova-manage
+index 077a89d..1baf433 100755
+--- a/bin/nova-manage
++++ b/bin/nova-manage
+@@ -714,8 +714,7 @@ class NetworkCommands(object):
+         bridge_interface = bridge_interface or FLAGS.flat_interface or \
+                            FLAGS.vlan_interface
+         if not bridge_interface:
+-            interface_required = ['nova.network.manager.FlatDHCPManager',
+-                                  'nova.network.manager.VlanManager']
++            interface_required = ['nova.network.manager.VlanManager']
+             if FLAGS.network_manager in interface_required:
+                 raise exception.NetworkNotCreated(req='--bridge_interface')
+ 
+-- 
+1.7.4.4
+
diff --git a/nova-fix-flavorid-migration-failure.patch b/nova-fix-flavorid-migration-failure.patch
new file mode 100644
index 0000000..6ec3ab4
--- /dev/null
+++ b/nova-fix-flavorid-migration-failure.patch
@@ -0,0 +1,51 @@
+From: Mark McLoughlin <markmc at redhat.com>
+Subject: [PATCH] Fix flavorid migration failure
+
+With sqlalchemy 0.7.2 and migrate 0.7.1, I was seeing:
+
+   Traceback (most recent call last):
+      File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 37, in db_sync
+        ret = IMPL.db_sync(version=version)
+      [...]
+      File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migrate_repo/versions/036_change_flavor_id_in_migrations.py", line 46, in upgrade
+        .values(old_instance_type_id=instance_type.id))
+      [...]
+      File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 301, in do_commit
+        connection.commit()
+    OperationalError: (OperationalError) database is locked None None
+
+It looks like the database is being held open as we iterate over the
+rows in the instance_types table.
+---
+ .../versions/036_change_flavor_id_in_migrations.py |   12 ++++++++----
+ 1 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/036_change_flavor_id_in_migrations.py b/nova/db/sqlalchemy/migrate_repo/versions/036_change_flavor_id_in_migrations.py
+index f324403..dfbd4ba 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/036_change_flavor_id_in_migrations.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/036_change_flavor_id_in_migrations.py
+@@ -40,13 +40,17 @@ def upgrade(migrate_engine):
+     migrations.create_column(new_instance_type_id)
+ 
+     # Convert flavor_id to instance_type_id
++    itypes = {}
+     for instance_type in migrate_engine.execute(instance_types.select()):
++        itypes[instance_type.id] = instance_type.flavorid
++
++    for instance_type_id in itypes.keys():
+         migrate_engine.execute(migrations.update()\
+-                .where(migrations.c.old_flavor_id == instance_type.flavorid)\
+-                .values(old_instance_type_id=instance_type.id))
++                .where(migrations.c.old_flavor_id == itypes[instance_type_id])\
++                .values(old_instance_type_id=instance_type_id))
+         migrate_engine.execute(migrations.update()\
+-                .where(migrations.c.new_flavor_id == instance_type.flavorid)\
+-                .values(new_instance_type_id=instance_type.id))
++                .where(migrations.c.new_flavor_id == itypes[instance_type_id])\
++                .values(new_instance_type_id=instance_type_id))
+ 
+     migrations.c.old_flavor_id.drop()
+     migrations.c.new_flavor_id.drop()
+-- 
+1.7.4.4
+
diff --git a/nova-fix-quotas-migration-failure.patch b/nova-fix-quotas-migration-failure.patch
new file mode 100644
index 0000000..09596b1
--- /dev/null
+++ b/nova-fix-quotas-migration-failure.patch
@@ -0,0 +1,84 @@
+From: Mark McLoughlin <markmc at redhat.com>
+Subject: [PATCH] Fix quotas migration failure
+
+With sqlalchemy 0.7.2 and migrate 0.7.1, I was seeing:
+
+   Traceback (most recent call last):
+     File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 37, in db_sync
+       ret = IMPL.db_sync(version=version)
+     [..]
+     File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migrate_repo/versions/016_make_quotas_key_and_value.py", line 189, in upgrade
+       new_quotas.rename('quotas')
+     [..]
+     File "/usr/lib/python2.7/site-packages/migrate/changeset/schema.py", line 479, in deregister
+       del meta.tables[key]
+     File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/_collections.py", line 38, in _immutable
+       raise TypeError("%s object is immutable" % self.__class__.__name__)
+   TypeError: immutabledict object is immutable
+
+This is actually a bug in sqlalchemy-migrate:
+
+  http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=128
+
+But it can be worked around by ensuring there isn't a 'quotas' table in
+the metadata's table hash before renaming.
+---
+ .../versions/016_make_quotas_key_and_value.py      |   18 ++++++++++++++----
+ 1 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/nova/db/sqlalchemy/migrate_repo/versions/016_make_quotas_key_and_value.py b/nova/db/sqlalchemy/migrate_repo/versions/016_make_quotas_key_and_value.py
+index a4fe3e4..56b2871 100644
+--- a/nova/db/sqlalchemy/migrate_repo/versions/016_make_quotas_key_and_value.py
++++ b/nova/db/sqlalchemy/migrate_repo/versions/016_make_quotas_key_and_value.py
+@@ -75,8 +75,8 @@ def new_style_quotas_table(name):
+                 )
+ 
+ 
+-def existing_quotas_table(migrate_engine):
+-    return Table('quotas', meta, autoload=True, autoload_with=migrate_engine)
++def quotas_table(migrate_engine, name='quotas'):
++    return Table(name, meta, autoload=True, autoload_with=migrate_engine)
+ 
+ 
+ def _assert_no_duplicate_project_ids(quotas):
+@@ -179,13 +179,18 @@ def upgrade(migrate_engine):
+     # bind migrate_engine to your metadata
+     meta.bind = migrate_engine
+ 
+-    old_quotas = existing_quotas_table(migrate_engine)
++    old_quotas = quotas_table(migrate_engine)
+     assert_old_quotas_have_no_active_duplicates(migrate_engine, old_quotas)
+ 
+     new_quotas = new_style_quotas_table('quotas_new')
+     new_quotas.create()
+     convert_forward(migrate_engine, old_quotas, new_quotas)
+     old_quotas.drop()
++
++    # clear metadata to work around this:
++    # http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=128
++    meta.clear()
++    new_quotas = quotas_table(migrate_engine, 'quotas_new')
+     new_quotas.rename('quotas')
+ 
+ 
+@@ -193,11 +198,16 @@ def downgrade(migrate_engine):
+     # Operations to reverse the above upgrade go here.
+     meta.bind = migrate_engine
+ 
+-    new_quotas = existing_quotas_table(migrate_engine)
++    new_quotas = quotas_table(migrate_engine)
+     assert_new_quotas_have_no_active_duplicates(migrate_engine, new_quotas)
+ 
+     old_quotas = old_style_quotas_table('quotas_old')
+     old_quotas.create()
+     convert_backward(migrate_engine, old_quotas, new_quotas)
+     new_quotas.drop()
++
++    # clear metadata to work around this:
++    # http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=128
++    meta.clear()
++    old_quotas = quotas_table(migrate_engine, 'quotas_old')
+     old_quotas.rename('quotas')
+-- 
+1.7.4.4
+
diff --git a/nova-ifc-template b/nova-ifc-template
new file mode 100644
index 0000000..647b6af
--- /dev/null
+++ b/nova-ifc-template
@@ -0,0 +1,15 @@
+DEVICE="$name"
+NM_CONTROLLED="no"
+ONBOOT=yes
+TYPE=Ethernet
+BOOTPROTO=static
+IPADDR=$address
+NETMASK=$netmask
+BROADCAST=$broadcast
+GATEWAY=$gateway
+DNS1=$dns
+
+#if $use_ipv6
+IPV6INIT=yes
+IPV6ADDR=$address_v6
+#end if
diff --git a/nova-polkit.pkla b/nova-polkit.pkla
new file mode 100644
index 0000000..ae1467d
--- /dev/null
+++ b/nova-polkit.pkla
@@ -0,0 +1,6 @@
+[Allow nova libvirt management permissions]
+Identity=unix-user:nova
+Action=org.libvirt.unix.manage
+ResultAny=yes
+ResultInactive=yes
+ResultActive=yes
diff --git a/nova-sudoers b/nova-sudoers
new file mode 100644
index 0000000..15341d5
--- /dev/null
+++ b/nova-sudoers
@@ -0,0 +1,44 @@
+Defaults:nova !requiretty
+
+Cmnd_Alias NOVACMDS = /bin/aoe-stat,                            \
+                      /bin/chmod,                               \
+                      /bin/chmod /var/lib/nova/tmp/*/root/.ssh, \
+                      /bin/chown,                               \
+                      /bin/chown /var/lib/nova/tmp/*/root/.ssh, \
+                      /bin/dd,                                  \
+                      /bin/kill,                                \
+                      /bin/mkdir,                               \
+                      /bin/mount,                               \
+                      /bin/umount,                              \
+                      /sbin/aoe-discover,                       \
+                      /sbin/ifconfig,                           \
+                      /sbin/ip,                                 \
+                      /sbin/ip6tables-restore,                  \
+                      /sbin/ip6tables-save,                     \
+                      /sbin/iptables,                           \
+                      /sbin/iptables-restore,                   \
+                      /sbin/iptables-save,                      \
+                      /sbin/iscsiadm,                           \
+                      /sbin/kpartx,                             \
+                      /sbin/losetup,                            \
+                      /sbin/lvcreate,                           \
+                      /sbin/lvdisplay,                          \
+                      /sbin/lvremove,                           \
+                      /sbin/pvcreate,                           \
+                      /sbin/route,                              \
+                      /sbin/tune2fs,                            \
+                      /sbin/vconfig,                            \
+                      /sbin/vgcreate,                           \
+                      /sbin/vgs,                                \
+                      /usr/bin/socat,                           \
+                      /usr/bin/tee,                             \
+        		      /usr/bin/qemu-nbd,            			\
+                      /usr/bin/virsh,                           \
+                      /usr/sbin/brctl,                          \
+                      /usr/sbin/dnsmasq,                        \
+                      /usr/sbin/ietadm,		            		\
+                      /usr/sbin/radvd,                          \
+                      /usr/sbin/tgtadm,                         \
+                      /usr/sbin/vblade-persist
+
+nova ALL = (root) NOPASSWD: SETENV: NOVACMDS
diff --git a/nova.conf b/nova.conf
new file mode 100644
index 0000000..07f5f87
--- /dev/null
+++ b/nova.conf
@@ -0,0 +1,10 @@
+--logdir=/var/log/nova
+--state_path=/var/lib/nova
+--lock_path=/var/lib/nova/tmp
+--dhcpbridge=/usr/bin/nova-dhcpbridge
+--dhcpbridge_flagfile=/etc/nova/nova.conf
+--injected_network_template=/usr/share/nova/interfaces.template
+--libvirt_xml_template=/usr/share/nova/libvirt.xml.template
+--vpn_client_template=/usr/share/nova/client.ovpn.template
+--credentials_template=/usr/share/nova/novarc.template
+--network_manager=nova.network.manager.FlatDHCPManager
diff --git a/nova.logrotate b/nova.logrotate
new file mode 100644
index 0000000..7ff0256
--- /dev/null
+++ b/nova.logrotate
@@ -0,0 +1,9 @@
+compress
+
+/var/log/nova/*.log {
+    weekly
+    rotate 4
+    missingok
+    compress
+    minsize 100k
+}
diff --git a/openstack-nova-ajax-console-proxy.init b/openstack-nova-ajax-console-proxy.init
new file mode 100644
index 0000000..30a4669
--- /dev/null
+++ b/openstack-nova-ajax-console-proxy.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-nova-ajax-console-proxy  OpenStack Nova web-based serial console proxy
+#
+# chkconfig:   - 20 80
+# description: OpenStack Nova web-based serial console proxy
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova web-based serial console proxy
+# Description: OpenStack Nova web-based serial console proxy
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=ajax-console-proxy
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-api.init b/openstack-nova-api.init
new file mode 100644
index 0000000..d97ed4d
--- /dev/null
+++ b/openstack-nova-api.init
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# openstack-nova-api  OpenStack Nova API Server
+#
+# chkconfig:   - 20 80
+# description: At the heart of the cloud framework is an API Server. \
+#              This API Server makes command and control of the      \
+#              hypervisor, storage, and networking programmatically  \
+#              available to users in realization of the definition   \
+#              of cloud computing.
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova API Server
+# Description: At the heart of the cloud framework is an API Server.
+#              This API Server makes command and control of the
+#              hypervisor, storage, and networking programmatically
+#              available to users in realization of the definition
+#              of cloud computing.
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=api
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-compute.init b/openstack-nova-compute.init
new file mode 100644
index 0000000..ca50bdf
--- /dev/null
+++ b/openstack-nova-compute.init
@@ -0,0 +1,118 @@
+#!/bin/sh
+#
+# openstack-nova-compute  OpenStack Nova Compute Worker
+#
+# chkconfig:   - 20 80
+# description: Compute workers manage computing instances on host  \
+#               machines. Through the API, commands are dispatched \
+#               to compute workers to:                             \
+#               * Run instances                                    \
+#               * Terminate instances                              \
+#               * Reboot instances                                 \
+#               * Attach volumes                                   \
+#               * Detach volumes                                   \
+#               * Get console output
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Compute Worker
+# Description: Compute workers manage computing instances on host
+#               machines. Through the API, commands are dispatched
+#               to compute workers to:
+#               * Run instances
+#               * Terminate instances
+#               * Reboot instances
+#               * Attach volumes
+#               * Detach volumes
+#               * Get console output
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=compute
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-direct-api.init b/openstack-nova-direct-api.init
new file mode 100644
index 0000000..4a52506
--- /dev/null
+++ b/openstack-nova-direct-api.init
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# openstack-nova-api  OpenStack Nova Direct API Server
+#
+# chkconfig:   - 20 80
+# description: At the heart of the cloud framework is an API Server. \
+#              This API Server makes command and control of the      \
+#              hypervisor, storage, and networking programmatically  \
+#              available to users in realization of the definition   \
+#              of cloud computing.
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Direct API Server
+# Description: At the heart of the cloud framework is an API Server.
+#              This API Server makes command and control of the
+#              hypervisor, storage, and networking programmatically
+#              available to users in realization of the definition
+#              of cloud computing.
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=direct-api
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-network.init b/openstack-nova-network.init
new file mode 100644
index 0000000..e7c6ca5
--- /dev/null
+++ b/openstack-nova-network.init
@@ -0,0 +1,116 @@
+#!/bin/sh
+#
+# openstack-nova-network  OpenStack Nova Network Controller
+#
+# chkconfig:   - 20 80
+# description: The Network Controller manages the networking resources \
+#              on host machines. The API server dispatches commands    \
+#              through the message queue, which are subsequently       \
+#              processed by Network Controllers.                       \
+#              Specific operations include:                            \
+#              * Allocate Fixed IP Addresses                           \
+#              * Configuring VLANs for projects                        \
+#              * Configuring networks for compute nodes                \
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Network Controller
+# Description: The Network Controller manages the networking resources
+#              on host machines. The API server dispatches commands
+#              through the message queue, which are subsequently
+#              processed by Network Controllers.
+#              Specific operations include:
+#              * Allocate Fixed IP Addresses
+#              * Configuring VLANs for projects
+#              * Configuring networks for compute nodes
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=network
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-objectstore.init b/openstack-nova-objectstore.init
new file mode 100644
index 0000000..57c30d9
--- /dev/null
+++ b/openstack-nova-objectstore.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-nova-objectstore  OpenStack Nova Object Storage
+#
+# chkconfig:   - 20 80
+# description: Implementation of an S3-like storage server based on local files.
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Object Storage
+# Description: Implementation of an S3-like storage server based on local files.
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=objectstore
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-scheduler.init b/openstack-nova-scheduler.init
new file mode 100644
index 0000000..95a943d
--- /dev/null
+++ b/openstack-nova-scheduler.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-nova-scheduler  OpenStack Nova Scheduler
+#
+# chkconfig:   - 20 80
+# description: Determines which physical hardware to allocate to a virtual resource
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Scheduler
+# Description: Determines which physical hardware to allocate to a virtual resource
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=scheduler
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-vncproxy.init b/openstack-nova-vncproxy.init
new file mode 100644
index 0000000..8421a81
--- /dev/null
+++ b/openstack-nova-vncproxy.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-nova-vncproxy  OpenStack Nova Console VNC Proxy
+#
+# chkconfig:   - 20 80
+# description: OpenStack Nova Console VNC Proxy Server
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Console VNC Proxy
+# Description: OpenStack Nova Console VNC Proxy Server
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=vncproxy
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-volume.init b/openstack-nova-volume.init
new file mode 100644
index 0000000..9b397e2
--- /dev/null
+++ b/openstack-nova-volume.init
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# openstack-nova-volume  OpenStack Nova Volume Worker
+#
+# chkconfig:   - 20 80
+# description:	Volume Workers interact with iSCSI storage to manage    \
+#		LVM-based instance volumes. Specific functions include: \
+#		* Create Volumes                                        \
+#		* Delete Volumes                                        \
+#		* Establish Compute volumes
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Volume Worker
+# Description:	Volume Workers interact with iSCSI storage to manage
+#		LVM-based instance volumes. Specific functions include:
+#		* Create Volumes
+#		* Delete Volumes
+#		* Establish Compute volumes
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=volume
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova.spec b/openstack-nova.spec
new file mode 100644
index 0000000..4abc6de
--- /dev/null
+++ b/openstack-nova.spec
@@ -0,0 +1,376 @@
+%global with_doc %{!?_without_doc:1}%{?_without_doc:0}
+
+%global milestone d4
+
+Name:             openstack-nova
+Version:          2011.3
+Release:          0.4.%{milestone}%{?dist}
+Summary:          OpenStack Compute (nova)
+
+Group:            Applications/System
+License:          ASL 2.0
+URL:              http://openstack.org/projects/compute/
+Source0:          http://launchpad.net/nova/diablo/diablo-4/+download/nova-%{version}~%{milestone}.tar.gz
+Source1:          nova.conf
+Source6:          nova.logrotate
+
+Source11:         openstack-nova-api.init
+Source12:         openstack-nova-compute.init
+Source13:         openstack-nova-network.init
+Source14:         openstack-nova-objectstore.init
+Source15:         openstack-nova-scheduler.init
+Source16:         openstack-nova-volume.init
+Source17:         openstack-nova-direct-api.init
+Source18:         openstack-nova-ajax-console-proxy.init
+Source19:         openstack-nova-vncproxy.init
+
+Source20:         nova-sudoers
+Source21:         nova-polkit.pkla
+Source22:         nova-ifc-template
+
+Patch1:           nova-fix-flavorid-migration-failure.patch
+Patch2:           nova-fix-quotas-migration-failure.patch
+Patch3:           nova-do-not-require-bridge_interface-for-flatdhcpmanager.patch
+
+BuildArch:        noarch
+BuildRequires:    intltool
+BuildRequires:    python-setuptools
+BuildRequires:    python-distutils-extra >= 2.18
+BuildRequires:    python-netaddr
+BuildRequires:    python-lockfile
+
+Requires:         python-nova = %{version}-%{release}
+Requires:         openstack-glance
+
+Requires:         python-paste
+Requires:         python-paste-deploy
+
+Requires:         libvirt-python
+Requires:         libvirt >= 0.8.2
+Requires:         libxml2-python
+Requires:         python-cheetah
+Requires:         MySQL-python
+
+Requires:         euca2ools
+Requires:         openssl
+Requires:         rabbitmq-server
+Requires:         sudo
+
+Requires(post):   chkconfig
+Requires(postun): initscripts
+Requires(preun):  chkconfig
+Requires(pre):    shadow-utils qemu-kvm
+
+%description
+OpenStack Compute (codename Nova) is open source software designed to
+provision and manage large networks of virtual machines, creating a
+redundant and scalable cloud computing platform. It gives you the
+software, control panels, and APIs required to orchestrate a cloud,
+including running instances, managing networks, and controlling access
+through users and projects. OpenStack Compute strives to be both
+hardware and hypervisor agnostic, currently supporting a variety of
+standard hardware configurations and seven major hypervisors.
+
+%package -n       python-nova
+Summary:          Nova Python libraries
+Group:            Applications/System
+
+Requires:         vconfig
+Requires:         PyXML
+Requires:         curl
+Requires:         m2crypto
+Requires:         libvirt-python
+Requires:         python-anyjson
+Requires:         python-IPy
+Requires:         python-boto
+Requires:         python-carrot
+Requires:         python-daemon
+Requires:         python-eventlet
+Requires:         python-greenlet
+Requires:         python-gflags
+Requires:         python-lockfile
+Requires:         python-lxml
+Requires:         python-mox
+Requires:         python-redis
+Requires:         python-routes
+Requires:         python-sqlalchemy
+Requires:         python-tornado
+Requires:         python-twisted-core
+Requires:         python-twisted-web
+Requires:         python-webob
+Requires:         python-netaddr
+Requires:         python-glance
+Requires:         python-novaclient
+Requires:         python-paste-deploy
+Requires:         python-migrate
+Requires:         python-ldap
+Requires:         radvd
+Requires:         iptables iptables-ipv6
+Requires:         iscsi-initiator-utils
+Requires:         scsi-target-utils
+Requires:         lvm2
+Requires:         socat
+Requires:         coreutils
+Requires:         python-libguestfs
+
+%description -n   python-nova
+OpenStack Compute (codename Nova) is open source software designed to
+provision and manage large networks of virtual machines, creating a
+redundant and scalable cloud computing platform.
+
+This package contains the nova Python library.
+
+%if 0%{?with_doc}
+%package doc
+Summary:          Documentation for OpenStack Compute
+Group:            Documentation
+
+Requires:         %{name} = %{version}-%{release}
+
+BuildRequires:    python-sphinx
+BuildRequires:    graphviz
+
+BuildRequires:    python-nose
+# Required to build module documents
+BuildRequires:    python-IPy
+BuildRequires:    python-boto
+BuildRequires:    python-eventlet
+BuildRequires:    python-gflags
+BuildRequires:    python-routes
+BuildRequires:    python-sqlalchemy
+BuildRequires:    python-tornado
+BuildRequires:    python-twisted-core
+BuildRequires:    python-twisted-web
+BuildRequires:    python-webob
+# while not strictly required, quiets the build down when building docs.
+BuildRequires:    python-carrot, python-mox, python-suds, m2crypto, bpython, python-memcached, python-migrate
+
+%description      doc
+OpenStack Compute (codename Nova) is open source software designed to
+provision and manage large networks of virtual machines, creating a
+redundant and scalable cloud computing platform.
+
+This package contains documentation files for nova.
+%endif
+
+%prep
+%setup -q -n nova-%{version}
+
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+find . \( -name .gitignore -o -name .placeholder \) -delete
+
+find nova -name \*.py -exec sed -i '/\/usr\/bin\/env python/d' {} \;
+
+%build
+%{__python} setup.py build
+
+%install
+%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+
+# docs generation requires everything to be installed first
+%if 0%{?with_doc}
+export PYTHONPATH="$( pwd ):$PYTHONPATH"
+pushd doc
+# Manually auto-generate to work around sphinx-build segfault
+./generate_autodoc_index.sh
+SPHINX_DEBUG=1 sphinx-build -b html source build/html
+popd
+# Fix hidden-file-or-dir warnings
+rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo
+%endif
+
+# Give stack, instance-usage-audit and clear_rabbit_queues a reasonable prefix
+mv %{buildroot}%{_bindir}/stack %{buildroot}%{_bindir}/nova-stack
+mv %{buildroot}%{_bindir}/instance-usage-audit %{buildroot}%{_bindir}/nova-instance-usage-audit
+mv %{buildroot}%{_bindir}/clear_rabbit_queues %{buildroot}%{_bindir}/nova-clear-rabbit-queues
+
+# Setup directories
+install -d -m 755 %{buildroot}%{_sharedstatedir}/nova
+install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/buckets
+install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/images
+install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/instances
+install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/keys
+install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/networks
+install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/tmp
+install -d -m 755 %{buildroot}%{_localstatedir}/log/nova
+
+# Setup ghost sqlite DB
+touch %{buildroot}%{_sharedstatedir}/nova/nova.sqlite
+
+# Setup ghost CA cert
+install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/CA
+install -p -m 755 nova/CA/*.sh %{buildroot}%{_sharedstatedir}/nova/CA
+install -p -m 644 nova/CA/openssl.cnf.tmpl %{buildroot}%{_sharedstatedir}/nova/CA
+install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/CA/{certs,crl,newcerts,projects,reqs}
+touch %{buildroot}%{_sharedstatedir}/nova/CA/{cacert.pem,crl.pem,index.txt,openssl.cnf,serial}
+install -d -m 750 %{buildroot}%{_sharedstatedir}/nova/CA/private
+touch %{buildroot}%{_sharedstatedir}/nova/CA/private/cakey.pem
+
+# Install config file
+install -d -m 755 %{buildroot}%{_sysconfdir}/nova
+install -p -D -m 640 %{SOURCE1} %{buildroot}%{_sysconfdir}/nova/nova.conf
+
+# Install initscripts for Nova services
+install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/openstack-nova-api
+install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/openstack-nova-compute
+install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/openstack-nova-network
+install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/openstack-nova-objectstore
+install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/openstack-nova-scheduler
+install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/openstack-nova-volume
+install -p -D -m 755 %{SOURCE17} %{buildroot}%{_initrddir}/openstack-nova-direct-api
+install -p -D -m 755 %{SOURCE18} %{buildroot}%{_initrddir}/openstack-nova-ajax-console-proxy
+install -p -D -m 755 %{SOURCE19} %{buildroot}%{_initrddir}/openstack-nova-vncproxy
+
+# Install sudoers
+install -p -D -m 440 %{SOURCE20} %{buildroot}%{_sysconfdir}/sudoers.d/nova
+
+# Install logrotate
+install -p -D -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-nova
+
+# Install pid directory
+install -d -m 755 %{buildroot}%{_localstatedir}/run/nova
+
+# Install template files
+install -p -D -m 644 nova/auth/novarc.template %{buildroot}%{_datarootdir}/nova/novarc.template
+install -p -D -m 644 nova/cloudpipe/client.ovpn.template %{buildroot}%{_datarootdir}/nova/client.ovpn.template
+install -p -D -m 644 nova/virt/libvirt.xml.template %{buildroot}%{_datarootdir}/nova/libvirt.xml.template
+install -p -D -m 644 nova/virt/interfaces.template %{buildroot}%{_datarootdir}/nova/interfaces.template
+install -p -D -m 644 %{SOURCE22} %{buildroot}%{_datarootdir}/nova/interfaces.template
+
+install -d -m 755 %{buildroot}%{_sysconfdir}/polkit-1/localauthority/50-local.d
+install -p -D -m 644 %{SOURCE21} %{buildroot}%{_sysconfdir}/polkit-1/localauthority/50-local.d/50-nova.pkla
+
+# Remove ajaxterm and various other tools
+rm -fr %{buildroot}%{_datarootdir}/nova/{ajaxterm,euca-get-ajax-console,install_venv.py,nova-debug,pip-requires,clean-vlans,with_venv.sh,esx}
+
+# Remove unneeded in production stuff
+rm -fr %{buildroot}%{python_sitelib}/run_tests.*
+rm -f %{buildroot}%{_bindir}/nova-combined
+rm -f %{buildroot}/usr/share/doc/nova/README*
+
+%pre
+getent group nova >/dev/null || groupadd -r nova --gid 162
+getent passwd nova >/dev/null || \
+useradd --uid 162 -r -g nova -G nova,nobody,qemu -d %{_sharedstatedir}/nova -s /sbin/nologin \
+-c "OpenStack Nova Daemons" nova
+exit 0
+
+%post
+# Initialize the DB
+if [ ! -f %{_sharedstatedir}/nova/nova.sqlite ]; then
+    runuser -l -s /bin/bash -c 'nova-manage --flagfile=/dev/null --logdir=%{_localstatedir}/log/nova --state_path=%{_sharedstatedir}/nova db sync' nova
+    chmod 600 %{_sharedstatedir}/nova/nova.sqlite
+fi
+
+# Register the services
+for svc in api compute network objectstore scheduler volume direct-api ajax-console-proxy vncproxy; do
+    /sbin/chkconfig --add openstack-nova-${svc}
+done
+
+%preun
+if [ $1 -eq 0 ] ; then
+    for svc in api compute network objectstore scheduler volume direct-api ajax-console-proxy vncproxy; do
+        /sbin/service openstack-nova-${svc} stop >/dev/null 2>&1
+        /sbin/chkconfig --del openstack-nova-${svc}
+    done
+fi
+
+%postun
+if [ "$1" -ge 1 ] ; then
+    for svc in api compute network objectstore scheduler volume direct-api ajax-console-proxy vncproxy; do
+        /sbin/service openstack-nova-${svc} condrestart > /dev/null 2>&1 || :
+    done
+fi
+
+%files
+%doc LICENSE
+%dir %{_sysconfdir}/nova
+%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/nova.conf
+%config(noreplace) %{_sysconfdir}/nova/api-paste.ini
+%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-nova
+%config(noreplace) %{_sysconfdir}/sudoers.d/nova
+%config(noreplace) %{_sysconfdir}/polkit-1/localauthority/50-local.d/50-nova.pkla
+
+%dir %attr(0755, nova, root) %{_localstatedir}/log/nova
+%dir %attr(0755, nova, root) %{_localstatedir}/run/nova
+
+%{_bindir}/nova-*
+%{_initrddir}/openstack-nova-*
+%{_datarootdir}/nova
+
+%defattr(-, nova, nova, -)
+%dir %{_sharedstatedir}/nova
+%dir %{_sharedstatedir}/nova/buckets
+%dir %{_sharedstatedir}/nova/images
+%dir %{_sharedstatedir}/nova/instances
+%dir %{_sharedstatedir}/nova/keys
+%dir %{_sharedstatedir}/nova/networks
+%dir %{_sharedstatedir}/nova/tmp
+%ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_sharedstatedir}/nova/nova.sqlite
+
+%dir %{_sharedstatedir}/nova/CA/
+%dir %{_sharedstatedir}/nova/CA/certs
+%dir %{_sharedstatedir}/nova/CA/crl
+%dir %{_sharedstatedir}/nova/CA/newcerts
+%dir %{_sharedstatedir}/nova/CA/projects
+%dir %{_sharedstatedir}/nova/CA/reqs
+%{_sharedstatedir}/nova/CA/*.sh
+%{_sharedstatedir}/nova/CA/openssl.cnf.tmpl
+%ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_sharedstatedir}/nova/CA/cacert.pem
+%ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_sharedstatedir}/nova/CA/crl.pem
+%ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_sharedstatedir}/nova/CA/index.txt
+%ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_sharedstatedir}/nova/CA/openssl.cnf
+%ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_sharedstatedir}/nova/CA/serial
+%dir %attr(0750, -, -) %{_sharedstatedir}/nova/CA/private
+%ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_sharedstatedir}/nova/CA/private/cakey.pem
+
+%files -n python-nova
+%defattr(-,root,root,-)
+%doc LICENSE
+%{python_sitelib}/nova
+%{python_sitelib}/nova-%{version}-*.egg-info
+
+%if 0%{?with_doc}
+%files doc
+%doc LICENSE doc/build/html
+%endif
+
+%changelog
+* Mon Aug 29 2011 Mark McLoughlin <markmc at redhat.com> - 2011.3-0.4.d4
+- Don't generate root CA during %post (#707199)
+- The nobody group shouldn't own files in /var/lib/nova
+- Add workaround for sphinx-build segfault
+
+* Fri Aug 26 2011 Mark McLoughlin <markmc at redhat.com> - 2011.3-0.3.d4
+- Update to diablo-4 milestone
+- Use statically assigned uid:gid 162:162 (#732442)
+- Collapse all sub-packages into openstack-nova; w/o upgrade path
+- Reduce use of macros
+- Rename stack to nova-stack
+- Fix openssl.cnf.tmpl script-without-shebang rpmlint warning
+- Really remove ajaxterm
+- Mark polkit file as %config
+
+* Mon Aug 22 2011 Mark McLoughlin <markmc at redhat.com> - 2011.3-0.2.1449bzr
+- Remove dependency on python-novaclient
+
+* Wed Aug 17 2011 Mark McLoughlin <markmc at redhat.com> - 2011.3-0.1.1449bzr
+- Update to latest upstream.
+- nova-import-canonical-imagestore has been removed
+- nova-clear-rabbit-queues was added
+
+* Tue Aug  9 2011 Mark McLoughlin <markmc at redhat.com> - 2011.3-0.2.1409bzr
+- Update to newer upstream
+- nova-instancemonitor has been removed
+- nova-instance-usage-audit added
+
+* Tue Aug  9 2011 Mark McLoughlin <markmc at redhat.com> - 2011.3-0.1.bzr1130
+- More cleanups
+- Change release tag to reflect pre-release status
+
+* Wed Jun 29 2011 Matt Domsch <mdomsch at fedoraproject.org> - 2011.3-1087.1
+- Initial package from Alexander Sakhnov <asakhnov at mirantis.com>
+  with cleanups by Matt Domsch
diff --git a/sources b/sources
index e69de29..7d2aa28 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+2692151988dbb76d1d54f3d63152e0ba  nova-2011.3~d4.tar.gz


More information about the scm-commits mailing list