From 7f33191f3e2faf405b8ba37e6c5071031495aad3 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Mon, 28 Jan 2013 16:48:35 +0800 Subject: [PATCH] Updates for packaging Grizzly-2 (cherry picked from commit f3139817265aa0684018e404a87373d8163a64a6) --- debian/README.Debian | 10 ++++++++++ debian/cinder-api.logrotate | 3 +++ debian/cinder-common.postinst.in | 1 + debian/cinder-scheduler.logrotate | 3 +++ debian/cinder-volume.dirs | 1 + debian/cinder-volume.install | 1 + debian/cinder-volume.logrotate | 3 +++ debian/cinder-volume.postinst.in | 21 +++++++++++++++++++++ debian/cinder.conf | 1 + debian/cinder_sudoers | 3 +++ debian/cinder_tgt.conf | 1 + debian/clean | 1 + debian/control | 8 ++++++-- debian/pydist-overrides | 1 + debian/rules | 5 +++-- 15 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 debian/README.Debian create mode 100644 debian/cinder-volume.dirs create mode 100644 debian/cinder-volume.postinst.in create mode 100644 debian/cinder_sudoers create mode 100644 debian/cinder_tgt.conf create mode 100644 debian/clean create mode 100644 debian/pydist-overrides diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 000000000..0a7d689f3 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,10 @@ +Migration from nova-volumes to cinder-volumes: + +1. upgrade your nova install to folsom +2. upgrade your nova database using nova-manage db sync +3. install the folsom version of cinder +4. create a cinder database using cinder-manage db sync +5. copy data from nova database using cinder-manage migrate import_db --src=$NOVA_SQL_CONN --dest=$CINDER_SQL_CONN +6. disable the nova-volume-api in enabled apis in /etc/nova/nova.conf sed -i "s/osapi_volume,// /etc/nova/nova.conf" +7. restart nova-api +8. start cinder-api diff --git a/debian/cinder-api.logrotate b/debian/cinder-api.logrotate index 6df00bf82..9b966d77b 100644 --- a/debian/cinder-api.logrotate +++ b/debian/cinder-api.logrotate @@ -1,4 +1,7 @@ /var/log/cinder/cinder-api.log { daily missingok + compress + delaycompress + notifempty } diff --git a/debian/cinder-common.postinst.in b/debian/cinder-common.postinst.in index 4be0710fb..0f6484cb0 100644 --- a/debian/cinder-common.postinst.in +++ b/debian/cinder-common.postinst.in @@ -14,6 +14,7 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then pkgos_var_user_group cinder pkgos_write_new_conf cinder cinder.conf pkgos_write_new_conf cinder api-paste.ini + chown root:root /etc/cinder/rootwrap.d/volume.filters pkgos_dbc_postinst ${CINDER_CONF} cinder DEFAULT sql_connection $@ pkgos_write_admin_creds ${CINDER_API} cinder filter:authtoken db_get cinder/volume_group diff --git a/debian/cinder-scheduler.logrotate b/debian/cinder-scheduler.logrotate index 0d3a307d5..15602c3b6 100644 --- a/debian/cinder-scheduler.logrotate +++ b/debian/cinder-scheduler.logrotate @@ -1,4 +1,7 @@ /var/log/cinder/cinder-scheduler.log { daily missingok + compress + delaycompress + notifempty } diff --git a/debian/cinder-volume.dirs b/debian/cinder-volume.dirs new file mode 100644 index 000000000..769913906 --- /dev/null +++ b/debian/cinder-volume.dirs @@ -0,0 +1 @@ +var/lib/cinder/volumes diff --git a/debian/cinder-volume.install b/debian/cinder-volume.install index 188598f81..267af421f 100644 --- a/debian/cinder-volume.install +++ b/debian/cinder-volume.install @@ -1 +1,2 @@ usr/bin/cinder-volume +debian/cinder_tgt.conf etc/tgt/conf.d diff --git a/debian/cinder-volume.logrotate b/debian/cinder-volume.logrotate index b51433129..f3bb6b473 100644 --- a/debian/cinder-volume.logrotate +++ b/debian/cinder-volume.logrotate @@ -1,4 +1,7 @@ /var/log/cinder/cinder-volume.log { daily missingok + compress + delaycompress + notifempty } diff --git a/debian/cinder-volume.postinst.in b/debian/cinder-volume.postinst.in new file mode 100644 index 000000000..42484208c --- /dev/null +++ b/debian/cinder-volume.postinst.in @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +#PKGOS-INCLUDE# + +if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then + pkgos_var_user_group cinder + chmod 0750 /var/lib/cinder/volumes + chown root:root /etc/cinder/rootwrap.d/volume.filters + + if which invoke-rc.d >/dev/null 2>&1; then + invoke-rc.d tgtd restart > /dev/null 2>&1 || true + else + /etc/init.d/tgtd restart > /dev/null 2>&1 || true + fi +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/cinder.conf b/debian/cinder.conf index 82604abe3..a116a7e20 100644 --- a/debian/cinder.conf +++ b/debian/cinder.conf @@ -10,3 +10,4 @@ auth_strategy = keystone logdir = /var/log/cinder state_path=/var/lib/cinder lock_path=/var/lock/cinder +volumes_dir = /var/lib/cinder/volumes diff --git a/debian/cinder_sudoers b/debian/cinder_sudoers new file mode 100644 index 000000000..73142ab4e --- /dev/null +++ b/debian/cinder_sudoers @@ -0,0 +1,3 @@ +Defaults:cinder !requiretty + +cinder ALL = (root) NOPASSWD: /usr/bin/cinder-rootwrap diff --git a/debian/cinder_tgt.conf b/debian/cinder_tgt.conf new file mode 100644 index 000000000..444eb00e4 --- /dev/null +++ b/debian/cinder_tgt.conf @@ -0,0 +1 @@ +include /var/lib/cinder/volumes/* diff --git a/debian/clean b/debian/clean new file mode 100644 index 000000000..e932b028c --- /dev/null +++ b/debian/clean @@ -0,0 +1 @@ +setup.cfg diff --git a/debian/control b/debian/control index a7169e398..5a4300052 100644 --- a/debian/control +++ b/debian/control @@ -22,6 +22,7 @@ Build-Depends-Indep: pep8, python-glanceclient, python-greenlet, python-iso8601, + python-keystoneclient, python-kombu, python-lockfile, python-lxml, @@ -38,6 +39,7 @@ Build-Depends-Indep: pep8, python-setuptools-git, python-sphinx, python-sqlalchemy, + python-stevedore (>= 0.7), python-suds, python-webob, Standards-Version: 3.9.3 @@ -55,7 +57,6 @@ Depends: ${python:Depends}, python-cheetah, python-daemon, python-eventlet, - python-glance, python-glanceclient, python-greenlet, python-iso8601, @@ -67,6 +68,8 @@ Depends: ${python:Depends}, python-paramiko, python-paste, python-pastedeploy, + python-migrate, + python-netaddr, python-routes, python-suds, python-sqlalchemy, @@ -112,7 +115,8 @@ Description: Openstack block storage as a service - API server Package: cinder-volume Architecture: all Pre-Depends: dpkg (>= 1.15.6~) -Depends: ${ostack-lsb-base}, cinder-common (= ${binary:Version}), ${python:Depends}, ${misc:Depends} +Depends: ${ostack-lsb-base}, cinder-common (= ${binary:Version}), ${python:Depends}, ${misc:Depends}, + lvm2, tgt Description: Openstack block storage as a service - Volume server Cinder is a block storage as service system for the Openstack cloud computing software suite. It is a direct replacement for nova-volume as a separate diff --git a/debian/pydist-overrides b/debian/pydist-overrides new file mode 100644 index 000000000..98f65931c --- /dev/null +++ b/debian/pydist-overrides @@ -0,0 +1 @@ +babel diff --git a/debian/rules b/debian/rules index 5b24d6dab..88f9bedae 100755 --- a/debian/rules +++ b/debian/rules @@ -12,14 +12,14 @@ endif override_dh_clean: dh_clean - rm -f debian/cinder-common.config debian/cinder-common.postinst debian/cinder-api.config debian/cinder-api.postinst + rm -f debian/cinder-common.config debian/cinder-common.postinst debian/cinder-api.config debian/cinder-api.postinst debian/cinder-volume.postinst override_dh_install: dh_install install -D -m 0440 debian/cinder-common.sudoers $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common override_dh_fixperms: - dh_fixperms + dh_fixperms -Xcinder_tgt.conf chmod 0440 $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common override_dh_auto_build: @@ -29,3 +29,4 @@ override_dh_auto_build: /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-common.postinst /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-api.config /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-api.postinst + /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-volume.postinst