Add CentOS 7 Support

Add support for running instack-install-undercloud on CentOS 7. The
selinux element from tripleo-image-elements fails when applying the
additional rabbitmq policy (depedencies are not met), so we add that
element to exclude_elements, and also inslucde selinux-permissive and
selinux-setenforce-0.

instack-setup-host-rhel7 is symlinked to an updated instack-setup-host and
supports both RHEL 7 and CentOS 7. We may like to consider removing the
rhos-release logic out of that script entirely and just document that
bit since rhos-release is solely for internal consumption.

Change-Id: I89a43f68632d8526b049be2b666c2426a5ccf603
This commit is contained in:
James Slagle 2015-02-27 09:41:17 -05:00
parent 563548c7bc
commit be540d0d14
15 changed files with 238 additions and 83 deletions

View File

@ -11,14 +11,29 @@ the dependencies are already present.
The following steps can be used to build images. They should be run as the same
non-root user that was used to install the undercloud.
#. Download the RHEL 7.1 cloud image or copy it over from a different
location, and define the needed environment variable to use the image::
#. The built images will automatically have the same base OS as the running
undercloud. See the Note below to choose a different OS::
curl -O http://download.devel.redhat.com/brewroot/packages/rhel-guest-image/7.1/20150203.1/images/rhel-guest-image-7.1-20150203.1.x86_64.qcow2
export DIB_LOCAL_IMAGE=rhel-guest-image-7.1-20150203.1.x86_64.qcow2
.. note:: To build images with a base OS different from the undercloud,
set the ``$NODE_DIST`` environment variable prior to running the
``instack-build-images`` command::
#. Build the required images.::
# To choose CentOS 7:
export NODE_DIST=centos7
# To choose RHEL 7.1:
exoprt NODE_DIST=rhel7
2. Build the required images::
.. note:: If building images for **RHEL 7.1**, download the RHEL 7.1 cloud image or copy
it over from a different location, and define the needed environment variable
to use the image prior to running the above ``instack-build-images`` commands::
curl -O http://download.devel.redhat.com/brewroot/packages/rhel-guest-image/7.1/20150203.1/images/rhel-guest-image-7.1-20150203.1.x86_64.qcow2
export DIB_LOCAL_IMAGE=rhel-guest-image-7.1-20150203.1.x86_64.qcow2
::
instack-build-images
#. Load the images into Glance::

View File

@ -12,7 +12,7 @@ while preparing the environment.
#. Download and execute the instack-undercloud setup script::
curl https://raw.githubusercontent.com/rdo-management/instack-undercloud/master/scripts/instack-setup-host-rhel7 | bash -x
curl https://raw.githubusercontent.com/rdo-management/instack-undercloud/master/scripts/instack-setup-host | bash -x
#. Install instack-undercloud::
@ -43,7 +43,7 @@ The installed packages can be upgraded on the Undercloud.
#. Rerun the setup script to update the list of defined yum repositories::
instack-setup-host-rhel7
instack-setup-host
#. Use yum to update the installed packages. No services should need to be
restarted after updating::

View File

