Bug 13895 - OVM zone z1 hosts went to Alert state, VMs in stopped state and stopping state

status 13895: resolved fixed
reviewed-by: edison
This commit is contained in:
frank 2012-02-21 14:15:21 -08:00
parent 167f135332
commit 1590fb8f64
1 changed files with 7 additions and 2 deletions

View File

@ -298,8 +298,13 @@ class OvmVm(OvmObject):
return SUCC()
logger.info(OvmVm.stop, "Stop vm %s"%vmName)
vmPath = OvmHost()._vmNameToPath(vmName)
# set the VM to RUNNING before starting, OVS agent will check this status
try:
vmPath = OvmHost()._vmNameToPath(vmName)
except Exception, e:
errmsg = fmt_err_msg(e)
logger.info(OvmVm.stop, "Cannot find link for vm %s on primary storage, treating it as stopped\n %s"%(vmName, errmsg))
return SUCC()
# set the VM to RUNNING before stopping, OVS agent will check this status
set_vm_status(vmPath, 'RUNNING')
raiseExceptionIfFail(stop_vm(vmPath))
return SUCC()