cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ro...@apache.org
Subject [cloudstack] 23/34: fixes
Date Sat, 16 Dec 2017 06:46:16 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 7ed696aa351a4ff97f3105ad944dbf6c973f2452
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
AuthorDate: Tue Dec 12 10:24:39 2017 +0530

    fixes
    
    Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
---
 .travis.yml                                        | 11 ++---
 .../etc/systemd/system/cloud-postinit.service      |  2 +-
 systemvm/debian/opt/cloud/bin/cs/CsApp.py          |  2 +-
 systemvm/debian/opt/cloud/bin/passwd_server        | 26 ------------
 systemvm/debian/opt/cloud/bin/passwd_server_ip     | 29 -------------
 systemvm/debian/opt/cloud/bin/update_config.py     | 14 +++----
 systemvm/debian/opt/cloud/bin/vpc_passwd_server    | 32 ---------------
 .../opt/cloud/templates/keepalived.conf.templ      |  4 +-
 .../definitions/systemvmtemplate/apt_upgrade.sh    | 13 ++----
 .../definitions/systemvmtemplate/configure_grub.sh |  2 +-
 .../definitions/systemvmtemplate/finalize.sh       |  9 ++++
 tools/marvin/marvin/config/test_data.py            | 48 +++++++++++++++++++++-
 tools/marvin/marvin/lib/common.py                  | 47 +--------------------
 13 files changed, 79 insertions(+), 160 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index a206cbe..b4749c0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -115,8 +115,7 @@ env:
              component/test_acl_sharednetwork_deployVM-impersonation
              component/test_affinity_groups_projects
              component/test_cpu_domain_limits
-             component/test_cpu_limits
-             component/test_volumes"
+             component/test_cpu_limits"
 
     - TESTS="component/test_cpu_max_limits
              component/test_acl_isolatednetwork
@@ -144,10 +143,12 @@ env:
              component/test_snapshots
              component/test_stopped_vm"
 
-    - TESTS="component/test_resource_limits
-             component/test_tags
+    - TESTS="component/test_resource_limits"
+
+    - TESTS="component/test_tags
              component/test_templates
-             component/test_update_vm"
+             component/test_update_vm
+             component/test_volumes"
 
     - TESTS="component/test_vpc
              component/test_vpc_network
diff --git a/systemvm/debian/etc/systemd/system/cloud-postinit.service b/systemvm/debian/etc/systemd/system/cloud-postinit.service
index 83f0636..04f71a3 100644
--- a/systemvm/debian/etc/systemd/system/cloud-postinit.service
+++ b/systemvm/debian/etc/systemd/system/cloud-postinit.service
@@ -11,4 +11,4 @@ WantedBy=multi-user.target
 Type=oneshot
 ExecStart=/opt/cloud/bin/setup/postinit.sh
 RemainAfterExit=true
-TimeoutStartSec=1min
+TimeoutStartSec=5min
diff --git a/systemvm/debian/opt/cloud/bin/cs/CsApp.py b/systemvm/debian/opt/cloud/bin/cs/CsApp.py
index 2085088..031ac05 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsApp.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsApp.py
@@ -66,7 +66,7 @@ class CsApache(CsApp):
 
 class CsPasswdSvc():
     """
-      nohup bash /opt/cloud/bin/vpc_passwd_server $ip >/dev/null 2>&1 &
+      CloudStack VR password server
     """
 
     def __init__(self, ip):
