Skip to content

Commit 986ecfa

Browse files
authored
CLOUDSTACK-10341: Reduce systemvmtemplate size, install nftables (#2506)
This reduces systemvmtemplate size by 600MB and installs nftables, updates iptables. This also fixes a failing smoke test. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 48e6989 commit 986ecfa

7 files changed

Lines changed: 17 additions & 13 deletions

File tree

test/integration/smoke/test_vpc_redundant.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ def wait_for_vrrp(self):
304304
time.sleep(3 * self.advert_int + 5)
305305

306306
def check_routers_state(self,count=2, status_to_check="MASTER", expected_count=1, showall=False):
307-
vals = ["MASTER", "BACKUP", "UNKNOWN"]
308-
cnts = [0, 0, 0]
307+
vals = ["MASTER", "BACKUP", "UNKNOWN", "FAULT"]
308+
cnts = [0, 0, 0, 0]
309309

310310
self.wait_for_vrrp()
311311

@@ -612,7 +612,8 @@ def test_04_rvpc_network_garbage_collector_nics(self):
612612

613613
time.sleep(total_sleep * 3)
614614

615-
self.check_routers_state(status_to_check="BACKUP", expected_count=2)
615+
# Router will be in FAULT state, i.e. keepalived is stopped
616+
self.check_routers_state(status_to_check="FAULT", expected_count=2)
616617
self.start_vm()
617618
self.check_routers_state(status_to_check="MASTER")
618619

tools/appliance/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function create_definition() {
195195
set +e
196196
if [ ! -z "${version}" ]; then
197197
sed ${sed_regex_option} -i -e "s/^CLOUDSTACK_RELEASE=.+/CLOUDSTACK_RELEASE=${version}/" \
198-
"${appliance_build_name}/configure_systemvm_services.sh"
198+
"${appliance_build_name}/scripts/configure_systemvm_services.sh"
199199
fi
200200
set -e
201201
add_on_exit rm -rf "${appliance_build_name}"

tools/appliance/systemvmtemplate/http/preseed.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,28 @@ d-i partman-auto/disk string /dev/vda
5454
d-i partman-auto/method string regular
5555
d-i partman-auto/expert_recipe string \
5656
boot-root :: \
57-
80 50 160 ext2 \
57+
60 60 60 ext2 \
5858
$primary{ } $bootable{ } \
5959
method{ format } format{ } \
6060
use_filesystem{ } filesystem{ ext2 } \
6161
mountpoint{ /boot } \
6262
. \
63-
1200 40 1600 ext4 \
63+
975 40 1000 ext4 \
6464
method{ format } format{ } \
6565
use_filesystem{ } filesystem{ ext4 } \
6666
mountpoint{ / } \
6767
. \
68-
800 60 800 ext4 \
68+
480 50 700 ext4 \
6969
method{ format } format{ } \
7070
use_filesystem{ } filesystem{ ext4 } \
7171
mountpoint{ /var } \
7272
. \
73-
100 90 200 ext4 \
73+
80 90 100 ext4 \
7474
method{ format } format{ } \
7575
use_filesystem{ } filesystem{ ext4 } \
7676
mountpoint{ /tmp } \
7777
. \
78-
256 100 1024 linux-swap \
78+
256 1000 256 linux-swap \
7979
method{ swap } format{ } \
8080
.
8181

tools/appliance/systemvmtemplate/scripts/apt_upgrade.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set -x
2323
function fix_tune2fs() {
2424
for partition in $(blkid -o list | grep ext | awk '{print $1}')
2525
do
26-
tune2fs -m 1 $partition
26+
tune2fs -m 0 $partition
2727
tune2fs -c 3 $partition
2828
done
2929
fdisk -l
@@ -55,7 +55,6 @@ function apt_upgrade() {
5555
apt-get -q -y update
5656
apt-get -q -y upgrade
5757
apt-get -q -y dist-upgrade
58-
apt-get -y remove --purge linux-image-4.9.0-4-amd64
5958
apt-get -y autoremove --purge
6059
apt-get autoclean
6160
apt-get clean

tools/appliance/systemvmtemplate/scripts/cleanup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ function cleanup_misc() {
6060
# Docs and data files
6161
rm -fr /var/lib/apt/*
6262
rm -fr /var/cache/apt/*
63+
rm -fr /var/cache/debconf/*old
6364
rm -fr /usr/share/doc
6465
rm -fr /usr/share/man
6566
rm -fr /usr/share/info
6667
rm -fr /usr/share/lintian
6768
rm -fr /usr/share/apache2/icons
6869
find /usr/share/locale -type f | grep -v en_US | xargs rm -fr
6970
find /usr/share/zoneinfo -type f | grep -v UTC | xargs rm -fr
71+
rm -fr /tmp/*
7072
}
7173

7274
function cleanup() {

tools/appliance/systemvmtemplate/scripts/install_systemvm_packages.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ function install_packages() {
7272
strongswan libcharon-extra-plugins libstrongswan-extra-plugins \
7373
virt-what open-vm-tools qemu-guest-agent hyperv-daemons
7474

75+
apt-get -q -y -t stretch-backports install nftables
76+
7577
apt-get -y autoremove --purge
76-
apt-get autoclean
7778
apt-get clean
79+
apt-get autoclean
7880

7981
#32 bit architecture support:: not required for 32 bit template
8082
if [ "${arch}" != "i386" ]; then

tools/appliance/systemvmtemplate/template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
[ "-m", "512M" ],
3333
[ "-smp", "cpus=1,maxcpus=1,cores=1" ]
3434
],
35-
"disk_size": 2400,
35+
"disk_size": 1800,
3636
"format": "qcow2",
3737

3838
"disk_interface": "virtio",

0 commit comments

Comments
 (0)