You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2016/11/02 17:43:13 UTC

[1/6] git commit: updated refs/heads/master to 0a2798c

Repository: cloudstack
Updated Branches:
  refs/heads/master f7733b4a0 -> 0a2798c6b


CLOUDSTACK-9509: Host Connects Without Storage

KVM hosts on shared storage failure was accepted by mgmt server with the
host state as Up, even though there was no primary/shared storage available on
it. This patch offers a quick fix by throwing an exception in the storage monitor
which connects storage pool on host. The failure is trapped by agent manager
that disconnects the agent without any investigation.

Based on Lab tests, KVM agent may take upto 2 minutes to attempt NFS mount when
the storage is inaccessible (firewalled, or shutdown) before returning back with
an error. It is safe to assume that this won't add pressure on mgmt server due to
several reconnection attempts, and KVM agent would retry reconnection every 2
minutes.

For such KVM hosts, where failure happens due to storage issues; they will be
briefly put in Alert state but will be mostly be in Connecting state during which
the KVM host attempts to mount/reconfigure NFS storage pool.

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/32a397aa
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/32a397aa
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/32a397aa

Branch: refs/heads/master
Commit: 32a397aa9357c409de7561a8c68a469c3bf3c52a
Parents: a664e03
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Tue Jun 7 15:11:16 2016 +0900
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Oct 21 10:22:32 2016 +0530

----------------------------------------------------------------------
 .../agent/manager/AgentManagerImplTest.java     | 86 ++++++++++++++++++++
 .../storage/listener/StoragePoolMonitor.java    |  6 +-
 .../listener/StoragePoolMonitorTest.java        | 80 ++++++++++++++++++
 3 files changed, 170 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/32a397aa/engine/orchestration/test/com/cloud/agent/manager/AgentManagerImplTest.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/test/com/cloud/agent/manager/AgentManagerImplTest.java b/engine/orchestration/test/com/cloud/agent/manager/AgentManagerImplTest.java