diff --git a/systemvm/debian/opt/cloud/bin/passwd_server b/systemvm/debian/opt/cloud/bin/passwd_server
deleted file mode 100755
index 295e720..0000000
--- a/systemvm/debian/opt/cloud/bin/passwd_server
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-#we have intentionally split the ip gathering command into two.
-#This was done to avoid getting a SIGPIPE during certain load conditions.
-ipInfo=$(ip addr show dev eth0 | grep inet | grep eth0 )
-ips=$(echo "$ipInfo" | awk '{print $2}' ); echo $ips
-for ip in $ips; do
-	addr=$(echo $ip | awk -F'/' '{print $1}')
-	/opt/cloud/bin/passwd_server_ip $addr >> /var/log/cloud.log 2>&1 &
-done;
diff --git a/systemvm/debian/opt/cloud/bin/passwd_server_ip b/systemvm/debian/opt/cloud/bin/passwd_server_ip
deleted file mode 100755
index ce21b53..0000000
--- a/systemvm/debian/opt/cloud/bin/passwd_server_ip
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-addr=$1;
-while true
-do
-    python /opt/cloud/bin/passwd_server_ip.py $addr >/dev/null 2>/dev/null
-    rc=$?
-    if [ $rc -ne 0 ]
-    then
-        logger -t cloud "Password server failed with error code $rc. Restarting it..."
-        sleep 3
-    fi
-done
diff --git a/systemvm/debian/opt/cloud/bin/update_config.py b/systemvm/debian/opt/cloud/bin/update_config.py
index db47c53..b63cd0e 100755
--- a/systemvm/debian/opt/cloud/bin/update_config.py
+++ b/systemvm/debian/opt/cloud/bin/update_config.py
@@ -39,13 +39,6 @@ jsonFilename = sys.argv[1]
 jsonConfigFile = jsonPath % jsonFilename
 currentGuestNetConfig = "/etc/cloudstack/guestnetwork.json"
 
-# If the command line json file is unprocessed process it
-# This is important or, the control interfaces will get deleted!
-if jsonFilename != "cmd_line.json" and os.path.isfile(jsonPath % "cmd_line.json"):
-    qf = QueueFile()
-    qf.setFile("cmd_line.json")
-    qf.load(None)
-
 
 def finish_config():
     # Converge
@@ -124,6 +117,13 @@ if not (os.path.isfile(jsonConfigFile) and os.access(jsonConfigFile,
os.R_OK)):
     print "[ERROR] update_config.py :: Unable to read and access %s to process it" % jsonConfigFile
     sys.exit(1)
 
+# If the command line json file is unprocessed process it
+# This is important or, the control interfaces will get deleted!
+if jsonFilename != "cmd_line.json" and os.path.isfile(jsonPath % "cmd_line.json"):
+    qf = QueueFile()
+    qf.setFile("cmd_line.json")
+    qf.load(None)
+
 # If the guest network is already configured and have the same IP, do not try to configure
it again otherwise it will break
 if jsonFilename.startswith("guest_network.json"):
     if os.path.isfile(currentGuestNetConfig):
