From d0de1a5b94de681554b0b9e462677f04e1834ff2 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Thu, 7 Jul 2011 17:00:41 -0700 Subject: [PATCH] bug 10620: allow ISO attachment failure to propogate up --- server/src/com/cloud/template/TemplateManagerImpl.java | 3 +++ server/src/com/cloud/vm/UserVmManagerImpl.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index 80234ec98f2..5965ad5d582 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -821,6 +821,9 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe throw new InvalidParameterValueException("Cannot attach Xenserver PV drivers to incompatible hypervisor " + vm.getHypervisorType()); } + if("vmware-tools.iso".equals(iso.getName()) && vm.getHypervisorType() != Hypervisor.HypervisorType.VMware) { + throw new InvalidParameterValueException("Cannot attach VMware tools drivers to incompatible hypervisor " + vm.getHypervisorType()); + } return attachISOToVM(vmId, userId, isoId, true); } diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 47146e6e8f9..bc4bb292808 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -865,7 +865,8 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager cmd.setStoreUrl(isoPathPair.second()); } Answer a = _agentMgr.easySend(vm.getHostId(), cmd); - return (a != null); + + return (a != null && a.getResult()); } private UserVm rebootVirtualMachine(long userId, long vmId) throws InsufficientCapacityException, ResourceUnavailableException {