mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 18:43:26 +01:00
CLOUDSTACK-2567 - Check whether DMC - dynamic memory control is enabled for the hyervisor before trying to scale the vm. If its not then dont scale and instead throw and exception.
This commit is contained in:
parent
2adc8e9a03
commit
a58ee74e1c
@ -660,6 +660,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
|
||||
Connection conn = getConnection();
|
||||
Set<VM> vms = VM.getByNameLabel(conn, vmName);
|
||||
Host host = Host.getByUuid(conn, _host.uuid);
|
||||
|
||||
// If DMC is not enable then dont execute this command.
|
||||
if (isDmcEnabled(conn, host)) {
|
||||
String msg = "Unable to scale the vm: " + vmName + " as DMC - Dynamic memory control is not enabled for the XenServer:" + _host.uuid + " ,check your license and hypervisor version.";
|
||||
s_logger.info(msg);
|
||||
return new ScaleVmAnswer(cmd, false, msg);
|
||||
}
|
||||
// stop vm which is running on this host or is in halted state
|
||||
Iterator<VM> iter = vms.iterator();
|
||||
while ( iter.hasNext() ) {
|
||||
|
||||
@ -58,7 +58,10 @@ public class CitrixResourceBaseTest {
|
||||
super.scaleVM(conn, vm, vmSpec, host);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean isDmcEnabled(Connection conn, Host host) throws Types.XenAPIException, XmlRpcException {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@Mock XsHost _host;
|
||||
@Mock Host host;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user