You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pa...@apache.org on 2018/12/12 22:11:42 UTC
[cloudstack] 09/18: move changes to postinit
This is an automated email from the ASF dual-hosted git repository.
paul_a pushed a commit to branch 41120-memory
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit f716510bae421d3ba6903796a672fb3d35171082
Author: Paul Angus <pa...@shapeblue.com>
AuthorDate: Fri Nov 30 13:43:41 2018 +0000
move changes to postinit
---
systemvm/debian/opt/cloud/bin/setup/cloud-early-config | 8 --------
systemvm/debian/opt/cloud/bin/setup/postinit.sh | 15 +++++++++++++++
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
index e2428b3..8ba7701 100755
--- a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
+++ b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
@@ -202,14 +202,6 @@ patch() {
cat /mnt/cmdline > $CMDLINE
fi
- # set cache back pressure based on amount of physical memory 100 is default
- physmem=$(free|awk '/^Mem:/{print $2}')
- if [ $((physmem)) -lt 409600 ]; then
- sed -i "/^vm.vfs_cache_pressure/ c\vm.vfs_cache_pressure = 200" /etc/sysctl.conf
- else
- sed -i "/^vm.vfs_cache_pressure/ c\vm.vfs_cache_pressure = 100" /etc/sysctl.conf
- fi
-
return 0
}
diff --git a/systemvm/debian/opt/cloud/bin/setup/postinit.sh b/systemvm/debian/opt/cloud/bin/setup/postinit.sh
index fc92b7e..967e90f 100755
--- a/systemvm/debian/opt/cloud/bin/setup/postinit.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/postinit.sh
@@ -21,6 +21,21 @@
# Eject cdrom if any
eject || true
+# set cache back pressure based on amount of physical memory 100 is default
+physmem=$(free|awk '/^Mem:/{print $2}')
+if [ $((physmem)) -lt 409600 ]; then
+ sed -i "/^vm.vfs_cache_pressure/ c\vm.vfs_cache_pressure = 200" /etc/sysctl.conf
+else
+ sed -i "/^vm.vfs_cache_pressure/ c\vm.vfs_cache_pressure = 100" /etc/sysctl.conf
+fi
+sysctl -p
+
+# HYPERVISOR exported by cloud-early-config
+# stop ntp conflicting with vmtools
+if [ "$HYPERVISOR" == "vmware" ]; then
+ systemctl stop ntpd
+fi
+
# Restart journald for setting changes to apply
systemctl restart systemd-journald