@ -29,7 +29,7 @@ need to ensure you have enough memory and disk space.
Preparing the Host Machine
--------------------------
#. Install RHEL 7.1 Server x86_64.
#. Install RHEL 7.1 Server x86_64 or CentOS 7 x86_64.
#. Make sure sshd service is installed and running.
#. The user performing all of the installation steps on the virt host needs to
have sudo enabled. You can use an existing user or use the following commands
@ -46,20 +46,38 @@ Preparing the Host Machine
#. Make sure you are logged in as the non-root user you intend to use.
#. Download and execute the instack-undercloud setup script::
curl https://raw.githubusercontent.com/rdo-management/instack-undercloud/master/scripts/instack-setup-host-rhel7 | bash -x
curl https://raw.githubusercontent.com/rdo-management/instack-undercloud/master/scripts/instack-setup-host | bash -x
#. Install instack-undercloud::
sudo yum install -y instack-undercloud
#. Download the RHEL 7.1 cloud image or copy it over from a different
location, and define the needed environment variables for RHEL 7.1::
curl -O http://download.devel.redhat.com/brewroot/packages/rhel-guest-image/7.1/20150203.1/images/rhel-guest-image-7.1-20150203.1.x86_64.qcow2
export DIB_LOCAL_IMAGE=rhel-guest-image-7.1-20150203.1.x86_64.qcow2
export DIB_YUM_REPO_CONF=/etc/yum.repos.d/rhos-release-6-rhel-7.1.repo
#. The virt setup automatically sets up a vm for the Undercloud installed with
the same base OS as the host. See the Note below to choose a different
OS.::
#. Run the script to setup your virtual environment::
.. note:: To setup the undercloud vm with a base OS different from the host,
set the ``$NODE_DIST`` environment variable prior to running
``instack-virt-setup``::
# To choose CentOS 7:
export NODE_DIST=centos7
# To choose RHEL 7.1:
exoprt NODE_DIST=rhel7
8. Run the script to setup your virtual environment.::
.. note:: If building a **RHEL 7.1** undercloud, download the RHEL 7.1 cloud image or copy
it over from a different location, and define the needed environment variables
for RHEL 7.1 prior to running ``instack-virt-setup``::
curl -O http://download.devel.redhat.com/brewroot/packages/rhel-guest-image/7.1/20150203.1/images/rhel-guest-image-7.1-20150203.1.x86_64.qcow2
export DIB_LOCAL_IMAGE=rhel-guest-image-7.1-20150203.1.x86_64.qcow2
export DIB_YUM_REPO_CONF=/etc/yum.repos.d/rhos-release-6-rhel-7.1.repo
::
instack-virt-setup

View File

@ -0,0 +1 @@
operating-system

View File

@ -0,0 +1 @@
export DISTRO_NAME="centos7"

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eux
ln -s -f /bin/true /usr/local/bin/restore-selinux-file-context

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -eux
# Install repo file for Delorean el7 midstream packages built from
# rdo-management.
export DELOREAN_RDO_MANAGEMENT_REPO_URL=${DELOREAN_RDO_MANAGEMENT_REPO_URL:-"http://trunk-mgt.rdoproject.org/repos/current"}
sudo curl -o /etc/yum.repos.d/delorean-rdo-management.repo $DELOREAN_RDO_MANAGEMENT_REPO_URL/delorean.repo
# We can't have 2 yum repos called delorean though, so we must rename this one
sudo sed -i 's/delorean/delorean-rdo-management/' /etc/yum.repos.d/delorean-rdo-management.repo

View File

@ -5,8 +5,8 @@ set -o pipefail
install-packages hdparm ipmitool lshw ethtool lldpad hdparm sdparm pciutils mcelog smartmontools util-linux lvm2 jq
# python-pip is not available in the standard RHEL repos, it must be installed
# directly from brew.
yum -y install http://download.devel.redhat.com/brewroot/packages/python-pip/1.3.1/4.el7ost/noarch/python-pip-1.3.1-4.el7ost.noarch.rpm
# python-hardware package is missing requires on python-psutil
# and also should have a requirement on python-ptyprocess which does not appear
# packaged anywhere, so we have to fall back to pip for now.
yum -y install python-pip
pip install hardware

View File

