mirror of https://github.com/apache/cloudstack.git
Bug 13895 - OVM zone z1 hosts went to Alert state, VMs in stopped state and stopping state
return VM in Error if it is no longer on primary storage reviewed-by: edison
This commit is contained in:
parent
142d3efe0b
commit
f2826af1ae
|
|
@ -205,10 +205,14 @@ class OvmHost(OvmObject):
|
|||
dct = {}
|
||||
host = OvmHost()
|
||||
for name, id in l:
|
||||
vmPath = host._getVmPathFromPrimaryStorage(name)
|
||||
vmStatus = db_get_vm(vmPath)
|
||||
dct[name] = vmStatus['status']
|
||||
|
||||
try:
|
||||
vmPath = host._getVmPathFromPrimaryStorage(name)
|
||||
vmStatus = db_get_vm(vmPath)
|
||||
dct[name] = vmStatus['status']
|
||||
except Exception, e:
|
||||
logger.debug(OvmHost.getAllVms, "Cannot find link for %s on primary storage, treat it as Error"%name)
|
||||
dct[name] = 'ERROR'
|
||||
|
||||
scanStoppedVmOnPrimaryStorage(dct)
|
||||
rs = toGson(dct)
|
||||
logger.info(OvmHost.getAllVms, rs)
|
||||
|
|
|
|||
Loading…
Reference in New Issue