mirror of https://github.com/apache/cloudstack.git
bug 11386: check host status before responding StartupCommand
This commit is contained in:
parent
a0ab06b186
commit
968c1d11ea
|
|
@ -2960,7 +2960,22 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
}
|
||||
|
||||
@Override
|
||||
public StartupCommand[] initialize() {
|
||||
public StartupCommand[] initialize() {
|
||||
VmwareContext context = getServiceContext();
|
||||
try {
|
||||
VmwareHypervisorHost hyperHost = getHyperHost(context);
|
||||
assert(hyperHost instanceof HostMO);
|
||||
if(!((HostMO)hyperHost).isHyperHostConnected()) {
|
||||
s_logger.info("Host " + hyperHost.getHyperHostName() + " is not in connected state");
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String msg = "VmwareResource intialize() failed due to : " + VmwareHelper.getExceptionMessage(e);
|
||||
s_logger.error(msg);
|
||||
invalidateServiceContext();
|
||||
return null;
|
||||
}
|
||||
|
||||
StartupRoutingCommand cmd = new StartupRoutingCommand();
|
||||
fillHostInfo(cmd);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue