cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [cloudstack] branch debian9-systemvmtemplate updated: make systemvms faster and better
Date Fri, 24 Nov 2017 16:34:39 GMT
This is an automated email from the ASF dual-hosted git repository.

bhaisaab pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/debian9-systemvmtemplate by this push:
     new ee6e66b  make systemvms faster and better
ee6e66b is described below

commit ee6e66b69a194c9349018667a2f61d64da885316
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
AuthorDate: Fri Nov 24 22:04:07 2017 +0530

    make systemvms faster and better
    
    Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
---
 systemvm/conf/log4j-cloud.xml                      |  2 --
 .../debian/config/etc/init.d/cloud-early-config    |  9 +++---
 .../debian/config/opt/cloud/bin/setup/common.sh    | 34 +---------------------
 .../config/opt/cloud/bin/setup/consoleproxy.sh     |  6 ++--
 .../config/opt/cloud/bin/setup/secstorage.sh       | 21 ++++++++-----
 systemvm/scripts/_run.sh                           |  1 -
 .../configure_systemvm_services.sh                 |  1 +
 7 files changed, 23 insertions(+), 51 deletions(-)

diff --git a/systemvm/conf/log4j-cloud.xml b/systemvm/conf/log4j-cloud.xml
index 6ad0828..b32bb57 100644
--- a/systemvm/conf/log4j-cloud.xml
+++ b/systemvm/conf/log4j-cloud.xml
@@ -17,9 +17,7 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
-<xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
 
    <!-- ================================= -->
diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
index 5c16c9f..dc0b575 100755
--- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config
+++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
@@ -60,10 +60,8 @@ config_guest() {
   if [ "$HYPERVISOR" == "kvm" ]
   then
     # Configure hot-plug
-    sed -i -e "/acpiphp/d" /etc/modules
-    sed -i -e "/pci_hotplug/d" /etc/modules
-    echo acpiphp >> /etc/modules
-    echo pci_hotplug >> /etc/modules
+    modprobe acpiphp || true
+    modprobe pci_hotplug || true
     # Configure serial console FIXME: remove during build we enable it?
     #sed -i -e "/^serial.*/d" /boot/grub/grub.conf
     #sed -i -e "/^terminal.*/d" /boot/grub/grub.conf
@@ -183,7 +181,6 @@ patch() {
 
   if [ -n "$cdrom_dev" ]; then
     mount -o ro $cdrom_dev $PATCH_MOUNT
-    [ -f $privkey ] && cp -f $privkey /root/.ssh/ && chmod go-rwx /root/.ssh/authorized_keys
     local oldmd5=
     [ -f ${md5file} ] && oldmd5=$(cat ${md5file})
     local newmd5=
@@ -202,6 +199,8 @@ patch() {
     umount $PATCH_MOUNT
   fi
 
+  [ -f $privkey ] && cp -f $privkey /root/.ssh/ && chmod go-rwx /root/.ssh/authorized_keys
+
   if [ -f /mnt/cmdline ]; then
     cat /mnt/cmdline > $CMDLINE
   fi
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/common.sh b/systemvm/patches/debian/config/opt/cloud/bin/setup/common.sh
index 7f9cc71..e6bfa0c 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/setup/common.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/setup/common.sh
@@ -74,7 +74,6 @@ setup_interface() {
   local intf=eth${intfnum}
   local bootproto="static"
 
-
   if [ "$BOOTPROTO" == "dhcp" ]
   then
     if [ "$intfnum" != "0" ]
@@ -106,28 +105,6 @@ setup_interface() {
       if [ "$RROUTER" != "1" -o "$1" != "2" ]
       then
           ifup $intf
-          timer=0
-          log_it "checking that $intf has IP "
-          while true
-          do
-              ip=$(ifconfig $intf | grep "inet addr:" | awk '{print $2}' | awk -F: '{print
$2}')
-              if [ -z $ip ]
-              then
-                  sleep 1;
-                  #waiting for the interface to setup with ip
-                  log_it "waiting for $intf interface setup with ip timer=$timer"
-              else
-                  break
-              fi
-
-              if [ $timer -gt 15 ]
-              then
-                  log_it  "interface $intf is not set up with ip... exiting";
-                  break
-              fi
-
-              timer=`expr $timer + 1`
-          done
       fi
   fi
 }
@@ -352,24 +329,16 @@ setup_common() {
     fi
 
     ip route add default via $GW dev $gwdev
-
   fi
 
   # a hacking way to activate vSwitch under VMware
   ping -n -c 3 $GW &
-  sleep 3
-  pkill ping
   if [ -n "$MGMTNET"  -a -n "$LOCAL_GW" ]
   then
       ping -n -c 3 $LOCAL_GW &
-      sleep 3
-      pkill ping
       #This code is added to address ARP issue by pinging MGMT_GW
       MGMT_GW=$(echo $MGMTNET | awk -F "." '{print $1"."$2"."$3".1"}')
       ping -n -c 3 $MGMT_GW &
-      sleep 3
-      pkill ping
-
   fi
 
   if [ "$HYPERVISOR" == "vmware" ]; then
@@ -503,7 +472,6 @@ setup_sshd(){
   [ -f /etc/ssh/sshd_config ] && sed -i -e "s/^[#]*ListenAddress.*$/ListenAddress
$ip/" /etc/ssh/sshd_config
   sed -i "/3922/s/eth./$eth/" /etc/iptables/rules.v4
   sed -i "/3922/s/eth./$eth/" /etc/iptables/rules
-  systemctl restart sshd
 }
 
 setup_vpc_apache2() {
@@ -611,7 +579,7 @@ setup_ntp() {
             fi
             sed -i "0,/^server/s//$PATTERN\nserver/" $NTP_CONF_FILE
         done
-        systemctl restart ntp
+        systemctl enable ntp
     else
         log_it "NTP configuration file not found"
     fi
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/consoleproxy.sh b/systemvm/patches/debian/config/opt/cloud/bin/setup/consoleproxy.sh
index fb36335..adaf5c9 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/setup/consoleproxy.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/setup/consoleproxy.sh
@@ -27,8 +27,8 @@ consoleproxy_svcs() {
    systemctl disable --now keepalived
    systemctl disable --now nfs-common
    systemctl disable --now portmap
-   systemctl enable --now postinit
-   systemctl enable --now ssh
+   systemctl enable postinit
+   systemctl enable ssh
    echo "cloud postinit ssh" > /var/cache/cloud/enabled_svcs
    echo "cloud-passwd-srvr haproxy dnsmasq apache2 nfs-common portmap" > /var/cache/cloud/disabled_svcs
    mkdir -p /var/log/cloud
@@ -54,7 +54,7 @@ setup_console_proxy() {
   disable_rpfilter
   enable_fwding 0
   enable_irqbalance 0
-  rm /etc/logrotate.d/cloud
+  rm -f /etc/logrotate.d/cloud
 }
 
 consoleproxy_svcs
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/secstorage.sh b/systemvm/patches/debian/config/opt/cloud/bin/setup/secstorage.sh
index 482cd94..7c4ae63 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/setup/secstorage.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/setup/secstorage.sh
@@ -24,10 +24,10 @@ secstorage_svcs() {
    systemctl disable --now dnsmasq
    systemctl disable --now haproxy
    systemctl disable --now keepalived
-   systemctl enable --now nfs-common
-   systemctl enable --now portmap
-   systemctl enable --now postinit
-   systemctl enable --now ssh
+   systemctl enable nfs-common
+   systemctl enable portmap
+   systemctl enable postinit
+   systemctl enable ssh
    echo "cloud postinit ssh nfs-common portmap" > /var/cache/cloud/enabled_svcs
    echo "cloud-passwd-srvr haproxy dnsmasq" > /var/cache/cloud/disabled_svcs
    mkdir -p /var/log/cloud
@@ -40,17 +40,24 @@ setup_secstorage() {
   setup_common eth0 eth1 eth2
   setup_storage_network
   setup_system_rfc1918_internal
+
+  log_it "Setting up entry in hosts"
   sed -i  /gateway/d /etc/hosts
   public_ip=`getPublicIp`
   echo "$public_ip $NAME" >> /etc/hosts
 
+  log_it "Applying iptables rules"
   cp /etc/iptables/iptables-secstorage /etc/iptables/rules.v4
   cp /etc/iptables/iptables-secstorage /etc/iptables/rules
+
+  log_it "Configuring sshd"
   if [ "$hyp" == "vmware" ] || [ "$hyp" == "hyperv" ]; then
     setup_sshd $ETH1_IP "eth1"
   else
     setup_sshd $ETH0_IP "eth0"
   fi
+
+  log_it "Configuring apache2"
   setup_apache2 $ETH2_IP
 
   # Deprecated, should move to Cs Python all of it
@@ -60,7 +67,7 @@ setup_secstorage() {
     -e "s/Listen .*:443/Listen $ETH2_IP:443/g" \
     -e "s/NameVirtualHost .*:80/NameVirtualHost $ETH2_IP:80/g" /etc/apache2/vhost.template
> /etc/apache2/sites-enabled/vhost-${ETH2_IP}.conf
 
-  log_it "setting up apache2 for post upload of volume/template"
+  log_it "Setting up apache2 for post upload of volume/template"
   a2enmod proxy
   a2enmod proxy_http
   a2enmod headers
@@ -78,9 +85,9 @@ CORS
   disable_rpfilter
   enable_fwding 0
 
-  systemctl enable --now cloud apache2
+  systemctl enable cloud apache2
   enable_irqbalance 0
-  rm /etc/logrotate.d/cloud
+  rm -f /etc/logrotate.d/cloud
   setup_ntp
 }
 
diff --git a/systemvm/scripts/_run.sh b/systemvm/scripts/_run.sh
index 7808ec9..96cc88b 100755
--- a/systemvm/scripts/_run.sh
+++ b/systemvm/scripts/_run.sh
@@ -24,7 +24,6 @@ rm -f console-proxy.jar
 rm -f console-common.jar
 rm -f conf/cloud.properties
 
-
 CP="./:./conf:$(ls *.jar | tr '\n' ':' | sed s'/.$//')"
 
 keyvalues=
diff --git a/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh b/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
index b72b94a..6f0f5a3 100644
--- a/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
+++ b/tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
@@ -147,6 +147,7 @@ function configure_services() {
   systemctl daemon-reload
   systemctl disable apt-daily.service
   systemctl disable apt-daily.timer
+  systemctl disable apt-daily-upgrade.timer
 
   # Disable services that slow down boot and are not used anyway
   systemctl disable apache2

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].

Mime
View raw message