@ -0,0 +1,78 @@
[
{
"name": "Initialization",
"element": [
"base",
"dib-run-parts",
"centos7-distro",
"undercloud-package-install"
],
"hook": [
"extra-data",
"root",
"pre-install"
],
"blacklist": [
"01-ccache"
]
},
{
"name": "Installation",
"element": [
"base",
"undercloud-install",
"boot-stack",
"centos7",
"centos7-distro",
"nova-ironic",
"os-collect-config",
"horizon",
"neutron-dhcp-agent",
"undercloud-stack-config",
"rabbitmq-server",
"mariadb-rpm",
"os-refresh-config-reboot",
"common-venv",
"undercloud-post-config",
"undercloud-package-install",
"ceilometer-collector",
"ceilometer-api",
"ceilometer-agent-central",
"ceilometer-agent-notification",
"ceilometer-undercloud-config",
"ironic-discoverd",
"element-manifest",
"tuskar",
"fix-undercloud-package-installs",
"os-cloud-config",
"selinux-permissive",
"selinux-setenforce-0"
],
"hook": [
"extra-data",
"pre-install",
"install",
"post-install",
"finalise"
],
"exclude-element": [
"dkms",
"openvswitch-datapath",
"pip-and-virtualenv",
"selinux"
],
"blacklist": [
"10-cloud-init",
"50-store-build-settings",
"99-dkms",
"99-up-to-date",
"01-yum-keepcache",
"15-remove-grub",
"05-fstab-rootfs-label",
"15-fedora-remove-grub",
"00-load-selinux-policy",
"00-install-and-load-selinux-policy",
"00-rhel-registration"
]
}
]

View File

