Merge "Support both Ely and Dundee in MOS9"
This commit is contained in:
commit
02eec2cfef
12
Makefile
12
Makefile
|
@ -22,12 +22,13 @@ md5: output/${MD5_FILENAME}
|
|||
|
||||
docs: md5 $(DOC_NAMES:%=output/${PLUGIN_NAME}-${PLUGIN_VERSION}-%.pdf)
|
||||
|
||||
iso: suppack/xenapi-plugins-${OPENSTACK_RELEASE}.iso
|
||||
REQUIRED_ISOS=$(PLATFORMS:%=suppack/xcp_%/xenapi-plugins-${OPENSTACK_RELEASE}.iso)
|
||||
iso: $(REQUIRED_ISOS)
|
||||
|
||||
suppack/xenapi-plugins-${OPENSTACK_RELEASE}.iso: plugin_source/deployment_scripts/patchset/xenhost
|
||||
$(REQUIRED_ISOS): plugin_source/deployment_scripts/patchset/xenhost
|
||||
suppack/build-xenserver-suppack.sh ${OPENSTACK_RELEASE} ${HYPERVISOR_NAME}
|
||||
|
||||
${BUILDROOT}/${PLUGIN_NAME}/branded: ${BRANDING} suppack/xenapi-plugins-${OPENSTACK_RELEASE}.iso plugin_source
|
||||
${BUILDROOT}/${PLUGIN_NAME}/branded: ${BRANDING} ${REQUIRED_ISOS} plugin_source
|
||||
mkdir -p ${BUILDROOT}/${PLUGIN_NAME}
|
||||
cp -r plugin_source/* ${BUILDROOT}/${PLUGIN_NAME}
|
||||
find ${BUILDROOT}/${PLUGIN_NAME} -type f -print0 | \
|
||||
|
@ -38,8 +39,7 @@ ${BUILDROOT}/${PLUGIN_NAME}/branded: ${BRANDING} suppack/xenapi-plugins-${OPENST
|
|||
-e s/@PLUGIN_VERSION@/${PLUGIN_VERSION}/g \
|
||||
-e s/@PLUGIN_REVISION@/${PLUGIN_REVISION}/g \
|
||||
-e s/@VERSION_HOTFIXES@/${VERSION_HOTFIXES}/g {}
|
||||
cp suppack/xenapi-plugins-*.iso ${BUILDROOT}/${PLUGIN_NAME}/deployment_scripts/
|
||||
cp suppack/conntrack-tools.iso ${BUILDROOT}/${PLUGIN_NAME}/deployment_scripts/
|
||||
cp -r suppack/xcp_* ${BUILDROOT}/${PLUGIN_NAME}/deployment_scripts/
|
||||
touch ${BUILDROOT}/${PLUGIN_NAME}/branded
|
||||
|
||||
output/${RPM_NAME}: ${BUILDROOT}/${PLUGIN_NAME}/branded
|
||||
|
@ -75,4 +75,4 @@ output/${MD5_FILENAME}: output/${RPM_NAME}
|
|||
md5sum $^ > $@
|
||||
|
||||
clean:
|
||||
rm -rf ${BUILDROOT} output suppack/xenapi-plugins-${OPENSTACK_RELEASE}* suppack/conntrack-tools.* suppack/build
|
||||
rm -rf ${BUILDROOT} output suppack/xcp_* suppack/build
|
||||
|
|
|
@ -2,8 +2,8 @@ HYPERVISOR_NAME=XenServer
|
|||
HYPERVISOR_LOWER=xenserver
|
||||
PLUGIN_NAME=fuel-plugin-xenserver
|
||||
VERSION_HOTFIXES='{"6.5.0":["XS65ESP1013"]}'
|
||||
|
||||
PLUGIN_BRANCHES="9.0 8.0 7.0 6.1"
|
||||
PLATFORMS=1.9.0 2.1.0 2.2.0
|
||||
PLUGIN_BRANCHES=9.0 8.0 7.0 6.1
|
||||
PLUGIN_VERSION_6_1=1.0
|
||||
PLUGIN_VERSION_7_0=2.0
|
||||
PLUGIN_VERSION_8_0=3.1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
set -eu
|
||||
|
||||
# Source the branding file
|
||||
. ${1}
|
||||
source <(sed -e 's/\(.*\)=\(.*\)/\1="\2"/' ${1})
|
||||
|
||||
# Find shortest delta
|
||||
my_merge_base=$(git merge-base HEAD origin/master)
|
||||
|
|
|
@ -16,7 +16,6 @@ from utils import HIMN_IP
|
|||
INT_BRIDGE = 'br-int'
|
||||
XS_PLUGIN_ISO = 'xenapi-plugins-mitaka.iso'
|
||||
DIST_PACKAGES_DIR = '/usr/lib/python2.7/dist-packages/'
|
||||
CONNTRACK_ISO = 'conntrack-tools.iso'
|
||||
CONNTRACK_CONF_SAMPLE =\
|
||||
'/usr/share/doc/conntrack-tools-1.4.2/doc/stats/conntrackd.conf'
|
||||
|
||||
|
@ -131,10 +130,13 @@ def route_to_compute(endpoints, himn_xs, himn_local, username):
|
|||
'> /etc/udev/rules.d/90-reroute.rules'))
|
||||
|
||||
|
||||
def install_suppack(himn, username, package):
|
||||
def install_suppack(himn, username, package, xcp_version):
|
||||
"""Install xapi driver supplemental pack. """
|
||||
tmp = utils.ssh(himn, username, 'mktemp', '-d')
|
||||
utils.scp(himn, username, tmp, package)
|
||||
real_pack = "xcp_%s/%s" % (xcp_version, package)
|
||||
if not os.path.exists(real_pack):
|
||||
utils.reportError('Package folder %s not exist' % real_pack)
|
||||
utils.scp(himn, username, tmp, real_pack)
|
||||
utils.ssh(himn, username, 'xe-install-supplemental-pack',
|
||||
tmp + '/' + package, prompt='Y\n')
|
||||
utils.ssh(himn, username, 'rm', tmp, '-rf')
|
||||
|
@ -381,21 +383,14 @@ def check_and_setup_ceilometer(himn, username, password):
|
|||
restart_services('ceilometer-polling')
|
||||
|
||||
|
||||
def enable_conntrack_service(himn, username):
|
||||
xcp_ver = utils.ssh(himn, username,
|
||||
('xe host-param-get uuid=$(xe host-list --minimal) '
|
||||
'param-name=software-version '
|
||||
'param-key=platform_version'))
|
||||
if LooseVersion(xcp_ver) < LooseVersion('2.1.0'):
|
||||
def enable_conntrack_service(himn, username, xcp_version):
|
||||
if LooseVersion(xcp_version) < LooseVersion('2.1.0'):
|
||||
# Only support conntrack-tools since XS7.0(XCP2.1.0) and above
|
||||
LOG.info('No need to enable conntrack-tools with XCP %s' % xcp_ver)
|
||||
LOG.info('No need to enable conntrack-tools with XCP %s' % xcp_version)
|
||||
return
|
||||
|
||||
conn_installed = utils.ssh(himn, username,
|
||||
'find', '/usr/sbin', '-name', 'conntrackd')
|
||||
if not conn_installed:
|
||||
install_suppack(himn, username, CONNTRACK_ISO)
|
||||
# use conntrack statistic mode, so change conntrackd.conf
|
||||
# use conntrack statistic mode, so change conntrackd.conf
|
||||
if not os.path.exists('/etc/conntrackd/conntrackd.conf.back'):
|
||||
utils.ssh(himn, username,
|
||||
'mv',
|
||||
'/etc/conntrackd/conntrackd.conf',
|
||||
|
@ -413,6 +408,14 @@ def enable_conntrack_service(himn, username):
|
|||
utils.ssh(himn, username, 'service', 'conntrackd', 'restart')
|
||||
|
||||
|
||||
def get_xcp_version(himn, username):
|
||||
xcp_ver = utils.ssh(himn, username,
|
||||
('xe host-param-get uuid=$(xe host-list --minimal) '
|
||||
'param-name=software-version '
|
||||
'param-key=platform_version'))
|
||||
return xcp_ver
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
install_xenapi_sdk()
|
||||
astute = utils.get_astute()
|
||||
|
@ -429,8 +432,9 @@ if __name__ == '__main__':
|
|||
|
||||
if username and password and endpoints and himn_local:
|
||||
route_to_compute(endpoints, HIMN_IP, himn_local, username)
|
||||
xcp_version = get_xcp_version(HIMN_IP, username)
|
||||
if install_xapi:
|
||||
install_suppack(HIMN_IP, username, XS_PLUGIN_ISO)
|
||||
install_suppack(HIMN_IP, username, XS_PLUGIN_ISO, xcp_version)
|
||||
enable_linux_bridge(HIMN_IP, username)
|
||||
forward_from_himn(himn_eth)
|
||||
|
||||
|
@ -445,7 +449,7 @@ if __name__ == '__main__':
|
|||
install_logrotate_script(HIMN_IP, username)
|
||||
|
||||
# enable conntrackd service in Dom0
|
||||
enable_conntrack_service(HIMN_IP, username)
|
||||
enable_conntrack_service(HIMN_IP, username, xcp_version)
|
||||
|
||||
# neutron-l2-agent in compute node
|
||||
modify_neutron_rootwrap_conf(HIMN_IP, username, password)
|
||||
|
|
|
@ -4,21 +4,39 @@ set -eux
|
|||
|
||||
# =============================================
|
||||
# Usage of this script:
|
||||
# ./build-xenserver-suppack.sh xs-version xs-build git-branch plugin-version
|
||||
# or
|
||||
# ./build-xenserver-suppack.sh os-release hypervisor-name xs-plugin-version key
|
||||
# Or
|
||||
# ./build-xenserver-suppack.sh
|
||||
#
|
||||
# You can provide explict input parameters or you can use the default ones:
|
||||
# XenServer version
|
||||
# XenServer build
|
||||
# OpenStack release branch
|
||||
# OpenStack release
|
||||
# Hypervisor name
|
||||
# XenServer OpenStack plugin version
|
||||
# Key for building supplemental packages
|
||||
# Keyfile for building supplemental packages
|
||||
#
|
||||
# Prerequisite:
|
||||
# For Dundee:
|
||||
# No
|
||||
# For Ely:
|
||||
# 1. Secret key is imported to the VM which is use for building suppack
|
||||
# 2. Public keyfile is downloaded to this folder in the building VM
|
||||
# 3. Below packages should be installed in advance:
|
||||
# expect-5.45-14.el7_1.x86_64
|
||||
# libarchive-3.1.2-7.el7.x86_64
|
||||
# rpm-sign-4.11.3-17.el7.x86_64
|
||||
|
||||
|
||||
THIS_FILE=$(readlink -f $0)
|
||||
FUELPLUG_UTILS_ROOT=$(dirname $THIS_FILE)
|
||||
BUILDROOT=${FUELPLUG_UTILS_ROOT}/build
|
||||
rm -rf $BUILDROOT
|
||||
SUPPACK_CREEDENCE=${FUELPLUG_UTILS_ROOT}/xcp_1.9.0
|
||||
SUPPACK_DUNDEE=${FUELPLUG_UTILS_ROOT}/xcp_2.1.0
|
||||
SUPPACK_ELY=${FUELPLUG_UTILS_ROOT}/xcp_2.2.0
|
||||
rm -rf $BUILDROOT $SUPPACK_CREEDENCE $SUPPACK_DUNDEE $SUPPACK_ELY
|
||||
mkdir -p $SUPPACK_CREEDENCE
|
||||
mkdir -p $SUPPACK_DUNDEE
|
||||
mkdir -p $SUPPACK_ELY
|
||||
mkdir -p $BUILDROOT && cd $BUILDROOT
|
||||
|
||||
|
||||
|
@ -29,10 +47,15 @@ mkdir -p $BUILDROOT && cd $BUILDROOT
|
|||
OS_RELEASE=${1:-"mitaka"}
|
||||
|
||||
HYPERVISOR_NAME=${2:-"XenServer"}
|
||||
PLATFORM_VERSION=${3:-"1.9"}
|
||||
|
||||
# nova and neutron xenserver dom0 plugin version
|
||||
XS_PLUGIN_VERSION=${4:-"13.0.0"}
|
||||
XS_PLUGIN_VERSION=${3:-"13.0.0"}
|
||||
|
||||
# key of the public/secret OpenStack GPG key
|
||||
SUPPACK_KEY=${4:-"Citrix OpenStack (XenServer Updates) <openstack@citrix.com>"}
|
||||
|
||||
# keyfile
|
||||
SUPPACK_KEYFILE=${5:-"RPM-GPG-KEY-XS-OPENSTACK"}
|
||||
|
||||
# branch info
|
||||
GITBRANCH="stable/$OS_RELEASE"
|
||||
|
@ -46,7 +69,7 @@ RPM_BUILDER_REPO="https://github.com/citrix-openstack/xenserver-nova-suppack-bui
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# =============================================
|
||||
# Install suppack builder
|
||||
# Install suppack builder for Dundee (XCP 2.1.0)
|
||||
RPM_ROOT=http://coltrane.uk.xensource.com/usr/groups/release/XenServer-7.x/XS-7.0/RTM-125380/binary-packages/RPMS/domain0/RPMS/noarch
|
||||
wget $RPM_ROOT/supp-pack-build-2.1.0-xs55.noarch.rpm -O supp-pack-build.rpm
|
||||
wget $RPM_ROOT/xcp-python-libs-1.9.0-159.noarch.rpm -O xcp-python-libs.rpm
|
||||
|
@ -54,6 +77,16 @@ wget $RPM_ROOT/xcp-python-libs-1.9.0-159.noarch.rpm -O xcp-python-libs.rpm
|
|||
# Don't install the RPM as we may not have root.
|
||||
rpm2cpio supp-pack-build.rpm | cpio -idm
|
||||
rpm2cpio xcp-python-libs.rpm | cpio -idm
|
||||
|
||||
# ==============================================
|
||||
# Install suppack builder for Ely (XCP 2.2.0)
|
||||
RPM_ROOT=http://coltrane.uk.xensource.com/release/XenServer-7.x/XS-7.1/RC/137005.signed/binary-packages/RPMS/domain0/RPMS/noarch/
|
||||
wget $RPM_ROOT/python-libarchive-c-2.5-1.el7.centos.noarch.rpm -O python-libarchive.rpm
|
||||
wget $RPM_ROOT/update-package-1.1.2-1.noarch.rpm -O update-package.rpm
|
||||
|
||||
rpm2cpio python-libarchive.rpm | cpio -idm
|
||||
rpm2cpio update-package.rpm | cpio -idm
|
||||
|
||||
# Work around dodgy requirements for xcp.supplementalpack.setup function
|
||||
# Note that either root or a virtual env is needed here. venvs are better :)
|
||||
cp -f usr/bin/* .
|
||||
|
@ -125,9 +158,7 @@ EXTRA_RPMS="$EXTRA_RPMS $(find $FUELPLUG_UTILS_ROOT -name "libnetfilter_queue-*.
|
|||
|
||||
|
||||
# =============================================
|
||||
# Create Supplemental pack
|
||||
#rm -rf suppack
|
||||
#mkdir -p suppack
|
||||
# Create Supplemental pack for Creedence and Dundee
|
||||
|
||||
tee buildscript.py << EOF
|
||||
import sys
|
||||
|
@ -157,19 +188,51 @@ EOF
|
|||
|
||||
python buildscript.py \
|
||||
--pdn=xenapi-plugins-$OS_RELEASE \
|
||||
--pdv=$PLATFORM_VERSION \
|
||||
--pdv="1.9.0" \
|
||||
--hvn="$HYPERVISOR_NAME" \
|
||||
--desc="OpenStack Plugins" \
|
||||
--bld=0 \
|
||||
--out=$FUELPLUG_UTILS_ROOT \
|
||||
--out=$SUPPACK_CREEDENCE \
|
||||
$RPMFILE \
|
||||
$NEUTRON_RPMFILE
|
||||
|
||||
python buildscript.py \
|
||||
--pdn=conntrack-tools \
|
||||
--pdv=$PLATFORM_VERSION \
|
||||
--pdn=xenapi-plugins-$OS_RELEASE \
|
||||
--pdv="2.1.0" \
|
||||
--hvn="$HYPERVISOR_NAME" \
|
||||
--desc="Dom0 conntrack-tools" \
|
||||
--desc="OpenStack Plugins" \
|
||||
--bld=0 \
|
||||
--out=$FUELPLUG_UTILS_ROOT \
|
||||
--out=$SUPPACK_DUNDEE \
|
||||
$RPMFILE \
|
||||
$NEUTRON_RPMFILE \
|
||||
$EXTRA_RPMS
|
||||
|
||||
|
||||
# =============================================
|
||||
# Create Supplemental pack for Ely
|
||||
|
||||
# KEY for building supplemental pack
|
||||
SUPPACK_KEY="Citrix OpenStack (XenServer Updates) <openstack@citrix.com>"
|
||||
CONNTRACK_UUID=`uuidgen`
|
||||
XENAPI_PLUGIN_UUID=`uuidgen`
|
||||
|
||||
tee buildscript_ely.py << EOF
|
||||
import sys
|
||||
sys.path.append('$BUILDROOT/usr/lib/python2.7/site-packages')
|
||||
from pkg_resources import load_entry_point
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(
|
||||
load_entry_point('update-package', 'console_scripts', 'build-update')()
|
||||
)
|
||||
EOF
|
||||
|
||||
python buildscript_ely.py \
|
||||
--uuid $XENAPI_PLUGIN_UUID \
|
||||
-l "openstack-xenapi-plugins" \
|
||||
-v 1.0 \
|
||||
-d "OpenStack plugins supplemental pack" \
|
||||
-o $SUPPACK_ELY/xenapi-plugins-$OS_RELEASE.iso \
|
||||
-k "$SUPPACK_KEY" \
|
||||
--keyfile "$FUELPLUG_UTILS_ROOT/$SUPPACK_KEYFILE" --no-passphrase \
|
||||
$RPMFILE $NEUTRON_RPMFILE $EXTRA_RPMS
|
||||
|
|
Loading…
Reference in New Issue