diff options
Diffstat (limited to 'meta-openstack')
5 files changed, 51 insertions, 4 deletions
diff --git a/meta-openstack/README.setup b/meta-openstack/README.setup index ab0c2613..8ad892ec 100644 --- a/meta-openstack/README.setup +++ b/meta-openstack/README.setup @@ -152,6 +152,24 @@ following steps will validate a simple compute node guest launch: % neutron net-create mynetwork % nova boot --image myFirstImage --flavor 1 myinstance +* Cinder Multi-backend * + +Cinder currently is configured to support multi-backend: lvm-iscsi and nfs backends. +When a Cinder volume is created, it's needed to be specified which backend its belong +to through "--volume_type" option passed in "cinder create" command. + +The Cinder volume types for lvm-iscsi and nfs can be created as following steps: + + % . /etc/nova/openrc + % cinder type-create lvm_iscsi + % cinder type-key lvm_iscsi set volume_backend_name=LVM_iSCSI + % cinder type-create nfs + % cinder type-key nfs set volume_backend_name=Generic_NFS + +For example, to create 1G Cinder volume in lvm-iscsi backend: + + % cinder create --volume_type lvm_iscsi --display_name=lvm_vol 1 + !! Hint !! When using a multi-node setup it is recommended that each host have a different diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf b/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf index d922e037..aa0eba54 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf +++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf @@ -1173,14 +1173,20 @@ rabbit_port=5672 # Define the names of the groups for multiple volume backends #enabled_backends=fakedriver,lvmdriver +enabled_backends=lvmdriver,nfsdriver # Define the groups as above -#[lvmdriver] -#volume_group=lvm-group-1 -#volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver -#volume_backend_name=LVM_iSCSI_unique1 #[fakedriver] #volume_driver=cinder.volume.driver.FakeISCSIDriver +[lvmdriver] +volume_group=cinder-volumes +volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver +volume_backend_name=LVM_iSCSI + +[nfsdriver] +volume_group=nfs-group-1 +volume_driver=cinder.volume.drivers.nfs.NfsDriver +volume_backend_name=Generic_NFS # Total option count: 255 diff --git a/meta-openstack/recipes-devtools/python/python-cinder/nfs_setup.sh b/meta-openstack/recipes-devtools/python/python-cinder/nfs_setup.sh new file mode 100644 index 00000000..1d7c475e --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-cinder/nfs_setup.sh @@ -0,0 +1,7 @@ +#! /bin/bash + +# Default setup +if [ "$1" == "1" ]; then + mkdir /etc/cinder/nfs_volumes + echo "/etc/cinder/nfs_volumes *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)" >> /etc/exports +fi diff --git a/meta-openstack/recipes-devtools/python/python-cinder_git.bb b/meta-openstack/recipes-devtools/python/python-cinder_git.bb index c1ca58cf..e9cc27d8 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder_git.bb +++ b/meta-openstack/recipes-devtools/python/python-cinder_git.bb @@ -12,6 +12,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ file://cinder.init \ file://cinder-volume \ file://0001-run_tests-respect-tools-dir.patch \ + file://nfs_setup.sh \ " SRCREV="8b5fb8409322f61d8b610c97c109a61bf48a940e" @@ -38,6 +39,9 @@ do_install_append() { install -m 600 ${WORKDIR}/api-paste.ini ${CINDER_CONF_DIR}/ install -m 600 ${S}/etc/cinder/policy.json ${CINDER_CONF_DIR}/ + install -d ${CINDER_CONF_DIR}/drivers + install -m 600 ${WORKDIR}/nfs_setup.sh ${CINDER_CONF_DIR}/drivers/ + install -d ${D}${localstatedir}/log/${SRCNAME} if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then @@ -55,6 +59,8 @@ do_install_append() { } CINDER_LVM_VOLUME_BACKING_FILE_SIZE ?= "2G" +CINDER_NFS_VOLUME_SERVERS_DEFAULT = "controller:/etc/cinder/nfs_volumes" +CINDER_NFS_VOLUME_SERVERS ?= "${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" pkg_postinst_${SRCNAME}-setup () { if [ "x$D" != "x" ]; then @@ -73,6 +79,14 @@ pkg_postinst_${SRCNAME}-setup () { #Create cinder volume group backing file [[ -f /etc/cinder/volumes-backing ]] || truncate -s ${CINDER_LVM_VOLUME_BACKING_FILE_SIZE} /etc/cinder/volumes-backing echo "include /etc/cinder/data/volumes/*" >> /etc/tgt/targets.conf + + # Create Cinder nfs_share config file with default nfs server + if [ ! -f /etc/cinder/nfs_shares ]; then + echo "${CINDER_NFS_VOLUME_SERVERS}" > /etc/cinder/nfs_shares + sed 's/\s\+/\n/g' -i /etc/cinder/nfs_shares + [[ "x${CINDER_NFS_VOLUME_SERVERS}" == "x${CINDER_NFS_VOLUME_SERVERS_DEFAULT}" ]] && is_default="1" || is_default="0" + /bin/bash /etc/cinder/drivers/nfs_setup.sh ${is_default} + fi } PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler" @@ -95,6 +109,7 @@ FILES_${SRCNAME}-scheduler = "${bindir}/cinder-scheduler \ FILES_${SRCNAME} = "${bindir}/* \ ${sysconfdir}/${SRCNAME}/* \ ${localstatedir}/* \ + ${sysconfdir}/${SRCNAME}/drivers/* \ " DEPENDS += " \ diff --git a/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-compute.bb b/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-compute.bb index b7be27f6..3787c3b7 100644 --- a/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-compute.bb +++ b/meta-openstack/recipes-extended/packagegroups/packagegroup-cloud-compute.bb @@ -21,6 +21,7 @@ RDEPENDS_${PN} = " \ openvswitch-switch \ ${@base_contains('CINDER_EXTRA_FEATURES', 'open-iscsi-user', 'open-iscsi-user', '', d)} \ ${@base_contains('CINDER_EXTRA_FEATURES', 'iscsi-initiator-utils', 'iscsi-initiator-utils', '', d)} \ + nfs-utils-client \ " RRECOMMENDS_${PN} = " \ |