mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8088: VM scale up is failing in vmware with Unable to execute ScaleVmCommand due to java.lang.NullPointerException
(cherry picked from commit 1df0453d27e8378065c15878067fc9d2dc961e30) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
8676ff26e0
commit
a1791cb4a8
@ -17,6 +17,7 @@
|
|||||||
package com.cloud.hypervisor;
|
package com.cloud.hypervisor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.cloudstack.framework.config.ConfigKey;
|
import org.apache.cloudstack.framework.config.ConfigKey;
|
||||||
|
|
||||||
@ -81,4 +82,6 @@ public interface HypervisorGuru extends Adapter {
|
|||||||
List<Command> finalizeExpungeNics(VirtualMachine vm, List<NicProfile> nics);
|
List<Command> finalizeExpungeNics(VirtualMachine vm, List<NicProfile> nics);
|
||||||
|
|
||||||
List<Command> finalizeExpungeVolumes(VirtualMachine vm);
|
List<Command> finalizeExpungeVolumes(VirtualMachine vm);
|
||||||
|
|
||||||
|
Map<String, String> getClusterSettings(long vmId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3487,6 +3487,13 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||||||
newServiceOffering.getSpeed(), minMemory * 1024L * 1024L, newServiceOffering.getRamSize() * 1024L * 1024L, newServiceOffering.getLimitCpuUse());
|
newServiceOffering.getSpeed(), minMemory * 1024L * 1024L, newServiceOffering.getRamSize() * 1024L * 1024L, newServiceOffering.getLimitCpuUse());
|
||||||
|
|
||||||
Long dstHostId = vm.getHostId();
|
Long dstHostId = vm.getHostId();
|
||||||
|
if(vm.getHypervisorType().equals(HypervisorType.VMware)) {
|
||||||
|
HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vm.getHypervisorType());
|
||||||
|
Map<String, String> details = null;
|
||||||
|
details = hvGuru.getClusterSettings(vm.getId());
|
||||||
|
reconfigureCmd.getVirtualMachine().setDetails(details);
|
||||||
|
}
|
||||||
|
|
||||||
ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running, vm.getType(), vm.getId());
|
ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running, vm.getType(), vm.getId());
|
||||||
work.setStep(Step.Prepare);
|
work.setStep(Step.Prepare);
|
||||||
work.setResourceType(ItWorkVO.ResourceType.Host);
|
work.setResourceType(ItWorkVO.ResourceType.Host);
|
||||||
|
|||||||
@ -84,4 +84,10 @@ public class BareMetalGuru extends HypervisorGuruBase implements HypervisorGuru
|
|||||||
public boolean trackVmHostChange() {
|
public boolean trackVmHostChange() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getClusterSettings(long vmId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@ -194,4 +195,10 @@ public class HypervGuru extends HypervisorGuruBase implements HypervisorGuru {
|
|||||||
public final boolean trackVmHostChange() {
|
public final boolean trackVmHostChange() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getClusterSettings(long vmId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,8 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package com.cloud.ovm.hypervisor;
|
package com.cloud.ovm.hypervisor;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -58,4 +60,10 @@ public class OvmGuru extends HypervisorGuruBase implements HypervisorGuru {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getClusterSettings(long vmId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,8 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package com.cloud.simulator;
|
package com.cloud.simulator;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -56,4 +58,10 @@ public class SimulatorGuru extends HypervisorGuruBase implements HypervisorGuru
|
|||||||
public boolean trackVmHostChange() {
|
public boolean trackVmHostChange() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getClusterSettings(long vmId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -552,4 +552,13 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru, Co
|
|||||||
|
|
||||||
return commands;
|
return commands;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getClusterSettings(long vmId) {
|
||||||
|
Map<String, String> details = new HashMap<String, String>();
|
||||||
|
long clusterId = getClusterId(vmId);
|
||||||
|
details.put(VmwareReserveCpu.key(), VmwareReserveCpu.valueIn(clusterId).toString());
|
||||||
|
details.put(VmwareReserveMemory.key(), VmwareReserveMemory.valueIn(clusterId).toString());
|
||||||
|
return details;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ package com.cloud.hypervisor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@ -128,6 +129,11 @@ public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getClusterSettings(long vmId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Command> finalizeExpungeVolumes(VirtualMachine vm) {
|
public List<Command> finalizeExpungeVolumes(VirtualMachine vm) {
|
||||||
List<Command> commands = new ArrayList<Command>();
|
List<Command> commands = new ArrayList<Command>();
|
||||||
|
|||||||
@ -190,4 +190,10 @@ public abstract class HypervisorGuruBase extends AdapterBase implements Hypervis
|
|||||||
public List<Command> finalizeExpungeVolumes(VirtualMachine vm) {
|
public List<Command> finalizeExpungeVolumes(VirtualMachine vm) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getClusterSettings(long vmId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,8 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package com.cloud.hypervisor;
|
package com.cloud.hypervisor;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -86,4 +88,10 @@ public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru {
|
|||||||
public boolean trackVmHostChange() {
|
public boolean trackVmHostChange() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getClusterSettings(long vmId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,8 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
package com.cloud.hypervisor;
|
package com.cloud.hypervisor;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -73,4 +75,9 @@ public class LXCGuru extends HypervisorGuruBase implements HypervisorGuru {
|
|||||||
public boolean trackVmHostChange() {
|
public boolean trackVmHostChange() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getClusterSettings(long vmId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user