diff --git a/share/pkgs/CentOS/opennebula.sudoers b/share/pkgs/CentOS/opennebula.sudoers index 8d1c48e31f3..daad02fcc9a 100644 --- a/share/pkgs/CentOS/opennebula.sudoers +++ b/share/pkgs/CentOS/opennebula.sudoers @@ -10,5 +10,6 @@ Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_CEPH = /usr/bin/rbd Cmnd_Alias ONE_MARKET = /usr/lib/one/sh/create_container_image.sh Cmnd_Alias ONE_HA = /usr/bin/systemctl start opennebula-flow, /usr/bin/systemctl stop opennebula-flow, /usr/bin/systemctl start opennebula-gate, /usr/bin/systemctl stop opennebula-gate, /usr/sbin/service opennebula-flow start, /usr/sbin/service opennebula-flow stop, /usr/sbin/service opennebula-gate start, /usr/sbin/service opennebula-gate stop +Cmnd_Alias ONE_SYSCTL = /usr/sbin/sysctl vm.compact_memory=1 -oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_CEPH, ONE_MARKET, ONE_HA +oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_CEPH, ONE_MARKET, ONE_HA, ONE_SYSCTL diff --git a/share/pkgs/Debian7/opennebula.sudoers b/share/pkgs/Debian7/opennebula.sudoers index 33f1fa2807c..a50ec8e1f60 100644 --- a/share/pkgs/Debian7/opennebula.sudoers +++ b/share/pkgs/Debian7/opennebula.sudoers @@ -10,5 +10,6 @@ Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_CEPH = /usr/bin/rbd Cmnd_Alias ONE_MARKET = /usr/lib/one/sh/create_container_image.sh Cmnd_Alias ONE_HA = /bin/systemctl start opennebula-flow, /bin/systemctl stop opennebula-flow, /bin/systemctl start opennebula-gate, /bin/systemctl stop opennebula-gate, /usr/sbin/service opennebula-flow start, /usr/sbin/service opennebula-flow stop, /usr/sbin/service opennebula-gate start, /usr/sbin/service opennebula-gate stop +Cmnd_Alias ONE_SYSCTL = /sbin/sysctl vm.compact_memory=1 -oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_CEPH, ONE_MARKET, ONE_HA +oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_CEPH, ONE_MARKET, ONE_HA, ONE_SYSCTL diff --git a/share/pkgs/Debian8/opennebula.sudoers b/share/pkgs/Debian8/opennebula.sudoers index ac2c2485f4c..4ce7d53c694 100644 --- a/share/pkgs/Debian8/opennebula.sudoers +++ b/share/pkgs/Debian8/opennebula.sudoers @@ -10,5 +10,6 @@ Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_CEPH = /usr/bin/rbd Cmnd_Alias ONE_MARKET = /usr/lib/one/sh/create_container_image.sh Cmnd_Alias ONE_HA = /bin/systemctl start opennebula-flow, /bin/systemctl stop opennebula-flow, /bin/systemctl start opennebula-gate, /bin/systemctl stop opennebula-gate, /usr/sbin/service opennebula-flow start, /usr/sbin/service opennebula-flow stop, /usr/sbin/service opennebula-gate start, /usr/sbin/service opennebula-gate stop +Cmnd_Alias ONE_SYSCTL = /sbin/sysctl vm.compact_memory=1 -oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_CEPH, ONE_MARKET, ONE_HA +oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_CEPH, ONE_MARKET, ONE_HA, ONE_SYSCTL diff --git a/share/pkgs/Ubuntu/opennebula.sudoers b/share/pkgs/Ubuntu/opennebula.sudoers index ac2c2485f4c..4ce7d53c694 100644 --- a/share/pkgs/Ubuntu/opennebula.sudoers +++ b/share/pkgs/Ubuntu/opennebula.sudoers @@ -10,5 +10,6 @@ Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_CEPH = /usr/bin/rbd Cmnd_Alias ONE_MARKET = /usr/lib/one/sh/create_container_image.sh Cmnd_Alias ONE_HA = /bin/systemctl start opennebula-flow, /bin/systemctl stop opennebula-flow, /bin/systemctl start opennebula-gate, /bin/systemctl stop opennebula-gate, /usr/sbin/service opennebula-flow start, /usr/sbin/service opennebula-flow stop, /usr/sbin/service opennebula-gate start, /usr/sbin/service opennebula-gate stop +Cmnd_Alias ONE_SYSCTL = /sbin/sysctl vm.compact_memory=1 -oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_CEPH, ONE_MARKET, ONE_HA +oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_CEPH, ONE_MARKET, ONE_HA, ONE_SYSCTL diff --git a/share/pkgs/openSUSE/opennebula.sudoers b/share/pkgs/openSUSE/opennebula.sudoers index 23ba70dc0ff..a2e5d453206 100644 --- a/share/pkgs/openSUSE/opennebula.sudoers +++ b/share/pkgs/openSUSE/opennebula.sudoers @@ -9,5 +9,6 @@ Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_MARKET = /usr/lib/one/sh/create_container_image.sh Cmnd_Alias ONE_HA = /usr/bin/systemctl start opennebula-flow, /usr/bin/systemctl stop opennebula-flow, /usr/bin/systemctl start opennebula-gate, /usr/bin/systemctl stop opennebula-gate, /sbin/service opennebula-flow start, /sbin/service opennebula-flow stop, /sbin/service opennebula-gate start, /sbin/service opennebula-gate stop +Cmnd_Alias ONE_SYSCTL = /usr/sbin/sysctl vm.compact_memory=1 -oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_MARKET, ONE_HA +oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN, ONE_MARKET, ONE_HA, ONE_SYSCTL diff --git a/src/vmm_mad/remotes/kvm/deploy b/src/vmm_mad/remotes/kvm/deploy index 488b6016536..ca23b0bfc2e 100755 --- a/src/vmm_mad/remotes/kvm/deploy +++ b/src/vmm_mad/remotes/kvm/deploy @@ -25,6 +25,10 @@ DEP_FILE_LOCATION=$(dirname $DEP_FILE) mkdir -p $DEP_FILE_LOCATION cat > $DEP_FILE +if [ "x$COMPACT_MEMORY" = "xyes" ]; then + sudo sysctl vm.compact_memory=1 >/dev/null +fi + DATA=`virsh --connect $LIBVIRT_URI create $DEP_FILE` if [ "x$?" = "x0" ]; then diff --git a/src/vmm_mad/remotes/kvm/kvmrc b/src/vmm_mad/remotes/kvm/kvmrc index 8a643324c41..a858c7624c3 100644 --- a/src/vmm_mad/remotes/kvm/kvmrc +++ b/src/vmm_mad/remotes/kvm/kvmrc @@ -26,6 +26,9 @@ export LIBVIRT_MD_KEY=one # Seconds to wait after shutdown until timeout export SHUTDOWN_TIMEOUT=300 +# Uncomment this line to compact memory before running the VM +#export COMPACT_MEMORY=yes + # Uncomment this line to force VM cancellation after shutdown timeout #export FORCE_DESTROY=yes