Difference between revisions of "OpenHPC:OpenStack OS Image"
Jump to navigation
Jump to search
| Line 152: | Line 152: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | * Edit the <code> | + | * Edit the <code>answers.txt</code> file with some settings: |
<syntaxhighlight> | <syntaxhighlight> | ||
CONFIG_NTP_SERVERS=pool.ntp.org | CONFIG_NTP_SERVERS=pool.ntp.org | ||
Revision as of 12:07, 9 March 2016
Prepare a filesystem CHROOT image
- Create
/usr/libexec/warewulf/wwmkchroot/centos7.1-kilo.tmplto 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-kiloto~/.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 ntp 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- 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- 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.confMount 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
/devpseudo-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-packstackGo through the packstack process
- Use
packstackto 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.txtfile with some settings:
CONFIG_NTP_SERVERS=pool.ntp.org
CONFIG_KEYSTONE_ADMIN_PW=redhat
CONFIG_HORIZON_SSL=y
CONFIG_PROVISION_DEMO=n