CLOUDSTACK-2567 - check for ! dmcEnabled.

This commit is contained in:
Nitin Mehta 2013-05-22 15:30:53 +05:30
parent 4e09079640
commit a67728b312
2 changed files with 6 additions and 3 deletions

View File

@ -661,8 +661,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
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)) {
// If DMC is not enable then don't 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);

View File

@ -244,6 +244,9 @@ public class XenServer56FP1Resource extends XenServer56Resource {
protected boolean isDmcEnabled(Connection conn, Host host) throws XenAPIException, XmlRpcException {
Map<String, String> hostParams = new HashMap<String, String>();
hostParams = host.getLicenseParams(conn);
return hostParams.get("restrict_dmc").equalsIgnoreCase("false");
Boolean isDmcEnabled = hostParams.get("restrict_dmc").equalsIgnoreCase("false");
return isDmcEnabled;
}
}