Difference between revisions of "OpenHPC:OpenStack OS Image"

From Define Wiki
Jump to navigation Jump to search
(Created page with "== Prepare a filesystem CHROOT image == '''Create <Code>/usr/libexec/warewulf/wwmkchroot/centos7.1-kilo.tmpl</code> to point to updated repo data <syntaxhighlight> [root@head setup-fil...")
 
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Prepare a filesystem CHROOT image ==
 
== Prepare a filesystem CHROOT image ==
  
'''Create <Code>/usr/libexec/warewulf/wwmkchroot/centos7.1-kilo.tmpl</code> to point to updated repo data
+
* Create <Code>/usr/libexec/warewulf/wwmkchroot/centos7.1-kilo.tmpl</code> to point to updated repo data
  
 
<syntaxhighlight>
 
<syntaxhighlight>
Line 31: Line 31:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''Add <code>CHROOTKILO=/opt/ohpc/admin/images/centos7.1-kilo</code> to <code>~/.bashrc</code>
+
* Add <code>CHROOTKILO=/opt/ohpc/admin/images/centos7.1-kilo</code> to <code>~/.bashrc</code>
<br>
+
<syntaxhighlight>
'''Make Initial VNFS (Chroot, compute Node template) and install some Base components into the chroot operating system'''
+
[root@head images]# cat ~/.bashrc
 +
# .bashrc
 +
 
 +
# User specific aliases and functions
 +
 
 +
alias rm='rm -i'
 +
alias cp='cp -i'
 +
alias mv='mv -i'
 +
alias l='ls -l'
 +
alias ipmit='ipmitool -U ADMIN -P ADMIN -I lanplus -H'
 +
 
 +
CHROOTKILO=/opt/ohpc/admin/images/centos7.1-kilo
 +
CHROOT=/opt/ohpc/admin/images/centos7.1
 +
ohpc_repo=http://build.openhpc.community/OpenHPC:/1.0/CentOS_7.1/OpenHPC:1.0.repo
 +
sms_name=head.vscaler.local # Hostanem of Headnode
 +
sms_ip=172.30.0.1 # Private Interface IP of Headnode
 +
sms_eth_internal=enp1s0f0 # Private Interface of Headnode
 +
eth_provision=enp1s0f0 # Provisioning Interface of Headnode
 +
internal_netmask=255.255.0.0 # Netmaks of Private Interface
 +
ntp_server=0.centos.pool.ntp.org # Some NTP Server
 +
bmc_username=ADMIN
 +
bmc_password=ADMIN
 +
sms_ipoib=10.10.20.1 # IPoIB Address of Headnode
 +
ipoib_netmask=255.255.255.0 # IPoIB Netmask of Headnode
 +
 
 +
# Source global definitions
 +
if [ -f /etc/bashrc ]; then
 +
. /etc/bashrc
 +
fi
 +
</syntaxhighlight>
 +
 
 +
* Make Initial VNFS (Chroot, compute Node template) and install some Base components into the chroot operating system
  
 
<syntaxhighlight>
 
<syntaxhighlight>
 
wwmkchroot centos-7 $CHROOTKILO
 
wwmkchroot centos-7 $CHROOTKILO
 
yum -y --installroot=$CHROOTKILO groupinstall Base
 
yum -y --installroot=$CHROOTKILO groupinstall Base
yum -y --installroot=$CHROOTKILO install kernel* grub* sudo ipmitool* epel-release htop nano tk* tcl* tigervnc* ipmitool* freeipmi* cairo* perl* gcc* glibc* screen yum-utils vim ntp libnl  
+
yum -y --installroot=$CHROOTKILO install kernel* grub* sudo ipmitool* epel-release htop nano tk* tcl* tigervnc* ipmitool* freeipmi* cairo* perl* gcc* glibc* screen yum-utils vim libnl  
 
lsof libxml2-python python mlocate numactl* lmod-ohpc ohpc-slurm-client lmod-ohpc ganglia-gmond-ohpc enviroment-modules hwlock-libs libfabric libpsm2 intel-clck-ohpc
 
lsof libxml2-python python mlocate numactl* lmod-ohpc ohpc-slurm-client lmod-ohpc ganglia-gmond-ohpc enviroment-modules hwlock-libs libfabric libpsm2 intel-clck-ohpc
 +
yum -y --installroot=$CHROOTKILO remove perl-Test-mysqld-0.17-3.el7.noarch
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''Setup SSH Keys for the Cluster – this is required for the root user only, /home will be exported so user ssh keys will be available. '''
+
* Setup SSH Keys for the Cluster – this is required for the root user only, /home will be exported so user ssh keys will be available.
  
 
<syntaxhighlight>
 
