From 7b58c71334a756e84a0450d93d361569e5f795b6 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 24 Nov 2022 14:47:36 +0530 Subject: [PATCH 1/7] systemvm,vpc,vmware: fix management route Signed-off-by: Abhishek Kumar --- systemvm/debian/opt/cloud/bin/setup/common.sh | 15 +++++++++++++++ systemvm/debian/opt/cloud/bin/setup/init.sh | 1 + systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh | 10 +--------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh index 18a78311aeec..8241bcd603f6 100755 --- a/systemvm/debian/opt/cloud/bin/setup/common.sh +++ b/systemvm/debian/opt/cloud/bin/setup/common.sh @@ -576,6 +576,21 @@ setup_vpc_apache2() { setup_apache2_common } +setup_vpc_mgmt_route() { + rule=$MGMTNET via $LOCAL_GW dev eth${1} + if [ -n "$MGMTNET" -a -n "$LOCAL_GW" ] + then + if [ "$HYPERVISOR" == "vmware" ] || [ "$HYPERVISOR" == "hyperv" ]; + then + exist=`ip route show $rule | wc -l` + if [ $exist -eq 0 ] + then + sudo ip route add $rule + fi + fi + fi +} + clean_ipalias_config() { rm -f /etc/apache2/conf.d/ports.*.meta-data.conf rm -f /etc/apache2/sites-available/ipAlias* diff --git a/systemvm/debian/opt/cloud/bin/setup/init.sh b/systemvm/debian/opt/cloud/bin/setup/init.sh index 8b78e5807dab..3aaacdb4015e 100644 --- a/systemvm/debian/opt/cloud/bin/setup/init.sh +++ b/systemvm/debian/opt/cloud/bin/setup/init.sh @@ -189,6 +189,7 @@ setup_interface_sshd() { elif [ "$TYPE" == "vpcrouter" ]; then setup_interface "0" $ETH0_IP $ETH0_MASK $GW + setup_vpc_mgmt_route "0" setup_sshd $ETH0_IP "eth0" elif [ "$TYPE" == "ilbvm" ]; then diff --git a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh index bfb062188254..2ee043f0d126 100755 --- a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh +++ b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh @@ -59,15 +59,7 @@ EOF echo "nameserver $NS2" >> /etc/dnsmasq-resolv.conf echo "nameserver $NS2" >> /etc/resolv.conf fi - if [ -n "$MGMTNET" -a -n "$LOCAL_GW" ] - then - if [ "$HYPERVISOR" == "vmware" ] || [ "$HYPERVISOR" == "hyperv" ]; - then - ip route add $MGMTNET via $LOCAL_GW dev eth0 - # workaround to activate vSwitch under VMware - timeout 3 ping -n -c 3 $LOCAL_GW || true - fi - fi + setup_vpc_mgmt_route "0" ip route delete default # create route table for static route From f5c33a324aca7e924e812eafb1296062084f59fd Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 24 Nov 2022 15:19:40 +0530 Subject: [PATCH 2/7] fix missing command Signed-off-by: Abhishek Kumar --- systemvm/debian/opt/cloud/bin/setup/common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh index 8241bcd603f6..7759d3ff8b3a 100755 --- a/systemvm/debian/opt/cloud/bin/setup/common.sh +++ b/systemvm/debian/opt/cloud/bin/setup/common.sh @@ -586,6 +586,8 @@ setup_vpc_mgmt_route() { if [ $exist -eq 0 ] then sudo ip route add $rule + # workaround to activate vSwitch under VMware + timeout 3 ping -n -c 3 $LOCAL_GW || true fi fi fi From 890a00329b9a368ac41282315f8c44bd428ca6bb Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 5 Dec 2022 15:56:25 +0530 Subject: [PATCH 3/7] fix Signed-off-by: Abhishek Kumar --- systemvm/debian/opt/cloud/bin/setup/common.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh index 7759d3ff8b3a..c163307124c2 100755 --- a/systemvm/debian/opt/cloud/bin/setup/common.sh +++ b/systemvm/debian/opt/cloud/bin/setup/common.sh @@ -577,15 +577,17 @@ setup_vpc_apache2() { } setup_vpc_mgmt_route() { - rule=$MGMTNET via $LOCAL_GW dev eth${1} + log_it "Set up route for management network: $MGMTNET via local gateway: $LOCAL_GW for device eth$1 for hypervisor: $HYPERVISOR" if [ -n "$MGMTNET" -a -n "$LOCAL_GW" ] then + mgmt_route_rule="$MGMTNET via $LOCAL_GW dev eth${1}" if [ "$HYPERVISOR" == "vmware" ] || [ "$HYPERVISOR" == "hyperv" ]; then - exist=`ip route show $rule | wc -l` + exist=`sudo ip route show $mgmt_route_rule | wc -l` if [ $exist -eq 0 ] then - sudo ip route add $rule + log_it "Set up route for management network via local gateway, hypervisor: $HYPERVISOR, rule: $mgmt_route_rule" + sudo ip route add $mgmt_route_rule # workaround to activate vSwitch under VMware timeout 3 ping -n -c 3 $LOCAL_GW || true fi From 68c7ed620effe409a87ed7152e0d42879c3301c4 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Mon, 5 Dec 2022 16:48:59 +0530 Subject: [PATCH 4/7] fix build Signed-off-by: Rohit Yadav --- .../systemvmtemplate/scripts/configure_systemvm_services.sh | 6 +++--- tools/appliance/systemvmtemplate/template.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh b/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh index 115d340fe846..d40cbb895374 100644 --- a/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh +++ b/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh @@ -19,7 +19,7 @@ set -e set -x -CLOUDSTACK_RELEASE=4.17.0 +CLOUDSTACK_RELEASE=4.17.2 function configure_apache2() { # Enable ssl, rewrite and auth @@ -50,10 +50,10 @@ function configure_cacerts() { CDIR=$(pwd) cd /tmp # Add LetsEncrypt ca-cert - wget https://letsencrypt.org/certs/lets-encrypt-r3.der wget https://letsencrypt.org/certs/isrgrootx1.der - keytool -trustcacerts -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt -importcert -alias letsencryptauthorityr3 -file lets-encrypt-r3.der + wget https://letsencrypt.org/certs/lets-encrypt-r3.der keytool -trustcacerts -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt -importcert -alias letsencryptauthorityx1 -file isrgrootx1.der + keytool -trustcacerts -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt -importcert -alias letsencryptauthorityr3 -file lets-encrypt-r3.der rm -f lets-encrypt-r3.der isrgrootx1.der cd $CDIR } diff --git a/tools/appliance/systemvmtemplate/template.json b/tools/appliance/systemvmtemplate/template.json index 960f24a75fff..4ce996b416dd 100644 --- a/tools/appliance/systemvmtemplate/template.json +++ b/tools/appliance/systemvmtemplate/template.json @@ -23,12 +23,12 @@ ], "boot_wait": "5s", "disk_interface": "virtio", - "disk_size": "4000M", + "disk_size": "5000M", "format": "qcow2", "headless": true, "http_directory": "http", - "iso_checksum": "sha512:2810f894afab9ac2631ddd097599761c1481b85e629d6a3197fe1488713af048d37241eb85def681ba86e62b406dd9b891ee1ae7915416335b6bb000d57c1e53", - "iso_url": "https://cdimage.debian.org/debian-cd/11.3.0/amd64/iso-cd/debian-11.3.0-amd64-netinst.iso", + "iso_checksum": "sha512:6a6607a05d57b7c62558e9c462fe5c6c04b9cfad2ce160c3e9140aa4617ab73aff7f5f745dfe51bbbe7b33c9b0e219a022ad682d6c327de0e53e40f079abf66a", + "iso_url": "https://cdimage.debian.org/debian-cd/11.5.0/amd64/iso-cd/debian-11.5.0-amd64-netinst.iso", "net_device": "virtio-net", "output_directory": "../dist", "qemuargs": [ From 2aa3f4cc6db7e03314d37d17c2ff5215ed8dd4c0 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 6 Dec 2022 12:03:42 +0530 Subject: [PATCH 5/7] log message edit Signed-off-by: Abhishek Kumar --- systemvm/debian/opt/cloud/bin/setup/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh index c163307124c2..7b1694c0c219 100755 --- a/systemvm/debian/opt/cloud/bin/setup/common.sh +++ b/systemvm/debian/opt/cloud/bin/setup/common.sh @@ -586,7 +586,7 @@ setup_vpc_mgmt_route() { exist=`sudo ip route show $mgmt_route_rule | wc -l` if [ $exist -eq 0 ] then - log_it "Set up route for management network via local gateway, hypervisor: $HYPERVISOR, rule: $mgmt_route_rule" + log_it "Add route for management network via local gateway, hypervisor: $HYPERVISOR, rule: $mgmt_route_rule" sudo ip route add $mgmt_route_rule # workaround to activate vSwitch under VMware timeout 3 ping -n -c 3 $LOCAL_GW || true From 9b82dfc5c7a25d9c96e47aec48060af682120f01 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 7 Dec 2022 14:15:40 +0530 Subject: [PATCH 6/7] readme fix Signed-off-by: Rohit Yadav --- tools/appliance/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/appliance/README.md b/tools/appliance/README.md index 6d8370fdfa48..09f6fc0221d7 100644 --- a/tools/appliance/README.md +++ b/tools/appliance/README.md @@ -26,7 +26,7 @@ CentOS based built-in user VM template. # Setting up Tools and Environment - Install packer and latest KVM, qemu on a Linux machine -- Install tools for exporting appliances: qemu-img, ovftool, faketime +- Install tools for exporting appliances: qemu-img, ovftool, faketime, sharutils - Build and install `vhd-util` as described in build.sh or use pre-built binaries at: From 8537f4701d561dc03a2ae53a5b335fc468f4770e Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 7 Dec 2022 17:43:19 +0530 Subject: [PATCH 7/7] bump systemvmtemplate version to 4.17.2 Signed-off-by: Rohit Yadav --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b4a1673436bd..3d3ba78a86b5 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ UTF-8 UTF-8 - 4.17.0.0 + 4.17.2.0 apache https://sonarcloud.io