mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7598: When a vm deployed by cloudstack is stopped on the hypervisor
(outside cloudstack), the state of the vm is not updated in cloudstack db. The ping task was not checking for resource (host) status by default. The power state of the vms is returned as part of the resource status. Fixed the issue by making sure ping task atleast tries once to get the resource status.
This commit is contained in:
parent
f3252db797
commit
55b4ead495
|
|
@ -166,11 +166,13 @@ public class DirectAgentAttache extends AgentAttache {
|
|||
if (resource != null) {
|
||||
PingCommand cmd = null;
|
||||
int retried = 0;
|
||||
while ( cmd == null && ++retried < _HostPingRetryCount.value())
|
||||
cmd = resource.getCurrentStatus(_id);
|
||||
while (cmd == null && retried++ < _HostPingRetryCount.value())
|
||||
{
|
||||
cmd = resource.getCurrentStatus(_id);
|
||||
Thread.sleep(1000*_HostPingRetryTimer.value());
|
||||
cmd = resource.getCurrentStatus(_id);
|
||||
}
|
||||
|
||||
if (cmd == null) {
|
||||
s_logger.warn("Unable to get current status on " + _id + "(" + _name + ")");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue