bug 7281: throw an exception when fail to get isoPath - happens when Secondary Storage vm is not in UP state in cloud.hosts table.

status 7281: resolved fixed
This commit is contained in:
alena 2010-11-22 15:42:34 -08:00
parent b7eefe1836
commit 1491893bbc
1 changed files with 4 additions and 1 deletions

View File

@ -1008,7 +1008,10 @@ public class ManagementServerImpl implements ManagementServer {
if (isIso)
{
Pair<String, String> isoPath = _storageMgr.getAbsoluteIsoPath(templateId, dataCenterId);
assert(isoPath != null);
if (isoPath == null) {
s_logger.warn("Unable to get absolute path of the iso");
throw new CloudRuntimeException("Unable to get absolute path of the iso");
}
try
{
started = _vmMgr.startVirtualMachine(userId, created.getId(), password, isoPath.first(), startEventId);