echo "Updating available packages"
apt-get update
+apt-get install -y --install-recommends linux-generic-hwe-16.04 xserver-xorg-hwe-16.04
+apt-get install -y ipmitool
+
+# Adding 3 node cluster related changes
+swapoff --all
+ln -s /etc/apparmor.d/usr.sbin.ntpd /etc/apparmor.d/disable/
+ln -s /etc/apparmor.d/usr.sbin.tcpdump /etc/apparmor.d/disable/
+apparmor_parser -R /etc/apparmor.d/usr.sbin.ntpd
+apparmor_parser -R /etc/apparmor.d/usr.sbin.tcpdump
echo "Adding IP Tables Rules"
echo 1 > /proc/sys/net/ipv4/ip_forward
# create ceph journal partition and filesystem
devices=sdh
-size=320
+#size=320
echo "creating partions for ceph journal:"
echo $devices
for d in $devices
do
parted -s /dev/${d} mklabel msdos
- parted -s /dev/${d} -- mkpart primary ext4 1 ${size}
+ parted -s -a optimal /dev/${d} -- mkpart primary ext4 1 -1s
done
partprobe
sleep 5 #let udev settle down
devnum=1
for d in $devices
do
- mountpoint=/var/lib/openstack-helm/ceph/journal/ceph${devnum}
+ mountpoint=/var/lib/ceph/journal
mkfs -t ext4 /dev/${d}${devnum}
UUID=$(blkid -o export /dev/${d}${devnum} | sed -ne /^UUID/s/UUID=//p)
mkdir -p ${mountpoint}
done
/bin/mount -a
+devnum=1
+for d in $devices
+do
+ df -lh /dev/${d}${devnum}
+ if [ $? -eq 0 ]
+ then
+ echo " ${d}${devnim} Filesystem Created successfully"
+ else
+ echo " ${d}${devnim} Filesystem not Found"
+ fi
+done
+
+# Creating Network interfaces for Calico, Neutron and Storage
+echo " Creating Additional Network interfaces"
+bond=@@SRV_BOND@@"."
+storage=${bond}@@SRV_STORAGE_VLAN@@
+calico=${bond}@@SRV_CALICO_VLAN@@
+neutron=${bond}@@SRV_NEUTRON_VLAN@@
+
+cp -p /etc/network/interfaces /etc/network/interfaces.orig
+
+#Creating Storage interface
+if [ -n "@@SRV_STORAGE_VLAN@@" ]; then
+ echo "Configuring Storage interface in the server"
+ tee -a /etc/network/interfaces << END
+ #STORAGE
+ auto $storage
+ iface $storage inet static
+ address @@SRV_STORAGE_IP@@
+ netmask 255.255.255.0
+ vlan-raw-device @@SRV_BOND@@
+ mtu @@SRV_MTU@@
+END
+ ifup $storage
+ if [ $? -eq 0 ]; then
+ echo " Storage interface Created"
+ else
+ echo " Failed to create Storage Interface"
+ fi
+fi
+
+#Creating Calico Interface
+if [ -n "@@SRV_CALICO_VLAN@@" ]; then
+ echo "Configuring Calico Interface in the server"
+ tee -a /etc/network/interfaces << END
+ #CALICO
+ auto $calico
+ iface $calico inet static
+ address @@SRV_CALICO_IP@@
+ netmask 255.255.255.0
+ vlan-raw-device @@SRV_BOND@@
+ mtu @@SRV_MTU@@
+END
+ ifup $calico
+ if [ $? -eq 0 ]; then
+ echo " Calico interface Created"
+ else
+ echo " Failed to create Calico Interface"
+ fi
+fi
+
+# Creating Overlay/Neutron interface
+
+if [ -n "@@SRV_NEUTRON_VLAN@@" ]; then
+ echo "Configuring Neutron Interface in the server"
+ tee -a /etc/network/interfaces << END
+ #OVERLAY/NEUTRON
+ auto $neutron
+ iface $neutron inet static
+ address @@SRV_NEUTRON_IP@@
+ netmask 255.255.255.0
+ vlan-raw-device @@SRV_BOND@@
+ mtu @@SRV_MTU@@
+END
+ ifup $neutron
+ if [ $? -eq 0 ]; then
+ echo " Neutron interface Created"
+ else
+ echo " Failed to create Neutron Interface"
+ fi
+fi
+# Creating PXE interface
+
+if [ -n "@@SRV_PXE_INF@@" ]; then
+ echo "Configuring PXE Interface in the server"
+ tee -a /etc/network/interfaces << END
+ #OVERLAY/NEUTRON
+ auto @@SRV_PXE_INF@@
+ iface @@SRV_PXE_INF@@ inet static
+ address @@SRV_PXE_IP@@
+ netmask 255.255.255.0
+ mtu @@SRV_MTU@@
+END
+ ifup @@SRV_PXE_INF@@
+ if [ $? -eq 0 ]; then
+ echo " PXE interface Created"
+ else
+ echo " Failed to create PXE Interface"
+ fi
+fi
exit