new file mode 100644
index 0000000..03044c5
--- /dev/null
+++ b/engine/orchestration/test/com/cloud/agent/manager/AgentManagerImplTest.java
@@ -0,0 +1,86 @@
+// 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.
+package com.cloud.agent.manager;
+
+import com.cloud.agent.Listener;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.ReadyCommand;
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.StartupRoutingCommand;
+import com.cloud.exception.ConnectionException;
+import com.cloud.host.HostVO;
+import com.cloud.host.Status;
+import com.cloud.host.dao.HostDao;
+import com.cloud.utils.Pair;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import java.util.ArrayList;
+
+public class AgentManagerImplTest {
+
+    private HostDao hostDao;
+    private Listener storagePoolMonitor;
+    private AgentAttache attache;
+    private AgentManagerImpl mgr = Mockito.spy(new AgentManagerImpl());
+    private HostVO host;
+    private StartupCommand[] cmds;
+
+    @Before
+    public void setUp() throws Exception {
+        host = new HostVO("some-Uuid");
+        host.setDataCenterId(1L);
+        cmds = new StartupCommand[]{new StartupRoutingCommand()};
+        attache = new ConnectedAgentAttache(null, 1L, "kvm-attache", null, false);
+
+        hostDao = Mockito.mock(HostDao.class);
+        storagePoolMonitor = Mockito.mock(Listener.class);
+
+        mgr._hostDao = hostDao;
+        mgr._hostMonitors = new ArrayList<>();
+        mgr._hostMonitors.add(new Pair<>(0, storagePoolMonitor));
+    }
+
+    @Test
+    public void testNotifyMonitorsOfConnectionNormal() throws ConnectionException {
+        Mockito.when(hostDao.findById(Mockito.anyLong())).thenReturn(host);
+        Mockito.doNothing().when(storagePoolMonitor).processConnect(Mockito.eq(host), Mockito.eq(cmds[0]), Mockito.eq(false));
+        Mockito.doReturn(true).when(mgr).handleDisconnectWithoutInvestigation(Mockito.any(attache.getClass()), Mockito.any(Status.Event.class), Mockito.anyBoolean(), Mockito.anyBoolean());
+        Mockito.doReturn(Mockito.mock(Answer.class)).when(mgr).easySend(Mockito.anyLong(), Mockito.any(ReadyCommand.class));
+        Mockito.doReturn(true).when(mgr).agentStatusTransitTo(Mockito.eq(host), Mockito.eq(Status.Event.Ready), Mockito.anyLong());
+
+        final AgentAttache agentAttache = mgr.notifyMonitorsOfConnection(attache, cmds, false);
+        Assert.assertTrue(agentAttache.isReady()); // Agent is in UP state
+    }
+
+    @Test
+    public void testNotifyMonitorsOfConnectionWhenStoragePoolConnectionHostFailure() throws ConnectionException {
+        ConnectionException connectionException = new ConnectionException(true, "storage pool could not be connected on host");
+        Mockito.when(hostDao.findById(Mockito.anyLong())).thenReturn(host);
+        Mockito.doThrow(connectionException).when(storagePoolMonitor).processConnect(Mockito.eq(host), Mockito.eq(cmds[0]), Mockito.eq(false));
+        Mockito.doReturn(true).when(mgr).handleDisconnectWithoutInvestigation(Mockito.any(attache.getClass()), Mockito.any(Status.Event.class), Mockito.anyBoolean(), Mockito.anyBoolean());
+        try {
+            mgr.notifyMonitorsOfConnection(attache, cmds, false);
+            Assert.fail("Connection Exception was expected");
+        } catch (ConnectionException e) {
+            Assert.assertEquals(e.getMessage(), connectionException.getMessage());
+        }
+        Mockito.verify(mgr, Mockito.times(1)).handleDisconnectWithoutInvestigation(Mockito.any(attache.getClass()), Mockito.eq(Status.Event.AgentDisconnected), Mockito.eq(true), Mockito.eq(true));
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/32a397aa/server/src/com/cloud/storage/listener/StoragePoolMonitor.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/listener/StoragePoolMonitor.java b/server/src/com/cloud/storage/listener/StoragePoolMonitor.java
index ad65bd6..286d994 100644
--- a/server/src/com/cloud/storage/listener/StoragePoolMonitor.java
+++ b/server/src/com/cloud/storage/listener/StoragePoolMonitor.java
@@ -99,12 +99,14 @@ public class StoragePoolMonitor implements Listener {
                     }
 
                     Long hostId = host.getId();
-                    s_logger.debug("Host " + hostId + " connected, sending down storage pool information ...");
+                    if (s_logger.isDebugEnabled()) {
+                        s_logger.debug("Host " + hostId + " connected, connecting host to shared pool id " + pool.getId() + " and sending storage pool information ...");
+                    }
                     try {
                         _storageManager.connectHostToSharedPool(hostId, pool.getId());
                         _storageManager.createCapacityEntry(pool.getId());
                     } catch (Exception e) {
-                        s_logger.warn("Unable to connect host " + hostId + " to pool " + pool + " due to " + e.toString(), e);
+                        throw new ConnectionException(true, "Unable to connect host " + hostId + " to storage pool id " + pool.getId() + " due to " + e.toString(), e);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/32a397aa/server/test/com/cloud/storage/listener/StoragePoolMonitorTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/storage/listener/StoragePoolMonitorTest.java b/server/test/com/cloud/storage/listener/StoragePoolMonitorTest.java
new file mode 100644
index 0000000..06733f4
--- /dev/null
+++ b/server/test/com/cloud/storage/listener/StoragePoolMonitorTest.java
@@ -0,0 +1,80 @@
+// 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.
+package com.cloud.storage.listener;
+
+import com.cloud.agent.api.StartupRoutingCommand;
+import com.cloud.exception.ConnectionException;
+import com.cloud.exception.StorageUnavailableException;
+import com.cloud.host.HostVO;
+import com.cloud.hypervisor.Hypervisor;
+import com.cloud.storage.ScopeType;
+import com.cloud.storage.StorageManagerImpl;
+import com.cloud.storage.StoragePoolStatus;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import java.util.Collections;
+
+public class StoragePoolMonitorTest {
+
+    private StorageManagerImpl storageManager;
+    private PrimaryDataStoreDao poolDao;
+    private StoragePoolMonitor storagePoolMonitor;
+    private HostVO host;
+    private StoragePoolVO pool;
+    private StartupRoutingCommand cmd;
+
+    @Before
+    public void setUp() throws Exception {
+        storageManager = Mockito.mock(StorageManagerImpl.class);
+        poolDao = Mockito.mock(PrimaryDataStoreDao.class);
+
+        storagePoolMonitor = new StoragePoolMonitor(storageManager, poolDao);
+        host = new HostVO("some-uuid");
+        pool = new StoragePoolVO();
+        pool.setScope(ScopeType.CLUSTER);
+        pool.setStatus(StoragePoolStatus.Up);
+        pool.setId(123L);
+        cmd = new StartupRoutingCommand();
+        cmd.setHypervisorType(Hypervisor.HypervisorType.KVM);
+    }
+
+    @Test
+    public void testProcessConnectStoragePoolNormal() throws Exception {
+        Mockito.when(poolDao.listBy(Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(), Mockito.any(ScopeType.class))).thenReturn(Collections.singletonList(pool));
+        Mockito.when(poolDao.findZoneWideStoragePoolsByTags(Mockito.anyLong(), Mockito.any(String[].class))).thenReturn(Collections.<StoragePoolVO>emptyList());
+        Mockito.when(poolDao.findZoneWideStoragePoolsByHypervisor(Mockito.anyLong(), Mockito.any(Hypervisor.HypervisorType.class))).thenReturn(Collections.<StoragePoolVO>emptyList());
+
+        storagePoolMonitor.processConnect(host, cmd, false);
+
+        Mockito.verify(storageManager, Mockito.times(1)).connectHostToSharedPool(Mockito.eq(host.getId()), Mockito.eq(pool.getId()));
+        Mockito.verify(storageManager, Mockito.times(1)).createCapacityEntry(Mockito.eq(pool.getId()));
+    }
+
+    @Test(expected = ConnectionException.class)
+    public void testProcessConnectStoragePoolFailureOnHost() throws Exception {
+        Mockito.when(poolDao.listBy(Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(), Mockito.any(ScopeType.class))).thenReturn(Collections.singletonList(pool));
+        Mockito.when(poolDao.findZoneWideStoragePoolsByTags(Mockito.anyLong(), Mockito.any(String[].class))).thenReturn(Collections.<StoragePoolVO>emptyList());
+        Mockito.when(poolDao.findZoneWideStoragePoolsByHypervisor(Mockito.anyLong(), Mockito.any(Hypervisor.HypervisorType.class))).thenReturn(Collections.<StoragePoolVO>emptyList());
+        Mockito.doThrow(new StorageUnavailableException("unable to mount storage", 123L)).when(storageManager).connectHostToSharedPool(Mockito.anyLong(), Mockito.anyLong());
+
+        storagePoolMonitor.processConnect(host, cmd, false);
+    }
+}
\ No newline at end of file


[5/6] git commit: updated refs/heads/master to 0a2798c

Posted by bh...@apache.org.
Merge pull request #1728 from shapeblue/4.9_9551

CLOUDSTACK-9551: Move java tmp dir to cloudstack-agent's path to avoidMove java tmp dir to cloudstack-agent's path to avoid noexec on /tmp

* pr/1728:
  CLOUDSTACK-9551: Move java tmp dir to cloudstack-agent's path to avoid noexec on /tmp

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b75e6958
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b75e6958
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b75e6958

Branch: refs/heads/master
Commit: b75e6958150f76a0c8f9cbfa24301da2d7cd2c6a
Parents: 1995134 bd85e5b
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Wed Nov 2 23:04:04 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Wed Nov 2 23:10:39 2016 +0530

----------------------------------------------------------------------
 packaging/centos63/cloud-agent.rc          | 6 +++++-
 packaging/centos7/cloud-agent.rc           | 6 +++++-
 packaging/debian/cloudstack-agent.init     | 6 +++++-
 packaging/systemd/cloudstack-agent.default | 1 +
 packaging/systemd/cloudstack-agent.service | 3 ++-
 5 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b75e6958/packaging/centos7/cloud-agent.rc
----------------------------------------------------------------------
diff --cc packaging/centos7/cloud-agent.rc
index 6cc6abc,6cc6abc..aad9582
--- a/packaging/centos7/cloud-agent.rc
+++ b/packaging/centos7/cloud-agent.rc
@@@ -26,6 -26,6 +26,7 @@@
  
  # set environment variables
  
++TMP=/usr/share/cloudstack-agent/tmp
  SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//')
  PIDFILE=/var/run/"$SHORTNAME".pid
  LOCKFILE=/var/lock/subsys/"$SHORTNAME"
@@@ -41,6 -41,6 +42,9 @@@ if [ -z "$JSVC" ]; the
      exit 1;
  fi
  
++# create java tmp dir if not found
++mkdir -m 0755 -p "$TMP"
++
  unset OPTIONS
  [ -r /etc/sysconfig/"$SHORTNAME" ] && source /etc/sysconfig/"$SHORTNAME"
  
@@@ -64,7 -64,7 +68,7 @@@ export CLASSPATH="/usr/share/java/commo
  start() {
      echo -n $"Starting $PROGNAME: "
      if hostname --fqdn >/dev/null 2>&1 ; then
--        $JSVC -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \
++        $JSVC -Djava.io.tmpdir="$TMP" -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \
              -errfile $LOGDIR/cloudstack-agent.err -outfile $LOGDIR/cloudstack-agent.out $CLASS
          RETVAL=$?
          echo

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b75e6958/packaging/systemd/cloudstack-agent.default
----------------------------------------------------------------------
diff --cc packaging/systemd/cloudstack-agent.default
index 659d715,659d715..41fa85b
--- a/packaging/systemd/cloudstack-agent.default
+++ b/packaging/systemd/cloudstack-agent.default
@@@ -19,3 -19,3 +19,4 @@@ JAVA=/usr/bin/jav
  JAVA_HEAP_INITIAL=256m
  JAVA_HEAP_MAX=2048m
  JAVA_CLASS=com.cloud.agent.AgentShell
++JAVA_TMPDIR=/usr/share/cloudstack-agent/tmp

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b75e6958/packaging/systemd/cloudstack-agent.service
----------------------------------------------------------------------
diff --cc packaging/systemd/cloudstack-agent.service
index dd1560c,dd1560c..92ff965
--- a/packaging/systemd/cloudstack-agent.service
+++ b/packaging/systemd/cloudstack-agent.service
@@@ -27,7 -27,7 +27,8 @@@ EnvironmentFile=-/etc/default/cloudstac
  ExecStart=/bin/sh -ec '\
      export ACP=`ls /usr/share/cloudstack-agent/lib/*.jar /usr/share/cloudstack-agent/plugins/*.jar 2>/dev/null|tr "\\n" ":"`; \
      export CLASSPATH="$ACP:/etc/cloudstack/agent:/usr/share/cloudstack-common/scripts"; \
--    ${JAVA} -Xms${JAVA_HEAP_INITIAL} -Xmx${JAVA_HEAP_MAX} -cp "$CLASSPATH" $JAVA_CLASS'
++    mkdir -m 0755 -p ${JAVA_TMPDIR} \
++    ${JAVA} -Djava.io.tmpdir="${JAVA_TMPDIR}" -Xms${JAVA_HEAP_INITIAL} -Xmx${JAVA_HEAP_MAX} -cp "$CLASSPATH" $JAVA_CLASS'
  Restart=always
  RestartSec=10s
  


[4/6] git commit: updated refs/heads/master to 0a2798c

Posted by bh...@apache.org.
Merge branch '4.8' into 4.9


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/19951346
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/19951346
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/19951346

Branch: refs/heads/master
Commit: 19951346ad7fafb9daa421989af34c2b6d46ee09
Parents: 305400b 68f22e2
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Wed Nov 2 23:03:31 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Wed Nov 2 23:03:31 2016 +0530

----------------------------------------------------------------------
 .../agent/manager/AgentManagerImplTest.java     | 86 ++++++++++++++++++++
 .../storage/listener/StoragePoolMonitor.java    |  6 +-
 .../listener/StoragePoolMonitorTest.java        | 80 ++++++++++++++++++
 3 files changed, 170 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/19951346/server/src/com/cloud/storage/listener/StoragePoolMonitor.java
----------------------------------------------------------------------


[2/6] git commit: updated refs/heads/master to 0a2798c

Posted by bh...@apache.org.
CLOUDSTACK-9551: Move java tmp dir to cloudstack-agent's path to avoid
noexec on /tmp


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bd85e5b4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bd85e5b4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bd85e5b4

Branch: refs/heads/master
Commit: bd85e5b4da0be5177f7fd766641c75dabaf9c45d
Parents: 9a8841d
Author: Abhinandan Prateek <ab...@shapeblue.com>
Authored: Thu Oct 20 11:07:52 2016 +0530
Committer: Abhinandan Prateek <ap...@apache.org>
Committed: Tue Oct 25 10:55:56 2016 +0530

----------------------------------------------------------------------
 packaging/centos63/cloud-agent.rc      | 6 +++++-
 packaging/debian/cloudstack-agent.init | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bd85e5b4/packaging/centos63/cloud-agent.rc
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud-agent.rc b/packaging/centos63/cloud-agent.rc
index 6cc6abc..aad9582 100755
--- a/packaging/centos63/cloud-agent.rc
+++ b/packaging/centos63/cloud-agent.rc
@@ -26,6 +26,7 @@
 
 # set environment variables
 
+TMP=/usr/share/cloudstack-agent/tmp
 SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//')
 PIDFILE=/var/run/"$SHORTNAME".pid
 LOCKFILE=/var/lock/subsys/"$SHORTNAME"
@@ -41,6 +42,9 @@ if [ -z "$JSVC" ]; then
     exit 1;
 fi
 
+# create java tmp dir if not found
+mkdir -m 0755 -p "$TMP"
+
 unset OPTIONS
 [ -r /etc/sysconfig/"$SHORTNAME" ] && source /etc/sysconfig/"$SHORTNAME"
 
@@ -64,7 +68,7 @@ export CLASSPATH="/usr/share/java/commons-daemon.jar:$ACP:$PCP:/etc/cloudstack/a
 start() {
     echo -n $"Starting $PROGNAME: "
     if hostname --fqdn >/dev/null 2>&1 ; then
-        $JSVC -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \
+        $JSVC -Djava.io.tmpdir="$TMP" -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \
             -errfile $LOGDIR/cloudstack-agent.err -outfile $LOGDIR/cloudstack-agent.out $CLASS
         RETVAL=$?
         echo

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bd85e5b4/packaging/debian/cloudstack-agent.init
----------------------------------------------------------------------
diff --git a/packaging/debian/cloudstack-agent.init b/packaging/debian/cloudstack-agent.init
index a3f2ae9..0cae5f5 100755
--- a/packaging/debian/cloudstack-agent.init
+++ b/packaging/debian/cloudstack-agent.init
@@ -33,6 +33,7 @@
 
 . /lib/lsb/init-functions
 
+TMP=/usr/share/cloudstack-agent/tmp
 SHORTNAME="cloudstack-agent"
 PIDFILE=/var/run/"$SHORTNAME".pid
 LOCKFILE=/var/lock/subsys/"$SHORTNAME"
@@ -45,6 +46,9 @@ SHUTDOWN_WAIT="30"
 unset OPTIONS
 [ -r /etc/default/"$SHORTNAME" ] && source /etc/default/"$SHORTNAME"
 
+# create java tmp dir if not found
+mkdir -m 0755 -p "$TMP"
+
 # The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT)
 JDK_DIRS="/usr/lib/jvm/java-7-openjdk-amd64 /usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-7-oracle /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-sun"
 
@@ -96,7 +100,7 @@ start() {
 
     wait_for_network
 
-    if start_daemon -p $PIDFILE $DAEMON -Xms256m -Xmx2048m -cp "$CLASSPATH" -Djna.nosys=true -pidfile "$PIDFILE" -errfile SYSLOG $CLASS
+    if start_daemon -p $PIDFILE $DAEMON -Djava.io.tmpdir="$TMP" -Xms256m -Xmx2048m -cp "$CLASSPATH" -Djna.nosys=true -pidfile "$PIDFILE" -errfile SYSLOG $CLASS
         RETVAL=$?
     then
         rc=0


[6/6] git commit: updated refs/heads/master to 0a2798c

Posted by bh...@apache.org.
Merge branch '4.9'


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0a2798c6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0a2798c6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0a2798c6

Branch: refs/heads/master
Commit: 0a2798c6be49c1dc9f1d461db59891348af5495a
Parents: f7733b4 b75e695
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Wed Nov 2 23:12:25 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Wed Nov 2 23:12:28 2016 +0530

----------------------------------------------------------------------
 .../agent/manager/AgentManagerImplTest.java     | 86 ++++++++++++++++++++
 packaging/centos63/cloud-agent.rc               |  6 +-
 packaging/centos7/cloud-agent.rc                |  6 +-
 packaging/debian/cloudstack-agent.init          |  6 +-
 packaging/systemd/cloudstack-agent.default      |  1 +
 packaging/systemd/cloudstack-agent.service      |  3 +-
 .../storage/listener/StoragePoolMonitor.java    |  6 +-
 .../listener/StoragePoolMonitorTest.java        | 80 ++++++++++++++++++
 8 files changed, 188 insertions(+), 6 deletions(-)
----------------------------------------------------------------------



[3/6] git commit: updated refs/heads/master to 0a2798c

Posted by bh...@apache.org.
Merge pull request #1694 from shapeblue/kvm-no-storage-failfast

CLOUDSTACK-9509: Host Connects Without StorageKVM hosts on shared storage failure was accepted by mgmt server with the
host state as Up, even though there was no primary/shared storage available on
it. This patch offers a quick fix by throwing an exception in the storage monitor
which connects storage pool on host. The failure is trapped by agent manager
that disconnects the agent without any investigation.

Based on Lab tests, KVM agent may take upto 2 minutes to attempt NFS mount when
the storage is inaccessible (firewalled, or shutdown) before returning back with
an error. It is safe to assume that this won't add pressure on mgmt server due to
several reconnection attempts, and KVM agent would retry reconnection every 2
minutes.

For such KVM hosts, where failure happens due to storage issues; they will be
briefly put in Alert state but will be mostly be in Connecting state during which
the KVM host attempts to mount/reconfigure NFS storage pool.

/cc @jburwell @karuturi
@blueorangutan package

* pr/1694:
  CLOUDSTACK-9509: Host Connects Without Storage

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/68f22e2a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/68f22e2a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/68f22e2a

Branch: refs/heads/master
Commit: 68f22e2a438c5ec1b7a390632cb94256bfdb6938
Parents: 84e2825 32a397a
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Wed Nov 2 22:57:43 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Wed Nov 2 22:57:51 2016 +0530

----------------------------------------------------------------------
 .../agent/manager/AgentManagerImplTest.java     | 86 ++++++++++++++++++++
 .../storage/listener/StoragePoolMonitor.java    |  6 +-
 .../listener/StoragePoolMonitorTest.java        | 80 ++++++++++++++++++
 3 files changed, 170 insertions(+), 2 deletions(-)
----------------------------------------------------------------------