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 89039885bd1205947c3f952d2836eb4f439be371 Author: Rohit Yadav <rohit.ya...@shapeblue.com> AuthorDate: Wed Dec 13 01:42:05 2017 +0530 CLOUDSTACK-10013: Fix VMware related issues This fixes test failures around VMware with the new systemvmtemplate. In addition: - Does not skip rVR related test cases for VMware - Removes rc.local - Processes unprocessed cmd_line.json - Fixed NPEs around VMware tests/code - On VMware, use udevadm to reconfigure nic/mac address than rebooting - Fix proper acpi shutdown script for faster systemvm shutdowns - Give at least 256MB of swap for VRs to avoid OOM on VMware Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com> --- .../com/cloud/vm/VirtualMachineManagerImpl.java | 2 +- server/src/com/cloud/server/StatsCollector.java | 20 +++++++- systemvm/debian/etc/rc.local | 19 -------- systemvm/debian/opt/cloud/bin/cs/CsDhcp.py | 2 +- systemvm/debian/opt/cloud/bin/setup/common.sh | 8 ++-- systemvm/debian/opt/cloud/bin/setup/router.sh | 6 +-- systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh | 7 +-- systemvm/debian/opt/cloud/bin/update_config.py | 6 +++ .../smoke/test_deploy_vm_root_resize.py | 56 +++++++++------------- test/integration/smoke/test_internal_lb.py | 10 ---- test/integration/smoke/test_iso.py | 0 test/integration/smoke/test_list_ids_parameter.py | 0 .../smoke/test_nested_virtualization.py | 0 test/integration/smoke/test_privategw_acl.py | 8 ---- test/integration/smoke/test_routers_network_ops.py | 10 ---- test/integration/smoke/test_ssvm.py | 4 +- test/integration/smoke/test_vm_life_cycle.py | 0 test/integration/smoke/test_vpc_redundant.py | 10 ---- test/integration/smoke/test_vpc_vpn.py | 10 ---- .../systemvmtemplate/configure_acpid.sh | 13 ++--- .../definitions/systemvmtemplate/configure_grub.sh | 2 +- .../systemvmtemplate/install_systemvm_packages.sh | 4 +- .../definitions/systemvmtemplate/preseed.cfg | 6 +-- 23 files changed, 67 insertions(+), 136 deletions(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index 74927b9..50e53e3 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -4743,8 +4743,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac final VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, work.getVmId()); if (vm == null) { s_logger.info("Unable to find vm " + work.getVmId()); + throw new CloudRuntimeException("Unable to find VM id=" + work.getVmId()); } - assert vm != null; orchestrateStop(vm.getUuid(), work.isCleanup()); return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null); diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java index d32ed98..b66fa5f 100644 --- a/server/src/com/cloud/server/StatsCollector.java +++ b/server/src/com/cloud/server/StatsCollector.java @@ -64,6 +64,7 @@ import com.cloud.cluster.ManagementServerHostVO; import com.cloud.cluster.dao.ManagementServerHostDao; import com.cloud.dc.Vlan.VlanType; import com.cloud.dc.VlanVO; +import com.cloud.dc.dao.ClusterDao; import com.cloud.dc.dao.VlanDao; import com.cloud.exception.StorageUnavailableException; import com.cloud.gpu.dao.HostGpuGroupsDao; @@ -92,18 +93,20 @@ import com.cloud.network.as.dao.AutoScaleVmGroupVmMapDao; import com.cloud.network.as.dao.AutoScaleVmProfileDao; import com.cloud.network.as.dao.ConditionDao; import com.cloud.network.as.dao.CounterDao; +import com.cloud.org.Cluster; import com.cloud.resource.ResourceManager; import com.cloud.resource.ResourceState; import com.cloud.service.ServiceOfferingVO; import com.cloud.service.dao.ServiceOfferingDao; import com.cloud.storage.ImageStoreDetailsUtil; +import com.cloud.storage.ScopeType; +import com.cloud.storage.Storage.ImageFormat; import com.cloud.storage.StorageManager; import com.cloud.storage.StorageStats; import com.cloud.storage.VolumeStats; import com.cloud.storage.VolumeVO; import com.cloud.storage.dao.VolumeDao; import com.cloud.user.UserStatisticsVO; -import com.cloud.storage.Storage.ImageFormat; import com.cloud.user.VmDiskStatisticsVO; import com.cloud.user.dao.UserStatisticsDao; import com.cloud.user.dao.VmDiskStatisticsDao; @@ -173,6 +176,8 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc @Inject private HostDao _hostDao; @Inject + private ClusterDao _clusterDao; + @Inject private UserVmDao _userVmDao; @Inject private VolumeDao _volsDao; @@ -916,7 +921,18 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc } } try { - HashMap<String, VolumeStatsEntry> volumeStatsByUuid = _userVmMgr.getVolumeStatistics(pool.getClusterId(), pool.getUuid(), pool.getPoolType(), volumeLocators, StatsTimeout.value()); + Map<String, VolumeStatsEntry> volumeStatsByUuid; + if (pool.getScope() == ScopeType.ZONE) { + volumeStatsByUuid = new HashMap<>(); + for (final Cluster cluster: _clusterDao.listByZoneId(pool.getDataCenterId())) { + final Map<String, VolumeStatsEntry> volumeStatsForCluster = _userVmMgr.getVolumeStatistics(cluster.getId(), pool.getUuid(), pool.getPoolType(), volumeLocators, StatsTimeout.value()); + if (volumeStatsForCluster != null) { + volumeStatsByUuid.putAll(volumeStatsForCluster); + } + } + } else { + volumeStatsByUuid = _userVmMgr.getVolumeStatistics(pool.getClusterId(), pool.getUuid(), pool.getPoolType(), volumeLocators, StatsTimeout.value()); + } if (volumeStatsByUuid != null){ for (final Map.Entry<String, VolumeStatsEntry> entry : volumeStatsByUuid.entrySet()) { if (entry == null || entry.getKey() == null || entry.getValue() == null) { diff --git a/systemvm/debian/etc/rc.local b/systemvm/debian/etc/rc.local deleted file mode 100755 index e419de0..0000000 --- a/systemvm/debian/etc/rc.local +++ /dev/null @@ -1,19 +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. - - diff --git a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py index 6680b94..7a574fa 100755 --- a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py +++ b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py @@ -80,7 +80,7 @@ class CsDhcp(CsDataBag): # DNS search order if gn.get_dns() and device: sline = "dhcp-option=tag:interface-%s-%s,6" % (device, idx) - dns_list = [x for x in gn.get_dns() if x is not None] + dns_list = [x for x in gn.get_dns() if not (not x)] line = "dhcp-option=tag:interface-%s-%s,6,%s" % (device, idx, ','.join(dns_list)) self.conf.search(sline, line) # Gateway diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh index 078cb58..0622e2e 100755 --- a/systemvm/debian/opt/cloud/bin/setup/common.sh +++ b/systemvm/debian/opt/cloud/bin/setup/common.sh @@ -331,14 +331,14 @@ setup_common() { ip route add default via $GW dev $gwdev fi - # a hacking way to activate vSwitch under VMware - ping -n -c 3 $GW & + # Workaround to activate vSwitch under VMware + timeout 3 ping -n -c 3 $GW || true if [ -n "$MGMTNET" -a -n "$LOCAL_GW" ] then - ping -n -c 3 $LOCAL_GW & + timeout 3 ping -n -c 3 $LOCAL_GW || true #This code is added to address ARP issue by pinging MGMT_GW MGMT_GW=$(echo $MGMTNET | awk -F "." '{print $1"."$2"."$3".1"}') - ping -n -c 3 $MGMT_GW & + timeout 3 ping -n -c 3 $MGMT_GW || true fi if [ "$HYPERVISOR" == "vmware" ]; then diff --git a/systemvm/debian/opt/cloud/bin/setup/router.sh b/systemvm/debian/opt/cloud/bin/setup/router.sh index c3141f8..f41e57e 100755 --- a/systemvm/debian/opt/cloud/bin/setup/router.sh +++ b/systemvm/debian/opt/cloud/bin/setup/router.sh @@ -59,10 +59,8 @@ setup_router() { if [ "$oldmd5" != "$newmd5" ] then - log_it "udev NIC assignment requires reboot to take effect" - sync - sleep 2 - reboot + log_it "Reloading udev for new udev NIC assignment" + udevadm control --reload-rules && udevadm trigger fi fi diff --git a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh index 106cfd6..220a2ea 100755 --- a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh +++ b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh @@ -65,11 +65,8 @@ EOF if [ "$HYPERVISOR" == "vmware" ] || [ "$HYPERVISOR" == "hyperv" ]; then ip route add $MGMTNET via $LOCAL_GW dev eth0 - - # a hacking way to activate vSwitch under VMware - ping -n -c 3 $LOCAL_GW & - sleep 3 - pkill ping + # workaround to activate vSwitch under VMware + timeout 3 ping -n -c 3 $LOCAL_GW || true fi fi diff --git a/systemvm/debian/opt/cloud/bin/update_config.py b/systemvm/debian/opt/cloud/bin/update_config.py index 7b86378..c22aea0 100755 --- a/systemvm/debian/opt/cloud/bin/update_config.py +++ b/systemvm/debian/opt/cloud/bin/update_config.py @@ -112,6 +112,12 @@ def is_guestnet_configured(guestnet_dict, keys): return exists +# 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 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 diff --git a/test/integration/smoke/test_deploy_vm_root_resize.py b/test/integration/smoke/test_deploy_vm_root_resize.py old mode 100755 new mode 100644 index 4855099..e23bbce --- a/test/integration/smoke/test_deploy_vm_root_resize.py +++ b/test/integration/smoke/test_deploy_vm_root_resize.py @@ -53,8 +53,8 @@ class TestDeployVmRootSize(cloudstackTestCase): cls.services = cls.testClient.getParsedTestDataConfig() cls.services["mode"] = cls.zone.networktype cls._cleanup = [] + cls.storageID = None cls.updateclone = False - cls.restartreq = False cls.defaultdiskcontroller = "ide" cls.template = get_template(cls.api_client, cls.zone.id) if cls.template == FAILED: @@ -70,7 +70,8 @@ class TestDeployVmRootSize(cloudstackTestCase): list_pool_resp = list_storage_pools(cls.api_client, account=cls.account.name, domainid=cls.domain.id) - #Identify the storage pool type and set vmware fullclone to + + # Identify the storage pool type and set vmware fullclone to # true if storage is VMFS if cls.hypervisor == 'vmware': # please make sure url of templateregister dictionary in @@ -89,26 +90,13 @@ class TestDeployVmRootSize(cloudstackTestCase): value="scsi") cls.updateclone = True - cls.restartreq = True - - list_config_fullclone_global_response = list_configurations( - cls.api_client - , name= - "vmware.create.full.clone") - if list_config_fullclone_global_response[0].value=="false": - Configurations.update(cls.api_client, - "vmware.create.full.clone", - value="true") - - cls.updateclone = True - cls.restartreq = True for strpool in list_pool_resp: if strpool.type.lower() == "vmfs" or strpool.type.lower()== "networkfilesystem": list_config_storage_response = list_configurations( - cls.api_client - , name= - "vmware.create.full.clone",storageid=strpool.id) + cls.api_client, name="vmware.create.full.clone", + storageid=strpool.id) + res = validateList(list_config_storage_response) if res[2]== INVALID_INPUT: raise Exception("Failed to list configurations ") @@ -123,12 +111,16 @@ class TestDeployVmRootSize(cloudstackTestCase): tags="scsi") cls.storageID = strpool.id break - if cls.restartreq: - cls.restartServer() - #Giving 30 seconds to management to warm-up, - #Experienced failures when trying to deploy a VM exactly when management came up - time.sleep(30) + list_config_fullclone_global_response = list_configurations( + cls.api_client, name="vmware.create.full.clone") + + if list_config_fullclone_global_response[0].value=="false": + Configurations.update(cls.api_client, + "vmware.create.full.clone", + value="true") + cls.updateclone = True + #create a service offering cls.service_offering = ServiceOffering.create( @@ -147,21 +139,17 @@ class TestDeployVmRootSize(cloudstackTestCase): if cls.updateclone: Configurations.update(cls.api_client, - "vmware.create.full.clone", - value="false",storageid=cls.storageID) + "vmware.root.disk.controller", + value=cls.defaultdiskcontroller) Configurations.update(cls.api_client, "vmware.create.full.clone", value="false") Configurations.update(cls.api_client, - "vmware.root.disk.controller", - value=cls.defaultdiskcontroller) - StoragePool.update(cls.api_client, id=cls.storageID, - tags="") - cls.restartServer() - - #Giving 30 seconds to management to warm-up, - #Experienced failures when trying to deploy a VM exactly when management came up - time.sleep(30) + "vmware.create.full.clone", + value="false", storageid=cls.storageID) + if cls.storageID: + StoragePool.update(cls.api_client, id=cls.storageID, + tags="") cleanup_resources(cls.api_client, cls._cleanup) except Exception as e: diff --git a/test/integration/smoke/test_internal_lb.py b/test/integration/smoke/test_internal_lb.py index 21a6f40..ba555aa 100644 --- a/test/integration/smoke/test_internal_lb.py +++ b/test/integration/smoke/test_internal_lb.py @@ -50,8 +50,6 @@ from marvin.lib.common import (get_zone, get_test_template, list_network_offerings) -from marvin.lib.decoratorGenerators import skipTestIf - from nose.plugins.attrib import attr import logging @@ -269,12 +267,6 @@ class TestInternalLb(cloudstackTestCase): %s" % (cls.account.name, cls.account.id)) - # Skip rVR related test cases for VMware, for details see - # https://issues.apache.org/jira/browse/CLOUDSTACK-10181 - cls.rvrNotSupported = False - if cls.hypervisor.lower() in ['vmware']: - cls.rvrNotSupported = True - cls._cleanup = [cls.account, cls.compute_offering] return @@ -571,7 +563,6 @@ class TestInternalLb(cloudstackTestCase): self.cleanup.insert(0, vpc_offering) self.execute_internallb_roundrobin_tests(vpc_offering) - @skipTestIf("rvrNotSupported") @attr(tags=["smoke", "advanced"], required_hardware="true") def test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80(self): """ @@ -740,7 +731,6 @@ class TestInternalLb(cloudstackTestCase): self.execute_internallb_haproxy_tests(vpc_offering) - @skipTestIf("rvrNotSupported") @attr(tags=["smoke", "advanced"], required_hardware="true") def test_04_rvpc_internallb_haproxy_stats_on_all_interfaces(self): """ Test to verify access to loadbalancer haproxy admin stats page diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py old mode 100755 new mode 100644 diff --git a/test/integration/smoke/test_list_ids_parameter.py b/test/integration/smoke/test_list_ids_parameter.py old mode 100755 new mode 100644 diff --git a/test/integration/smoke/test_nested_virtualization.py b/test/integration/smoke/test_nested_virtualization.py old mode 100755 new mode 100644 diff --git a/test/integration/smoke/test_privategw_acl.py b/test/integration/smoke/test_privategw_acl.py index 09d3fa4..72c3080 100644 --- a/test/integration/smoke/test_privategw_acl.py +++ b/test/integration/smoke/test_privategw_acl.py @@ -184,12 +184,6 @@ class TestPrivateGwACL(cloudstackTestCase): cls.services["service_offering"]) cls._cleanup = [cls.service_offering] - # Skip rVR related test cases for VMware, for details see - # https://issues.apache.org/jira/browse/CLOUDSTACK-10181 - cls.rvrNotSupported = False - if cls.hypervisor.lower() in ['vmware']: - cls.rvrNotSupported = True - cls.logger = logging.getLogger('TestPrivateGwACL') cls.stream_handler = logging.StreamHandler() cls.logger.setLevel(logging.DEBUG) @@ -297,7 +291,6 @@ class TestPrivateGwACL(cloudstackTestCase): self.performVPCTests(vpc_off, restart_with_cleanup = True) - @skipTestIf("rvrNotSupported") @attr(tags=["advanced"], required_hardware="true") def test_04_rvpc_privategw_static_routes(self): self.logger.debug("Creating a Redundant VPC offering..") @@ -310,7 +303,6 @@ class TestPrivateGwACL(cloudstackTestCase): self.performVPCTests(vpc_off) - @skipTestIf("rvrNotSupported") @attr(tags=["advanced"], required_hardware="true") def _test_05_rvpc_privategw_check_interface(self): self.logger.debug("Creating a Redundant VPC offering..") diff --git a/test/integration/smoke/test_routers_network_ops.py b/test/integration/smoke/test_routers_network_ops.py index c189437..2f122a2 100644 --- a/test/integration/smoke/test_routers_network_ops.py +++ b/test/integration/smoke/test_routers_network_ops.py @@ -88,13 +88,6 @@ class TestRedundantIsolateNetworks(cloudstackTestCase): cls.hypervisor = cls.testClient.getHypervisorInfo() - # Skip rVR related test cases for VMware, for details see - # https://issues.apache.org/jira/browse/CLOUDSTACK-10181 - cls.rvrNotSupported = False - if cls.hypervisor.lower() in ['vmware']: - cls.rvrNotSupported = True - return - cls.template = get_test_template(cls.api_client, cls.zone.id, cls.hypervisor) if cls.template == FAILED: assert False, "get_test_template() failed to return template" @@ -150,9 +143,6 @@ class TestRedundantIsolateNetworks(cloudstackTestCase): return def setUp(self): - if self.rvrNotSupported: - self.skipTest("Redundant VRs are not supported for this hypervisor, skipping test") - self.apiclient = self.testClient.getApiClient() self.cleanup = [] return diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index 41db1ab..f20003b 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -73,7 +73,7 @@ class TestSSVMs(cloudstackTestCase): return list_host_response[0].state == 'Up', None return False, None - res, _ = wait_until(3, self.services["sleep"], checkRunningAgent) + res, _ = wait_until(3, 300, checkRunningAgent) if not res: raise Exception("Failed to wait for SSVM agent to be Up") @@ -99,7 +99,7 @@ class TestSSVMs(cloudstackTestCase): return ssvm_response.state == 'Running', ssvm_response return False, None - res, ssvm_response = wait_until(3, self.services["sleep"], checkRunningState) + res, ssvm_response = wait_until(3, 300, checkRunningState) if not res: self.fail("Failed to reach systemvm state to Running") return ssvm_response diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py old mode 100755 new mode 100644 diff --git a/test/integration/smoke/test_vpc_redundant.py b/test/integration/smoke/test_vpc_redundant.py index e7b29b1..2fde8d9 100644 --- a/test/integration/smoke/test_vpc_redundant.py +++ b/test/integration/smoke/test_vpc_redundant.py @@ -214,13 +214,6 @@ class TestVPCRedundancy(cloudstackTestCase): cls.hypervisor = cls.testClient.getHypervisorInfo() - # Skip rVR related test cases for VMware, for details see - # https://issues.apache.org/jira/browse/CLOUDSTACK-10181 - cls.rvrNotSupported = False - if cls.hypervisor.lower() in ['vmware']: - cls.rvrNotSupported = True - return - cls.template = get_test_template(cls.api_client, cls.zone.id, cls.hypervisor) if cls.template == FAILED: assert False, "get_test_template() failed to return template" @@ -248,9 +241,6 @@ class TestVPCRedundancy(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) def setUp(self): - if self.rvrNotSupported: - self.skipTest("RVR not supported on this hypervisor, skipping") - self.routers = [] self.networks = [] self.ips = [] diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py index 4ab5971..8e1a73d 100644 --- a/test/integration/smoke/test_vpc_vpn.py +++ b/test/integration/smoke/test_vpc_vpn.py @@ -789,13 +789,6 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): cls.hypervisor = testClient.getHypervisorInfo() - # Skip rVR related test cases for VMware, for details see - # https://issues.apache.org/jira/browse/CLOUDSTACK-10181 - cls.rvrNotSupported = False - if cls.hypervisor.lower() in ['vmware']: - cls.rvrNotSupported = True - return - cls.template = get_test_template(cls.apiclient, cls.zone.id, cls.hypervisor) if cls.template == FAILED: assert False, "get_test_template() failed to return template" @@ -896,9 +889,6 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): """Test Site 2 Site VPN Across redundant VPCs""" self.logger.debug("Starting test: test_02_redundant_vpc_site2site_vpn") - if self.rvrNotSupported: - self.skipTest("Hypervisor not supported for rVR, skipping test") - # 0) Get the default network offering for VPC networkOffering = NetworkOffering.list( self.apiclient, name="DefaultIsolatedNetworkOfferingForVpcNetworks") diff --git a/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh b/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh index f246342..6e27eee 100644 --- a/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh +++ b/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh @@ -20,18 +20,11 @@ set -e set -x function configure_acpid() { - grep /usr/local/sbin/power.sh /etc/acpi/events/power && return - mkdir -p /etc/acpi/events - cat >> /etc/acpi/events/power << EOF -event=button/power.* -action=/usr/local/sbin/power.sh "%e" -EOF - cat >> /usr/local/sbin/power.sh << EOF -#!/bin/bash -/sbin/poweroff + cat > /etc/acpi/events/powerbtn <<EOF +event=button[ /]power +action=/sbin/poweroff EOF - chmod a+x /usr/local/sbin/power.sh } return 2>/dev/null || configure_acpid diff --git a/tools/appliance/definitions/systemvmtemplate/configure_grub.sh b/tools/appliance/definitions/systemvmtemplate/configure_grub.sh index 5d80e46..88596f2 100644 --- a/tools/appliance/definitions/systemvmtemplate/configure_grub.sh +++ b/tools/appliance/definitions/systemvmtemplate/configure_grub.sh @@ -20,7 +20,7 @@ set -e set -x function configure_grub() { - cat <<EOF > /etc/default/grub + cat > /etc/default/grub <<EOF # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. diff --git a/tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh b/tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh index b60f908..30ad66d 100644 --- a/tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh +++ b/tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh @@ -53,10 +53,10 @@ function install_packages() { fi ${apt_get} install grub-legacy \ - rsyslog logrotate cron net-tools ifupdown tmux vim netbase iptables \ + rsyslog logrotate cron net-tools ifupdown tmux vim htop netbase iptables \ openssh-server e2fsprogs tcpdump socat wget \ python bzip2 sed gawk diffutils grep gzip less tar telnet ftp rsync traceroute psmisc lsof procps \ - inetutils-ping iputils-arping httping curl \ + inetutils-ping iputils-arping httping curl \ dnsutils zip unzip ethtool uuid file iproute acpid sudo \ sysstat python-netaddr \ apache2 ssl-cert \ diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg index d218172..0f6c265 100644 --- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg +++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg @@ -57,13 +57,13 @@ d-i partman-auto/method string regular d-i partman-auto/choose_recipe select atomic d-i partman-auto/expert_recipe string \ boot-root :: \ - 100 50 200 ext2 \ + 50 50 100 ext2 \ $primary{ } $bootable{ } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext2 } \ mountpoint{ /boot } \ . \ - 1450 40 1600 ext4 \ + 1300 40 1600 ext4 \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext4 } \ mountpoint{ / } \ @@ -78,7 +78,7 @@ d-i partman-auto/expert_recipe string \ use_filesystem{ } filesystem{ ext4 } \ mountpoint{ /tmp } \ . \ - 100 100 1024 linux-swap \ + 256 100 1024 linux-swap \ method{ swap } format{ } \ . -- To stop receiving notification emails like this one, please contact "commits@cloudstack.apache.org" <commits@cloudstack.apache.org>.