Skip to content

Commit a67728b

Browse files
committed
CLOUDSTACK-2567 - check for ! dmcEnabled.
1 parent 4e09079 commit a67728b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,8 @@ public ScaleVmAnswer execute(ScaleVmCommand cmd) {
661661
Set<VM> vms = VM.getByNameLabel(conn, vmName);
662662
Host host = Host.getByUuid(conn, _host.uuid);
663663

664-
// If DMC is not enable then dont execute this command.
665-
if (isDmcEnabled(conn, host)) {
664+
// If DMC is not enable then don't execute this command.
665+
if (!isDmcEnabled(conn, host)) {
666666
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.";
667667
s_logger.info(msg);
668668
return new ScaleVmAnswer(cmd, false, msg);

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ protected VM createVmFromTemplate(Connection conn, VirtualMachineTO vmSpec, Host
244244
protected boolean isDmcEnabled(Connection conn, Host host) throws XenAPIException, XmlRpcException {
245245
Map<String, String> hostParams = new HashMap<String, String>();
246246
hostParams = host.getLicenseParams(conn);
247-
return hostParams.get("restrict_dmc").equalsIgnoreCase("false");
247+
248+
Boolean isDmcEnabled = hostParams.get("restrict_dmc").equalsIgnoreCase("false");
249+
250+
return isDmcEnabled;
248251
}
249252
}

0 commit comments

Comments
 (0)