<syntaxhighlight>
Line 49: Line 81:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''Copy over  resolv.conf to the chroot and modify the contents to point to the headnode and google dns.'''
+
* Add mount points to <code>/etc/fstab</code>
 +
<syntaxhighlight>
 +
echo "${sms_ip}:/home /home nfs nfsvers=3,rsize=1024,wsize=1024,cto 0 0" >> $CHROOTKILO/etc/fstab
 +
echo "${sms_ip}:/opt/ohpc/pub /opt/ohpc/pub nfs nfsvers=3,rsize=1024,wsize=1024,cto 0 0" >> $CHROOTKILO/etc/fstab
 +
</syntaxhighlight>
 +
 
 +
* Copy over  resolv.conf to the chroot and modify the contents to point to the headnode and google dns.
  
 
<syntaxhighlight>
 
<syntaxhighlight>
Line 56: Line 94:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''Modify Limits to unlimited on headnode and compute nodes..'''
+
* Modify Limits to unlimited on headnode and compute nodes..
  
 
<syntaxhighlight>
 
<syntaxhighlight>
Line 63: Line 101:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''Building the bootstrap and vnfs images'''
+
* Building the bootstrap and vnfs images
  
 
<syntaxhighlight>
 
<syntaxhighlight>
[root@head setup-filesystems]# wwbootstrap 3.10.0-327.10.1.el7.x86_64
+
[root@head ~]# wwbootstrap 3.10.0-327.10.1.el7.x86_64
 
Number of drivers included in bootstrap: 433
 
Number of drivers included in bootstrap: 433
 
Number of firmware images included in bootstrap: 93
 
Number of firmware images included in bootstrap: 93
Line 81: Line 119:
 
Bootstrap image '3.10.0-327.10.1.el7.x86_64' is ready
 
Bootstrap image '3.10.0-327.10.1.el7.x86_64' is ready
 
Done.
 
Done.
[root@head setup-filesystems]# wwvnfs -y --chroot $CHROOTKILO
+
[root@head ~]# wwvnfs -y --chroot $CHROOTKILO
 
Using 'centos7.1-kilo' as the VNFS name
 
Using 'centos7.1-kilo' as the VNFS name
Creating VNFS image from centos7.1
+
Creating VNFS image from centos7.1-kilo
 
Building new chroot...
 
Building new chroot...
 
Building and compressing the final image
 
Building and compressing the final image
Line 91: Line 129:
 
Wrote a new configuration file at: /etc/warewulf/vnfs/centos7.1-kilo.conf
 
Wrote a new configuration file at: /etc/warewulf/vnfs/centos7.1-kilo.conf
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
== Mount the CHROOT filesystem locally for editing ==
 +
 +
* The above process should have created a vanilla CentOS 7.1 image which could be deployed to compute nodes. We need to chroot to the root filesystem and modify it with all the OpenStack goodness.
 +
 +
* Before chrooting the new filesystem, we need to mount the host's <code>/dev</code> pseudo-directory to the new filesystem:
 +
<code>
 +
[root@head ~]# mount --bind /dev $CHROOTKILO/dev
 +
</code>
 +
 +
* Now go ahead and chroot to the new filesystem:
 +
<code>
 +
[root@head ~]# chroot $CHROOTKILO
 +
</code>
 +
 +
== Install OpenStack Kilo RDO release and packstack ==
 +
<syntaxhighlight>
 +
[root@head /]# yum install -y http://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm
 +
[root@head /]# yum -y install openstack-packstack
 +
</syntaxhighlight>
 +
 +
== Create a packstack answer file ==
 +
 +
* Use <code>packstack</code> to create an answer file:
 +
<syntaxhighlight>
 +
[root@head /]# packstack --gen-answer-file /root/answers.txt
 +
Packstack changed given value  to required value /root/.ssh/id_rsa.pub
 +
[root@head /]#
 +
</syntaxhighlight>
 +
 +
* Edit the <code>answers.txt</code> file with some settings:
 +
<syntaxhighlight>
 +
CONFIG_NTP_SERVERS=pool.ntp.org
 +
CONFIG_KEYSTONE_ADMIN_PW=Boston2016
 +
CONFIG_HORIZON_SSL=y
 +
CONFIG_PROVISION_DEMO=n
 +
</syntaxhighlight>
 +
 +
* Also make sure the IP addresses in the answer file are appropriate for the target system (by default, they will point to the head node which is not a good situation). For example:
 +
<syntaxhighlight>
 +
CONFIG_CONTROLLER_HOST=172.30.1.1
 +
CONFIG_COMPUTE_HOSTS=172.30.1.1
 +
CONFIG_NETWORK_HOSTS=172.30.1.1
 +
CONFIG_STORAGE_HOST=172.30.1.1
 +
CONFIG_SAHARA_HOST=172.30.1.1
 +
CONFIG_AMQP_HOST=172.30.1.1
 +
CONFIG_MARIADB_HOST=172.30.1.1
 +
CONFIG_KEYSTONE_LDAP_URL=ldap://172.30.1.1
 +
CONFIG_MONGODB_HOST=172.30.1.1
 +
CONFIG_REDIS_MASTER_HOST=172.30.1.1
 +
</syntaxhighlight>
 +
'''NB: Moving forwards, we should look at making the contents of this file dynamic so OpenHPC populates the IP addresses according to the host it is going be installed on.'''
 +
 +
* Modify the <code>$CHROOTKILO/root/.bashrc</code> file to the following:
 +
<syntaxhighlight>
 +
[root@node-b ~]# cat .bashrc
 +
# .bashrc
 +
 +
# Source global definitions
 +
if [ -f /etc/bashrc ]; then
 +
. /etc/bashrc
 +
fi
 +
 +
# Uncomment the following line if you don't like systemctl's auto-paging feature:
 +
# export SYSTEMD_PAGER=
 +
 +
# User specific aliases and functions
 +
 +
export LANG=en_US.UTF-8
 +
export LC_ALL=C
 +
</syntaxhighlight>
 +
 +
== Rebuild the vnfs image ==
 +
* As before rebuild the vnfs image: NB this process takes about 20 minutes on our test system!
 +
<syntaxhighlight>
 +
[root@head ~]# wwvnfs -y --chroot $CHROOTKILO
 +
Using 'centos7.1-kilo' as the VNFS name
 +
Creating VNFS image from centos7.1-kilo
 +
Building new chroot...
 +
Building and compressing the final image
 +
Cleaning temporary files
 +
VNFS 'centos7.1-kilo' has been imported
 +
Done.
 +
Wrote a new configuration file at: /etc/warewulf/vnfs/centos7.1-kilo.conf
 +
</syntaxhighlight>
 +
 +
== Get the new OS image onto the desired node==
 +
 +
* Set the <code>--vnfs</code> and <code>--bootstrap</code> params for the desired node:
 +
<syntaxhighlight>
 +
[root@head ~]# wwsh -y provision set node-b --vnfs=centos7.1-kilo --bootstrap=`name -r`
 +
</syntaxhighlight>
 +
 +
* And reboot it for the OS image to be installed:
 +
<syntaxhighlight>
 +
[root@head ~]# ipmitool -U ADMIN -P ADMIN -H node-b-bmc chassis power reset
 +
</syntaxhighlight>
 +
 +
== Completing the OpenStack installation on the destination node ==
 +
 +
* Continue to [[OpenHPC: Configuring Deployed OpenStack OS Image]] to get OpenStack running on the destination node

Latest revision as of 21:17, 9 March 2016

Prepare a filesystem CHROOT image

  • Create /usr/libexec/warewulf/wwmkchroot/centos7.1-kilo.tmpl to point to updated repo data
[root@head setup-filesystems]# cat /usr/libexec/warewulf/wwmkchroot/centos7.1-kilo.tmpl
#DESC: A clone of Red Hat Enterprise Linux 7

# The general RHEL include has all of the necessary functions, but requires
# some basic variables specific to each chroot type to be defined.
. include-rhel



# Define the location of the YUM repository
YUM_MIRROR="http://mirror.centos.org/centos-7/7.2.1511/os/\$basearch/"

# Install only what is necessary/specific for this distribution
PKGLIST="SysVinit basesystem bash redhat-release chkconfig coreutils e2fsprogs \
    ethtool filesystem findutils gawk grep initscripts iproute iputils \
    mingetty mktemp net-tools nfs-utils pam portmap procps psmisc rdate rsync \
    sed setup shadow-utils rsyslog tcp_wrappers tzdata util-linux words zlib \
    tar less gzip which util-linux module-init-tools udev openssh-clients \
    openssh-server dhclient pciutils vim-minimal shadow-utils strace cronie \
    crontabs cpuspeed cpufrequtils cpio wget yum numactl libicu"




# vim:filetype=sh:syntax=sh:expandtab:ts=4:sw=4:
  • Add CHROOTKILO=/opt/ohpc/admin/images/centos7.1-kilo to ~/.bashrc
[root@head images]# cat ~/.bashrc 
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias l='ls -l'
alias ipmit='ipmitool -U ADMIN -P ADMIN -I lanplus -H'

CHROOTKILO=/opt/ohpc/admin/images/centos7.1-kilo
CHROOT=/opt/ohpc/admin/images/centos7.1
ohpc_repo=http://build.openhpc.community/OpenHPC:/1.0/CentOS_7.1/OpenHPC:1.0.repo
sms_name=head.vscaler.local			# Hostanem of Headnode
sms_ip=172.30.0.1				# Private Interface IP of Headnode
sms_eth_internal=enp1s0f0			# Private Interface of Headnode
eth_provision=enp1s0f0				# Provisioning Interface of Headnode
internal_netmask=255.255.0.0		# Netmaks of Private Interface
ntp_server=0.centos.pool.ntp.org		# Some NTP Server
bmc_username=ADMIN
bmc_password=ADMIN
sms_ipoib=10.10.20.1				# IPoIB Address of Headnode
ipoib_netmask=255.255.255.0			# IPoIB Netmask of Headnode

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi
  • Make Initial VNFS (Chroot, compute Node template) and install some Base components into the chroot operating system
wwmkchroot centos-7 $CHROOTKILO
yum -y --installroot=$CHROOTKILO groupinstall Base
yum -y --installroot=$CHROOTKILO install kernel* grub* sudo ipmitool* epel-release htop nano tk* tcl* tigervnc* ipmitool* freeipmi* cairo* perl* gcc* glibc* screen yum-utils vim libnl 
lsof libxml2-python python mlocate numactl* lmod-ohpc ohpc-slurm-client lmod-ohpc ganglia-gmond-ohpc enviroment-modules hwlock-libs libfabric libpsm2 intel-clck-ohpc
yum -y --installroot=$CHROOTKILO remove perl-Test-mysqld-0.17-3.el7.noarch
  • Setup SSH Keys for the Cluster – this is required for the root user only, /home will be exported so user ssh keys will be available.
wwinit ssh_keys
cat ~/.ssh/cluster.pub >> $CHROOTKILO/root/.ssh/authorized_keys
  • Add mount points to /etc/fstab
echo "${sms_ip}:/home /home nfs nfsvers=3,rsize=1024,wsize=1024,cto 0 0" >> $CHROOTKILO/etc/fstab
echo "${sms_ip}:/opt/ohpc/pub /opt/ohpc/pub nfs nfsvers=3,rsize=1024,wsize=1024,cto 0 0" >> $CHROOTKILO/etc/fstab
  • Copy over resolv.conf to the chroot and modify the contents to point to the headnode and google dns.
cp /etc/resolv.conf $CHROOTKILO/etc/
vi $CHROOTKILO/etc/resolv.conf
  • Modify Limits to unlimited on headnode and compute nodes..
echo "* soft memlock unlimited" >> $CHROOTKILO/etc/security/limits.conf
echo "* hard memlock unlimited" >> $CHROOTKILO/etc/security/limits.conf
  • Building the bootstrap and vnfs images
[root@head ~]# wwbootstrap 3.10.0-327.10.1.el7.x86_64
Number of drivers included in bootstrap: 433
Number of firmware images included in bootstrap: 93
Building and compressing bootstrap
Integrating the Warewulf bootstrap: 3.10.0-327.10.1.el7.x86_64
Including capability: provision-adhoc
Including capability: provision-files
Including capability: provision-selinux
Including capability: provision-vnfs
Including capability: setup-filesystems
Including capability: transport-http
Compressing the initramfs
Locating the kernel object
Bootstrap image '3.10.0-327.10.1.el7.x86_64' is ready
Done.
[root@head ~]# wwvnfs -y --chroot $CHROOTKILO
Using 'centos7.1-kilo' as the VNFS name
Creating VNFS image from centos7.1-kilo
Building new chroot...
Building and compressing the final image
Cleaning temporary files
VNFS 'centos7.1-kilo' has been imported
Done.
Wrote a new configuration file at: /etc/warewulf/vnfs/centos7.1-kilo.conf

Mount the CHROOT filesystem locally for editing

  • The above process should have created a vanilla CentOS 7.1 image which could be deployed to compute nodes. We need to chroot to the root filesystem and modify it with all the OpenStack goodness.
  • Before chrooting the new filesystem, we need to mount the host's /dev pseudo-directory to the new filesystem:

[root@head ~]# mount --bind /dev $CHROOTKILO/dev

  • Now go ahead and chroot to the new filesystem:

[root@head ~]# chroot $CHROOTKILO

Install OpenStack Kilo RDO release and packstack

[root@head /]# yum install -y http://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm
[root@head /]# yum -y install openstack-packstack

Create a packstack answer file

  • Use packstack to create an answer file:
[root@head /]# packstack --gen-answer-file /root/answers.txt
Packstack changed given value  to required value /root/.ssh/id_rsa.pub
[root@head /]#
  • Edit the answers.txt file with some settings:
CONFIG_NTP_SERVERS=pool.ntp.org
CONFIG_KEYSTONE_ADMIN_PW=Boston2016
CONFIG_HORIZON_SSL=y
CONFIG_PROVISION_DEMO=n
  • Also make sure the IP addresses in the answer file are appropriate for the target system (by default, they will point to the head node which is not a good situation). For example:
CONFIG_CONTROLLER_HOST=172.30.1.1
CONFIG_COMPUTE_HOSTS=172.30.1.1
CONFIG_NETWORK_HOSTS=172.30.1.1
CONFIG_STORAGE_HOST=172.30.1.1
CONFIG_SAHARA_HOST=172.30.1.1
CONFIG_AMQP_HOST=172.30.1.1
CONFIG_MARIADB_HOST=172.30.1.1
CONFIG_KEYSTONE_LDAP_URL=ldap://172.30.1.1
CONFIG_MONGODB_HOST=172.30.1.1
CONFIG_REDIS_MASTER_HOST=172.30.1.1

NB: Moving forwards, we should look at making the contents of this file dynamic so OpenHPC populates the IP addresses according to the host it is going be installed on.

  • Modify the $CHROOTKILO/root/.bashrc file to the following:
[root@node-b ~]# cat .bashrc 
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions

export LANG=en_US.UTF-8
export LC_ALL=C

Rebuild the vnfs image

  • As before rebuild the vnfs image: NB this process takes about 20 minutes on our test system!
[root@head ~]# wwvnfs -y --chroot $CHROOTKILO
Using 'centos7.1-kilo' as the VNFS name
Creating VNFS image from centos7.1-kilo
Building new chroot...
Building and compressing the final image
Cleaning temporary files
VNFS 'centos7.1-kilo' has been imported
Done.
Wrote a new configuration file at: /etc/warewulf/vnfs/centos7.1-kilo.conf

Get the new OS image onto the desired node

  • Set the --vnfs and --bootstrap params for the desired node:
[root@head ~]# wwsh -y provision set node-b --vnfs=centos7.1-kilo --bootstrap=`name -r`
  • And reboot it for the OS image to be installed:
[root@head ~]# ipmitool -U ADMIN -P ADMIN -H node-b-bmc chassis power reset

Completing the OpenStack installation on the destination node