diff --git a/systemvm/debian/opt/cloud/bin/vpc_passwd_server b/systemvm/debian/opt/cloud/bin/vpc_passwd_server
deleted file mode 100755
index 3e201cb..0000000
--- a/systemvm/debian/opt/cloud/bin/vpc_passwd_server
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-ip=$1
-result=$ip
-while [ -n "$result" ]
-do
-    python /opt/cloud/bin/passwd_server_ip.py $ip >/dev/null 2>/dev/null
-    rc=$?
-    if [ $rc -ne 0 ]
-    then
-        logger -t cloud "Password server failed with error code $rc. Restarting password
server..."
-        sleep 3
-    fi
-    result=`ip addr show | grep $ip`
-done &
\ No newline at end of file
diff --git a/systemvm/debian/opt/cloud/templates/keepalived.conf.templ b/systemvm/debian/opt/cloud/templates/keepalived.conf.templ
index 722a9e7..5412fd9 100644
--- a/systemvm/debian/opt/cloud/templates/keepalived.conf.templ
+++ b/systemvm/debian/opt/cloud/templates/keepalived.conf.templ
@@ -21,11 +21,11 @@ global_defs {
 
 vrrp_script heartbeat {
     script "[RROUTER_BIN_PATH]/heartbeat.sh"
-    interval 4
+    interval 5
 }
 
 vrrp_instance inside_network {
-    state BACKUP
+    state EQUAL
     interface eth2
     virtual_router_id 51
     nopreempt
diff --git a/tools/appliance/definitions/systemvmtemplate/apt_upgrade.sh b/tools/appliance/definitions/systemvmtemplate/apt_upgrade.sh
index 4a408c3..1a72b3a 100644
--- a/tools/appliance/definitions/systemvmtemplate/apt_upgrade.sh
+++ b/tools/appliance/definitions/systemvmtemplate/apt_upgrade.sh
@@ -19,15 +19,6 @@
 set -e
 set -x
 
-function fix_tune2fs() {
-  for partition in $(blkid -o list | grep ext | awk '{print $1}')
-  do
-    tune2fs -c 1 $partition
-  done
-  fdisk -l
-  df -h
-}
-
 function add_backports() {
   sed -i '/cdrom/d' /etc/apt/sources.list
   sed -i '/deb-src/d' /etc/apt/sources.list
@@ -39,10 +30,12 @@ function apt_upgrade() {
   DEBIAN_FRONTEND=noninteractive
   DEBIAN_PRIORITY=critical
 
+  fdisk -l
+  df -h
+
   # Setup sudo
   echo 'cloud ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/cloud
 
-  fix_tune2fs
   add_backports
 
   rm -fv /root/*.iso
diff --git a/tools/appliance/definitions/systemvmtemplate/configure_grub.sh b/tools/appliance/definitions/systemvmtemplate/configure_grub.sh
index c0a2596..5d80e46 100644
--- a/tools/appliance/definitions/systemvmtemplate/configure_grub.sh
+++ b/tools/appliance/definitions/systemvmtemplate/configure_grub.sh
@@ -28,7 +28,7 @@ GRUB_DEFAULT=0
 GRUB_TIMEOUT=0
 GRUB_DISTRIBUTOR=Debian
 GRUB_CMDLINE_LINUX_DEFAULT=""
-GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 console=hvc0 earlyprintk=xen net.ifnames=0
biosdevname=0 debian-installer=en_US fsck.mode=force nomodeset"
+GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 console=hvc0 earlyprintk=xen net.ifnames=0
biosdevname=0 debian-installer=en_US nomodeset"
 GRUB_CMDLINE_XEN="com1=115200 console=com1"
 GRUB_TERMINAL="console serial"
 GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
diff --git a/tools/appliance/definitions/systemvmtemplate/finalize.sh b/tools/appliance/definitions/systemvmtemplate/finalize.sh
index fb8c8f3..82d17b9 100644
--- a/tools/appliance/definitions/systemvmtemplate/finalize.sh
+++ b/tools/appliance/definitions/systemvmtemplate/finalize.sh
@@ -49,6 +49,14 @@ function cleanup_veewee() {
   rm -fv .veewee_version .veewee_params .vbox_version
 }
 
+# Perform fsck check on every 2nd boot
+function fix_tune2fs() {
+  for partition in $(blkid -o list | grep ext | awk '{print $1}')
+  do
+    tune2fs -c 2 $partition
+  done
+}
+
 # Zero out the free space to save space in the final image:
 function zero_disk() {
   df -h
@@ -65,6 +73,7 @@ function finalize() {
   configure_misc
   configure_sudoers
   cleanup_veewee
+  fix_tune2fs
   sync
   zero_disk
   halt -p
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index b2a969c..d55ea36 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -1,4 +1,4 @@
-#t	 Licensed to the Apache Software Foundation (ASF) under one
+# Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
 # regarding copyright ownership.  The ASF licenses this file
@@ -897,8 +897,54 @@ test_data = {
         "name": "xs",
         "passwordenabled": False,
         "ostype": "CentOS 5.6 (64-bit)"
+    },
 
+    "test_templates": {
+        "kvm": {
+            "name": "tiny-kvm",
+            "displaytext": "tiny kvm",
+            "format": "qcow2",
+            "hypervisor": "kvm",
+            "ostype": "Other Linux (64-bit)",
+            "url": "http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-kvm.qcow2.bz2",
+            "requireshvm": "True",
+            "ispublic": "True",
+            "isextractable": "True"
+        },
+        "xenserver": {
+            "name": "tiny-xen",
+            "displaytext": "tiny xen",
+            "format": "vhd",
+            "hypervisor": "xenserver",
+            "ostype": "Other Linux (64-bit)",
+            "url": "http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-xen.vhd.bz2",
+            "requireshvm": "True",
+            "ispublic": "True",
+            "isextractable": "True"
+        },
+        "hyperv": {
+            "name": "tiny-hyperv",
+            "displaytext": "tiny hyperv",
+            "format": "vhd",
+            "hypervisor": "hyperv",
+            "ostype": "Other Linux (64-bit)",
+            "url": "http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-hyperv.vhd.zip",
+            "requireshvm": "True",
+            "ispublic": "True",
+            "isextractable": "True"
+        },
+        "vmware": {
+            "name": "tiny-vmware",
+            "displaytext": "tiny vmware",
+            "format": "ova",
+            "hypervisor": "vmware",
+            "ostype": "Other Linux (64-bit)",
+            "url": "http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-vmware.ova",
+            "requireshvm": "True",
+            "ispublic": "True"
+        }
     },
+
     "coreos_volume": {
         "diskname": "Volume_core",
         "urlvmware":"http://dl.openvm.eu/cloudstack/coreos/x86_64/coreos_production_cloudstack_image-vmware.ova",
diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py
index 73fdf2a..86203d6 100644
--- a/tools/marvin/marvin/lib/common.py
+++ b/tools/marvin/marvin/lib/common.py
@@ -18,6 +18,7 @@
 """
 
 # Import Local Modules
+from marvin.config.test_data import test_data
 from marvin.cloudstackAPI import (listConfigurations,
                                   listPhysicalNetworks,
                                   listRegions,
@@ -351,51 +352,7 @@ def get_test_template(apiclient, zone_id=None, hypervisor=None):
             is missing it will be download at most one in a zone for a hypervisor.
     @Input : returns a template
     """
-    test_templates = {
-        "kvm": {
-            "name": "tiny-kvm",
-            "displaytext": "tiny kvm",
-            "format": "qcow2",
-            "hypervisor": "kvm",
-            "ostype": "Other Linux (64-bit)",
-            "url": "http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-kvm.qcow2.bz2",
-            "requireshvm": "True",
-            "ispublic": "True",
-            "isextractable": "True"
-        },
-        "xenserver": {
-            "name": "tiny-xen",
-            "displaytext": "tiny xen",
-            "format": "vhd",
-            "hypervisor": "xenserver",
-            "ostype": "Other Linux (64-bit)",
-            "url": "http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-xen.vhd.bz2",
-            "requireshvm": "True",
-            "ispublic": "True",
-            "isextractable": "True"
-        },
-        "hyperv": {
-            "name": "tiny-hyperv",
-            "displaytext": "tiny hyperv",
-            "format": "vhd",
-            "hypervisor": "hyperv",
-            "ostype": "Other Linux (64-bit)",
-            "url": "http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-hyperv.vhd.zip",
-            "requireshvm": "True",
-            "ispublic": "True",
-            "isextractable": "True"
-        },
-        "vmware": {
-            "name": "tiny-vmware",
-            "displaytext": "tiny vmware",
-            "format": "ova",
-            "hypervisor": "vmware",
-            "ostype": "Other Linux (64-bit)",
-            "url": "http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-vmware.ova",
-            "requireshvm": "True",
-            "ispublic": "True"
-        }
-    }
+    test_templates = test_data["test_templates"]
 
     if hypervisor is None:
         return FAILED

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

Mime
View raw message