@ -35,8 +35,26 @@ export NODE_ARCH=${NODE_ARCH:-amd64}
# We must do this until tripleo-puppet-elements is packaged
export DIB_INSTALLTYPE_puppet_modules=source
if $(grep -Eqs 'Red Hat Enterprise Linux' /etc/redhat-release); then
export NODE_DIST=${NODE_DIST:-rhel7}
export DELOREAN_EL7_REPO_URL="http://104.130.230.24/centos70/4a/1d/4a1d1169acdf6b63239b60a898a33caf428acb5c_291a4aa4/"
export NODE_DIST=${NODE_DIST:-""}
# Attempt to detect $NODE_DIST, exit 1 if we can't
if [ -z "$NODE_DIST" ]; then
if $(grep -Eqs 'Red Hat Enterprise Linux' /etc/redhat-release); then
export NODE_DIST=${NODE_DIST:-rhel7}
elif $(grep -Eqs 'CentOS' /etc/redhat-release); then
export NODE_DIST=${NODE_DIST:-centos7}
elif $(grep -Eqs 'Fedora' /etc/redhat-release); then
export NODE_DIST=${NODE_DIST:-fedora}
else
echo "Could not detect distritubion from /etc/redhat-release!"
exit 1
fi
fi
# Set specific variables based on $NODE_DIST
if [ "$NODE_DIST" = "rhel7" ]; then
export REG_METHOD=disable
# We need to set RHOS=0 so that epel/rdo get enabled.
@ -46,19 +64,18 @@ if $(grep -Eqs 'Red Hat Enterprise Linux' /etc/redhat-release); then
export DIB_COMMON_ELEMENTS=rhos-release
export REG_HALT_UNREGISTER=1
export DELOREAN=1
export DELOREAN_REPO_URL="http://104.130.230.24/centos70/4a/1d/4a1d1169acdf6b63239b60a898a33caf428acb5c_291a4aa4/"
elif $(grep -Eqs 'CentOS' /etc/redhat-release); then
export NODE_DIST=${NODE_DIST:-centos7}
elif $(grep -Eqs 'Fedora' /etc/redhat-release); then
export NODE_DIST=${NODE_DIST:-fedora}
else
echo "Could not detect distritubion from /etc/redhat-release!"
exit 1
export DELOREAN_REPO_URL=$DELOREAN_EL7_REPO_URL
elif [ "$NODE_DIST" = "centos7" ]; then
export DELOREAN_REPO_URL=$DELOREAN_EL7_REPO_URL
# SELinux permissive for CentOS for now
export DIB_COMMON_ELEMENTS=selinux-permissive
fi
export DEPLOY_IMAGE_ELEMENT=${DEPLOY_IMAGE_ELEMENT:-deploy-ironic}
export DEPLOY_NAME=${DEPLOY_NAME:-deploy-ramdisk-ironic}
export DISCOVERY_IMAGE_ELEMENT=${DISCOVERY_IMAGE_ELEMENT:-ironic-discoverd-ramdisk-instack}
# Include delorean-rdo-management with the discovery ramdisk build so that we
# can install python-hardware from somewhere.
export DISCOVERY_IMAGE_ELEMENT=${DISCOVERY_IMAGE_ELEMENT:-"ironic-discoverd-ramdisk-instack"}
export DISCOVERY_NAME=${DISCOVERY_NAME:-discovery-ramdisk}
export DIB_COMMON_ELEMENTS=${DIB_COMMON_ELEMENTS:-""}
@ -106,12 +123,16 @@ delorean-repo \
stable-interface-names \
"
# There are new deps on python-psutil and python-debtcollector but the Nova and Cinder
# packages are not updated yet to actually require them.
export OVERCLOUD_CONTROL_DIB_EXTRA_ARGS=${OVERCLOUD_CONTROL_DIB_EXTRA_ARGS:-"\
-p python-psutil,python-debtcollector \
$PUPPET_COMMON_ELEMENTS
overcloud-controller \
"}
export OVERCLOUD_COMPUTE_DIB_EXTRA_ARGS=${OVERCLOUD_COMPUTE_DIB_EXTRA_ARGS:-"\
-p python-psutil,python-debtcollector \
$PUPPET_COMMON_ELEMENTS
overcloud-compute
"}

View File

@ -26,6 +26,7 @@ if $(grep -Eqs 'Red Hat Enterprise Linux' /etc/redhat-release); then
export REG_HALT_UNREGISTER=1
elif $(grep -Eqs 'CentOS' /etc/redhat-release); then
export NODE_DIST=${NODE_DIST:-centos7}
export JSONFILE=${JSONFILE:-$JSONFILEDIR/centos-7-undercloud-packages.json}
elif $(grep -Eqs 'Fedora' /etc/redhat-release); then
export NODE_DIST=${NODE_DIST:-fedora}
export JSONFILE=${JSONFILE:-$JSONFILEDIR/fedora-20-undercloud-packages.json}
@ -65,6 +66,7 @@ export LOCAL_INTERFACE
export MASQUERADE_NETWORK
export POWER_DRIVER
export VIRTUAL_POWER_USER
export VIRTUAL_POWER_HOST
export DHCP_START
export DHCP_END

51
scripts/instack-setup-host Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash
set -eux
set -o pipefail
# Install repo file for Delorean master packages
# Pin to an older repo for now because newer openstack-keystone requires a
# newer and not yet avaialable python-pycadf.
export DELOREAN_REPO=${DELOREAN_REPO:-"http://104.130.230.24/centos70/4a/1d/4a1d1169acdf6b63239b60a898a33caf428acb5c_291a4aa4/delorean.repo"}
sudo curl -o /etc/yum.repos.d/delorean.repo $DELOREAN_REPO
# Install repo file for Delorean el7 midstream packages built from
# rdo-management.
export DELOREAN_RHEL7_REPO=${DELOREAN_RHEL7_REPO:-"http://trunk-mgt.rdoproject.org/repos/current/delorean.repo"}
sudo curl -o /etc/yum.repos.d/delorean-rdo-management.repo $DELOREAN_RHEL7_REPO
# We can't have 2 yum repos called delorean though, so we must rename this one
sudo sed -i 's/delorean/delorean-rdo-management/' /etc/yum.repos.d/delorean-rdo-management.repo
# Delorean requires RDO
if ! rpm -q rdo-release; then
sudo yum install -y https://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo-0.noarch.rpm
fi
if ! rpm -q epel-release; then
sudo yum install -y http://mirrors.einstein.yu.edu/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
fi
if $(grep -Eqs 'Red Hat Enterprise Linux Server' /etc/redhat-release); then
# rhos-release is also required, otherwise we have no base RHEL repositories to
# pull any dependencies from (without using subscription-manager anyway).
sudo rpm -Uvh --force http://rhos-release.virt.bos.redhat.com/repos/rhos-release/rhos-release-latest.noarch.rpm
export RUN_RHOS_RELEASE=${RUN_RHOS_RELEASE:-"1"}
if [ "$RUN_RHOS_RELEASE" = "1" ]; then
sudo rhos-release 6
fi
# We need openwsman-python from the optional repo
sudo yum-config-manager --enable rhelosp-rhel-7-server-opt
fi
# newer openstack-keystone requires python-zope-interface, but that is not
# avaiable anywhere for EL7. So just install the Fedora package for now. We can
# add this dep to Delorean going forward.
if ! rpm -q python-zope-interface; then
sudo yum install -y http://mirrors.kernel.org/fedora//releases/20/Everything/x86_64/os/Packages/p/python-zope-interface-4.0.5-2.fc20.x86_64.rpm
fi
# Required for building puppet-based images
# We can remove these once we add a corresponding Requires:
# to the instack-undercloud spec file.
sudo yum install -y openstack-heat-templates
sudo yum install -y openstack-tripleo-puppet-elements

View File

@ -1,50 +0,0 @@
#!/bin/bash
set -eux
set -o pipefail
# Install repo file for Delorean master packages
# Pin to an older repo for now because newer openstack-keystone requires a
# newer and not yet avaialable python-pycadf.
export DELOREAN_REPO=${DELOREAN_REPO:-"http://104.130.230.24/centos70/4a/1d/4a1d1169acdf6b63239b60a898a33caf428acb5c_291a4aa4/delorean.repo"}
sudo curl -o /etc/yum.repos.d/delorean.repo $DELOREAN_REPO
# Install repo file for Delorean el7 midstream packages built from
# rdo-management.
export DELOREAN_RHEL7_REPO=${DELOREAN_RHEL7_REPO:-"http://trunk-mgt.rdoproject.org/repos/current/delorean.repo"}
sudo curl -o /etc/yum.repos.d/delorean-rdo-management.repo $DELOREAN_RHEL7_REPO
# We can't have 2 yum repos called delorean though, so we must rename this one
sudo sed -i 's/delorean/delorean-rdo-management/' /etc/yum.repos.d/delorean-rdo-management.repo
# Delorean requires RDO
if ! rpm -q rdo-release; then
sudo yum install -y https://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo-0.noarch.rpm
fi
if ! rpm -q epel-release; then
sudo yum install -y http://mirrors.einstein.yu.edu/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
fi
# rhos-release is also required, otherwise we have no base RHEL repositories to
# pull any dependencies from (without using subscription-manager anyway).
sudo rpm -Uvh --force http://rhos-release.virt.bos.redhat.com/repos/rhos-release/rhos-release-latest.noarch.rpm
export RUN_RHOS_RELEASE=${RUN_RHOS_RELEASE:-"1"}
if [ "$RUN_RHOS_RELEASE" = "1" ]; then
sudo rhos-release 6
fi
# We need openwsman-python from the optional repo
sudo yum-config-manager --enable rhelosp-rhel-7-server-opt
# newer openstack-keystone requires python-zope-interface, but that is not
# avaiable anywhere for EL7. So just install the Fedora package for now. We can
# add this dep to Delorean going forward.
if ! rpm -q python-zope-interface; then
sudo yum install -y http://mirrors.kernel.org/fedora//releases/20/Everything/x86_64/os/Packages/p/python-zope-interface-4.0.5-2.fc20.x86_64.rpm
fi
# Required for building puppet-based images
# We can remove these once we add a corresponding Requires:
# to the instack-undercloud spec file.
sudo yum install -y openstack-heat-templates
sudo yum install -y openstack-tripleo-puppet-elements

View File

@ -0,0 +1 @@
instack-setup-host

View File

@ -28,7 +28,7 @@ scripts =
scripts/instack-install-undercloud
scripts/instack-ironic-deployment
scripts/instack-prepare-for-overcloud
scripts/instack-setup-host-rhel7
scripts/instack-setup-host
scripts/instack-test-overcloud
scripts/instack-virt-setup

View File

@ -1,2 +1,3 @@
oslosphinx
sphinx>=1.1.2,<1.2
# Doc requirements
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
oslosphinx>=2.2.0 # Apache-2.0