Commit bc1fa0a6 authored by Anton Beloglazov's avatar Anton Beloglazov

Fixed the examples of the LR and LRR policies with a random workload

parent 8a508691
......@@ -33,7 +33,7 @@ public class IqrMc {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "iqr"; // Inter Quartile Range VM allocation policy
String vmAllocationPolicy = "iqr"; // Inter Quartile Range (IQR) VM allocation policy
String vmSelectionPolicy = "mc"; // Maximum Correlation (MC) VM selection policy
String parameter = "1.5"; // the safety parameter of the IQR policy
......
......@@ -33,7 +33,7 @@ public class IqrMmt {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "iqr"; // Inter Quartile Range VM allocation policy
String vmAllocationPolicy = "iqr"; // Inter Quartile Range (IQR) VM allocation policy
String vmSelectionPolicy = "mmt"; // Minimum Migration Time (MMT) VM selection policy
String parameter = "1.5"; // the safety parameter of the IQR policy
......
......@@ -33,7 +33,7 @@ public class IqrMu {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "iqr"; // Inter Quartile Range VM allocation policy
String vmAllocationPolicy = "iqr"; // Inter Quartile Range (IQR) VM allocation policy
String vmSelectionPolicy = "mu"; // Minimum Utilization (MU) VM selection policy
String parameter = "1.5"; // the safety parameter of the IQR policy
......
......@@ -33,7 +33,7 @@ public class IqrRs {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "iqr"; // Inter Quartile Range VM allocation policy
String vmAllocationPolicy = "iqr"; // Inter Quartile Range (IQR) VM allocation policy
String vmSelectionPolicy = "rs"; // Random Selection (RS) VM selection policy
String parameter = "1.5"; // the safety parameter of the IQR policy
......
package org.cloudbus.cloudsim.examples.power.random;
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegression;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationThresholds;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicy;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMaximumCorrelation;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyRandomSelection;
/**
* A simulation of a heterogeneous non-power aware data center: all hosts consume maximum power all
* the time.
* A simulation of a heterogeneous power aware data center that applies the Local Regression (LR) VM
* allocation policy and Maximum Correlation (MC) VM selection policy.
*
* The remaining configuration parameters are in the Constants and RandomConstants classes.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/
public class LrMc {
/**
* Creates main() to run this example.
* The main method.
*
* @param args the args
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
String experimentName = "lr_mc";
String outputFolder = "output";
Log.setDisabled(!RandomConstants.ENABLE_OUTPUT);
Log.printLine("Starting " + experimentName);
try {
CloudSim.init(1, Calendar.getInstance(), false);
DatacenterBroker broker = RandomHelper.createBroker();
int brokerId = broker.getId();
List<Cloudlet> cloudletList = RandomHelper.createCloudletList(brokerId, RandomConstants.NUMBER_OF_VMS);
List<Vm> vmList = RandomHelper.createVmList(brokerId, cloudletList.size());
List<PowerHost> hostList = RandomHelper.createHostList(RandomConstants.NUMBER_OF_HOSTS);
PowerVmSelectionPolicy vmSelectionPolicy = new PowerVmSelectionPolicyMaximumCorrelation(
new PowerVmSelectionPolicyRandomSelection());
PowerDatacenter datacenter = (PowerDatacenter) RandomHelper.createDatacenter("Datacenter",
PowerDatacenter.class, hostList,
new PowerVmAllocationPolicyMigrationLocalRegression(hostList, vmSelectionPolicy,
RandomConstants.SCHEDULING_INTERVAL, new PowerVmAllocationPolicyMigrationThresholds(
hostList, vmSelectionPolicy, 0.8)), -1);
datacenter.setDisableMigrations(false);
broker.submitVmList(vmList);
broker.submitCloudletList(cloudletList);
double lastClock = CloudSim.startSimulation();
List<Cloudlet> newList = broker.getCloudletReceivedList();
Log.printLine("Received " + newList.size() + " cloudlets");
CloudSim.stopSimulation();
RandomHelper.printResults(datacenter, vmList, lastClock, experimentName, RandomConstants.OUTPUT_CSV,
outputFolder);
} catch (Exception e) {
e.printStackTrace();
Log.printLine("Unwanted errors happen");
}
Log.printLine("Finished " + experimentName);
boolean enableOutput = true;
boolean outputToFile = false;
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "lr"; // Local Regression (LR) VM allocation policy
String vmSelectionPolicy = "mc"; // Maximum Correlation (MC) VM selection policy
String parameter = "1.2"; // the safety parameter of the LR policy
new RandomRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
}
package org.cloudbus.cloudsim.examples.power.random;
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegression;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationThresholds;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicy;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMinimumMigrationTime;
/**
* A simulation of a heterogeneous non-power aware data center: all hosts consume maximum power all
* the time.
* A simulation of a heterogeneous power aware data center that applies the Local Regression (LR) VM
* allocation policy and Minimum Migration Time (MMT) VM selection policy.
*
* The remaining configuration parameters are in the Constants and RandomConstants classes.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/
public class LrMmt {
/**
* Creates main() to run this example.
* The main method.
*
* @param args the args
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
String experimentName = "lr_mmt";
String outputFolder = "output";
Log.setDisabled(!RandomConstants.ENABLE_OUTPUT);
Log.printLine("Starting " + experimentName);
try {
CloudSim.init(1, Calendar.getInstance(), false);
DatacenterBroker broker = RandomHelper.createBroker();
int brokerId = broker.getId();
List<Cloudlet> cloudletList = RandomHelper.createCloudletList(brokerId, RandomConstants.NUMBER_OF_VMS);
List<Vm> vmList = RandomHelper.createVmList(brokerId, cloudletList.size());
List<PowerHost> hostList = RandomHelper.createHostList(RandomConstants.NUMBER_OF_HOSTS);
PowerVmSelectionPolicy vmSelectionPolicy = new PowerVmSelectionPolicyMinimumMigrationTime();
PowerDatacenter datacenter = (PowerDatacenter) RandomHelper.createDatacenter("Datacenter",
PowerDatacenter.class, hostList,
new PowerVmAllocationPolicyMigrationLocalRegression(hostList, vmSelectionPolicy,
RandomConstants.SCHEDULING_INTERVAL, new PowerVmAllocationPolicyMigrationThresholds(
hostList, vmSelectionPolicy, 0.8)), -1);
datacenter.setDisableMigrations(false);
broker.submitVmList(vmList);
broker.submitCloudletList(cloudletList);
double lastClock = CloudSim.startSimulation();
List<Cloudlet> newList = broker.getCloudletReceivedList();
Log.printLine("Received " + newList.size() + " cloudlets");
CloudSim.stopSimulation();
RandomHelper.printResults(datacenter, vmList, lastClock, experimentName, RandomConstants.OUTPUT_CSV,
outputFolder);
} catch (Exception e) {
e.printStackTrace();
Log.printLine("Unwanted errors happen");
}
Log.printLine("Finished " + experimentName);
boolean enableOutput = true;
boolean outputToFile = false;
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "lr"; // Local Regression (LR) VM allocation policy
String vmSelectionPolicy = "mmt"; // Minimum Migration Time (MMT) VM selection policy
String parameter = "1.2"; // the safety parameter of the LR policy
new RandomRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
}
package org.cloudbus.cloudsim.examples.power.random;
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegression;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationThresholds;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicy;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMinimumUtilization;
/**
* A simulation of a heterogeneous non-power aware data center: all hosts consume maximum power all
* the time.
* A simulation of a heterogeneous power aware data center that applies the Local Regression (LR) VM
* allocation policy and Minimum Utilization (MU) VM selection policy.
*
* The remaining configuration parameters are in the Constants and RandomConstants classes.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/
public class LrMu {
/**
* Creates main() to run this example.
* The main method.
*
* @param args the args
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
String experimentName = "lr_mu";
String outputFolder = "output";
Log.setDisabled(!RandomConstants.ENABLE_OUTPUT);
Log.printLine("Starting " + experimentName);
try {
CloudSim.init(1, Calendar.getInstance(), false);
DatacenterBroker broker = RandomHelper.createBroker();
int brokerId = broker.getId();
List<Cloudlet> cloudletList = RandomHelper.createCloudletList(brokerId, RandomConstants.NUMBER_OF_VMS);
List<Vm> vmList = RandomHelper.createVmList(brokerId, cloudletList.size());
List<PowerHost> hostList = RandomHelper.createHostList(RandomConstants.NUMBER_OF_HOSTS);
PowerVmSelectionPolicy vmSelectionPolicy = new PowerVmSelectionPolicyMinimumUtilization();
PowerDatacenter datacenter = (PowerDatacenter) RandomHelper.createDatacenter("Datacenter",
PowerDatacenter.class, hostList,
new PowerVmAllocationPolicyMigrationLocalRegression(hostList, vmSelectionPolicy,
RandomConstants.SCHEDULING_INTERVAL, new PowerVmAllocationPolicyMigrationThresholds(
hostList, vmSelectionPolicy, 0.8)), -1);
datacenter.setDisableMigrations(false);
broker.submitVmList(vmList);
broker.submitCloudletList(cloudletList);
double lastClock = CloudSim.startSimulation();
List<Cloudlet> newList = broker.getCloudletReceivedList();
Log.printLine("Received " + newList.size() + " cloudlets");
CloudSim.stopSimulation();
RandomHelper.printResults(datacenter, vmList, lastClock, experimentName, RandomConstants.OUTPUT_CSV,
outputFolder);
} catch (Exception e) {
e.printStackTrace();
Log.printLine("Unwanted errors happen");
}
Log.printLine("Finished " + experimentName);
boolean enableOutput = true;
boolean outputToFile = false;
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "lr"; // Local Regression (LR) VM allocation policy
String vmSelectionPolicy = "mu"; // Minimum Utilization (MU) VM selection policy
String parameter = "1.2"; // the safety parameter of the LR policy
new RandomRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
}
package org.cloudbus.cloudsim.examples.power.random;
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegression;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationThresholds;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicy;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyRandomSelection;
/**
* A simulation of a heterogeneous non-power aware data center: all hosts consume maximum power all
* the time.
* A simulation of a heterogeneous power aware data center that applies the Local Regression (LR) VM
* allocation policy and Random Selection (RS) VM selection policy.
*
* The remaining configuration parameters are in the Constants and RandomConstants classes.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/
public class LrRs {
/**
* Creates main() to run this example.
* The main method.
*
* @param args the args
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
String experimentName = "lr_rs";
String outputFolder = "output";
Log.setDisabled(!RandomConstants.ENABLE_OUTPUT);
Log.printLine("Starting " + experimentName);
try {
CloudSim.init(1, Calendar.getInstance(), false);
DatacenterBroker broker = RandomHelper.createBroker();
int brokerId = broker.getId();
List<Cloudlet> cloudletList = RandomHelper.createCloudletList(brokerId, RandomConstants.NUMBER_OF_VMS);
List<Vm> vmList = RandomHelper.createVmList(brokerId, cloudletList.size());
List<PowerHost> hostList = RandomHelper.createHostList(RandomConstants.NUMBER_OF_HOSTS);
PowerVmSelectionPolicy vmSelectionPolicy = new PowerVmSelectionPolicyRandomSelection();
PowerDatacenter datacenter = (PowerDatacenter) RandomHelper.createDatacenter("Datacenter",
PowerDatacenter.class, hostList,
new PowerVmAllocationPolicyMigrationLocalRegression(hostList, vmSelectionPolicy,
RandomConstants.SCHEDULING_INTERVAL, new PowerVmAllocationPolicyMigrationThresholds(
hostList, vmSelectionPolicy, 0.8)), -1);
datacenter.setDisableMigrations(false);
broker.submitVmList(vmList);
broker.submitCloudletList(cloudletList);
double lastClock = CloudSim.startSimulation();
List<Cloudlet> newList = broker.getCloudletReceivedList();
Log.printLine("Received " + newList.size() + " cloudlets");
CloudSim.stopSimulation();
RandomHelper.printResults(datacenter, vmList, lastClock, experimentName, RandomConstants.OUTPUT_CSV,
outputFolder);
} catch (Exception e) {
e.printStackTrace();
Log.printLine("Unwanted errors happen");
}
Log.printLine("Finished " + experimentName);
boolean enableOutput = true;
boolean outputToFile = false;
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "lr"; // Local Regression (LR) VM allocation policy
String vmSelectionPolicy = "rs"; // Random Selection (RS) VM selection policy
String parameter = "1.2"; // the safety parameter of the LR policy
new RandomRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
}
package org.cloudbus.cloudsim.examples.power.random;
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegressionRobust;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationThresholds;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicy;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMaximumCorrelation;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyRandomSelection;
/**
* A simulation of a heterogeneous non-power aware data center: all hosts consume maximum power all
* the time.
* A simulation of a heterogeneous power aware data center that applies the Local Regression Robust
* (LRR) VM allocation policy and Maximum Correlation (MC) VM selection policy.
*
* The remaining configuration parameters are in the Constants and RandomConstants classes.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/
public class LrrMc {
/**
* Creates main() to run this example.
* The main method.
*
* @param args the args
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
String experimentName = "lrr_mc";
String outputFolder = "output";
Log.setDisabled(!RandomConstants.ENABLE_OUTPUT);
Log.printLine("Starting " + experimentName);
try {
CloudSim.init(1, Calendar.getInstance(), false);
DatacenterBroker broker = RandomHelper.createBroker();
int brokerId = broker.getId();
List<Cloudlet> cloudletList = RandomHelper.createCloudletList(brokerId, RandomConstants.NUMBER_OF_VMS);
List<Vm> vmList = RandomHelper.createVmList(brokerId, cloudletList.size());
List<PowerHost> hostList = RandomHelper.createHostList(RandomConstants.NUMBER_OF_HOSTS);
PowerVmSelectionPolicy vmSelectionPolicy = new PowerVmSelectionPolicyMaximumCorrelation(
new PowerVmSelectionPolicyRandomSelection());
PowerDatacenter datacenter = (PowerDatacenter) RandomHelper.createDatacenter("Datacenter",
PowerDatacenter.class, hostList,
new PowerVmAllocationPolicyMigrationLocalRegressionRobust(hostList, vmSelectionPolicy,
RandomConstants.SCHEDULING_INTERVAL, new PowerVmAllocationPolicyMigrationThresholds(
hostList, vmSelectionPolicy, 0.8)), -1);
datacenter.setDisableMigrations(false);
broker.submitVmList(vmList);
broker.submitCloudletList(cloudletList);
double lastClock = CloudSim.startSimulation();
List<Cloudlet> newList = broker.getCloudletReceivedList();
Log.printLine("Received " + newList.size() + " cloudlets");
CloudSim.stopSimulation();
RandomHelper.printResults(datacenter, vmList, lastClock, experimentName, RandomConstants.OUTPUT_CSV,
outputFolder);
} catch (Exception e) {
e.printStackTrace();
Log.printLine("Unwanted errors happen");
}
Log.printLine("Finished " + experimentName);
boolean enableOutput = true;
boolean outputToFile = false;
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "lrr"; // Local Regression Robust (LRR) VM allocation policy
String vmSelectionPolicy = "mc"; // Maximum Correlation (MC) VM selection policy
String parameter = "1.2"; // the safety parameter of the LRR policy
new RandomRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
}
package org.cloudbus.cloudsim.examples.power.random;
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegressionRobust;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationStaticThreshold;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicy;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMinimumMigrationTime;
/**
* A simulation of a heterogeneous non-power aware data center: all hosts consume maximum power all
* the time.
* A simulation of a heterogeneous power aware data center that applies the Local Regression Robust
* (LRR) VM allocation policy and Minimum Migration Time (MMT) VM selection policy.
*
* The remaining configuration parameters are in the Constants and RandomConstants classes.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/
public class LrrMmt {
/**
* Creates main() to run this example.
* The main method.
*
* @param args the args
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
String experimentName = "lrr_mmt";
String outputFolder = "output";
Log.setDisabled(!RandomConstants.ENABLE_OUTPUT);
Log.printLine("Starting " + experimentName);
try {
CloudSim.init(1, Calendar.getInstance(), false);
DatacenterBroker broker = RandomHelper.createBroker();
int brokerId = broker.getId();
List<Cloudlet> cloudletList = RandomHelper.createCloudletList(brokerId, RandomConstants.NUMBER_OF_VMS);
List<Vm> vmList = RandomHelper.createVmList(brokerId, cloudletList.size());
List<PowerHost> hostList = RandomHelper.createHostList(RandomConstants.NUMBER_OF_HOSTS);
PowerVmSelectionPolicy vmSelectionPolicy = new PowerVmSelectionPolicyMinimumMigrationTime();
PowerDatacenter datacenter = (PowerDatacenter) RandomHelper.createDatacenter("Datacenter",
PowerDatacenter.class, hostList,
new PowerVmAllocationPolicyMigrationLocalRegressionRobust(hostList, vmSelectionPolicy,
RandomConstants.SCHEDULING_INTERVAL, new PowerVmAllocationPolicyMigrationStaticThreshold(
hostList, vmSelectionPolicy, 0.8)), -1);
datacenter.setDisableMigrations(false);
broker.submitVmList(vmList);
broker.submitCloudletList(cloudletList);
double lastClock = CloudSim.startSimulation();
List<Cloudlet> newList = broker.getCloudletReceivedList();
Log.printLine("Received " + newList.size() + " cloudlets");
CloudSim.stopSimulation();
RandomHelper.printResults(datacenter, vmList, lastClock, experimentName, RandomConstants.OUTPUT_CSV,
outputFolder);
} catch (Exception e) {
e.printStackTrace();
Log.printLine("The simulation has been terminated due to an unexpected error");
}
Log.printLine("Finished " + experimentName);
boolean enableOutput = true;
boolean outputToFile = false;
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "lrr"; // Local Regression Robust (LRR) VM allocation policy
String vmSelectionPolicy = "mmt"; // Minimum Migration Time (MMT) VM selection policy
String parameter = "1.2"; // the safety parameter of the LRR policy
new RandomRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
}
package org.cloudbus.cloudsim.examples.power.random;
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegressionRobust;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationStaticThreshold;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicy;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMinimumUtilization;
/**
* A simulation of a heterogeneous non-power aware data center: all hosts consume maximum power all
* the time.
* A simulation of a heterogeneous power aware data center that applies the Local Regression Robust
* (LRR) VM allocation policy and Minimum Utilization (MU) VM selection policy.
*
* The remaining configuration parameters are in the Constants and RandomConstants classes.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/
public class LrrMu {
/**
* Creates main() to run this example.
* The main method.
*
* @param args the args
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
String experimentName = "lrr_mu";
String outputFolder = "output";
Log.setDisabled(!RandomConstants.ENABLE_OUTPUT);
Log.printLine("Starting " + experimentName);
try {
CloudSim.init(1, Calendar.getInstance(), false);
DatacenterBroker broker = RandomHelper.createBroker();
int brokerId = broker.getId();
List<Cloudlet> cloudletList = RandomHelper.createCloudletList(brokerId, RandomConstants.NUMBER_OF_VMS);
List<Vm> vmList = RandomHelper.createVmList(brokerId, cloudletList.size());
List<PowerHost> hostList = RandomHelper.createHostList(RandomConstants.NUMBER_OF_HOSTS);
PowerVmSelectionPolicy vmSelectionPolicy = new PowerVmSelectionPolicyMinimumUtilization();
PowerDatacenter datacenter = (PowerDatacenter) RandomHelper.createDatacenter("Datacenter",
PowerDatacenter.class, hostList,
new PowerVmAllocationPolicyMigrationLocalRegressionRobust(hostList, vmSelectionPolicy,
RandomConstants.SCHEDULING_INTERVAL, new PowerVmAllocationPolicyMigrationStaticThreshold(
hostList, vmSelectionPolicy, 0.8)), -1);
datacenter.setDisableMigrations(false);
broker.submitVmList(vmList);
broker.submitCloudletList(cloudletList);
double lastClock = CloudSim.startSimulation();
List<Cloudlet> newList = broker.getCloudletReceivedList();
Log.printLine("Received " + newList.size() + " cloudlets");
CloudSim.stopSimulation();
RandomHelper.printResults(datacenter, vmList, lastClock, experimentName, RandomConstants.OUTPUT_CSV,
outputFolder);
} catch (Exception e) {
e.printStackTrace();
Log.printLine("The simulation has been terminated due to an unexpected error");
}
Log.printLine("Finished " + experimentName);
boolean enableOutput = true;
boolean outputToFile = false;
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "lrr"; // Local Regression Robust (LRR) VM allocation policy
String vmSelectionPolicy = "mu"; // Minimum Utilization (MU) VM selection policy
String parameter = "1.2"; // the safety parameter of the LRR policy
new RandomRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
}
package org.cloudbus.cloudsim.examples.power.random;
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegressionRobust;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationThresholds;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicy;
import org.cloudbus.cloudsim.power.PowerVmSelectionPolicyRandomSelection;
/**
* A simulation of a heterogeneous non-power aware data center: all hosts consume maximum power all
* the time.
* A simulation of a heterogeneous power aware data center that applies the Local Regression Robust
* (LRR) VM allocation policy and Random Selection (RS) VM selection policy.
*
* The remaining configuration parameters are in the Constants and RandomConstants classes.
*
* If you are using any algorithms, policies or workload included in the power package please cite
* the following paper:
*
* Anton Beloglazov, and Rajkumar Buyya, "Optimal Online Deterministic Algorithms and Adaptive
* Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in
* Cloud Data Centers", Concurrency and Computation: Practice and Experience, ISSN: 1532-0626, Wiley
* Press, New York, USA, 2011, DOI: 10.1002/cpe.1867
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*/
public class LrrRs {
/**
* Creates main() to run this example.
* The main method.
*
* @param args the args
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
String experimentName = "lrr_rs";
String outputFolder = "output";
Log.setDisabled(!RandomConstants.ENABLE_OUTPUT);
Log.printLine("Starting " + experimentName);
try {
CloudSim.init(1, Calendar.getInstance(), false);
DatacenterBroker broker = RandomHelper.createBroker();
int brokerId = broker.getId();
List<Cloudlet> cloudletList = RandomHelper.createCloudletList(brokerId, RandomConstants.NUMBER_OF_VMS);
List<Vm> vmList = RandomHelper.createVmList(brokerId, cloudletList.size());
List<PowerHost> hostList = RandomHelper.createHostList(RandomConstants.NUMBER_OF_HOSTS);
PowerVmSelectionPolicy vmSelectionPolicy = new PowerVmSelectionPolicyRandomSelection();
PowerDatacenter datacenter = (PowerDatacenter) RandomHelper.createDatacenter("Datacenter",
PowerDatacenter.class, hostList,
new PowerVmAllocationPolicyMigrationLocalRegressionRobust(hostList, vmSelectionPolicy,
RandomConstants.SCHEDULING_INTERVAL, new PowerVmAllocationPolicyMigrationThresholds(
hostList, vmSelectionPolicy, 0.8)), -1);
datacenter.setDisableMigrations(false);
broker.submitVmList(vmList);
broker.submitCloudletList(cloudletList);
double lastClock = CloudSim.startSimulation();
List<Cloudlet> newList = broker.getCloudletReceivedList();
Log.printLine("Received " + newList.size() + " cloudlets");
CloudSim.stopSimulation();
RandomHelper.printResults(datacenter, vmList, lastClock, experimentName, RandomConstants.OUTPUT_CSV,
outputFolder);
} catch (Exception e) {
e.printStackTrace();
Log.printLine("Unwanted errors happen");
}
Log.printLine("Finished " + experimentName);
boolean enableOutput = true;
boolean outputToFile = false;
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "lrr"; // Local Regression Robust (LRR) VM allocation policy
String vmSelectionPolicy = "rs"; // Random Selection (RS) VM selection policy
String parameter = "1.2"; // the safety parameter of the LRR policy
new RandomRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
}
......@@ -33,7 +33,7 @@ public class MadMc {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "mad"; // Median Absolute Deviation VM allocation policy
String vmAllocationPolicy = "mad"; // Median Absolute Deviation (MAD) VM allocation policy
String vmSelectionPolicy = "mc"; // Maximum Correlation (MC) VM selection policy
String parameter = "2.5"; // the safety parameter of the MAD policy
......
......@@ -33,7 +33,7 @@ public class MadMmt {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "mad"; // Median Absolute Deviation VM allocation policy
String vmAllocationPolicy = "mad"; // Median Absolute Deviation (MAD) VM allocation policy
String vmSelectionPolicy = "mmt"; // Minimum Migration Time (MMT) VM selection policy
String parameter = "2.5"; // the safety parameter of the MAD policy
......
......@@ -33,7 +33,7 @@ public class MadMu {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "mad"; // Median Absolute Deviation VM allocation policy
String vmAllocationPolicy = "mad"; // Median Absolute Deviation (MAD) VM allocation policy
String vmSelectionPolicy = "mu"; // Minimum Utilization (MU) VM selection policy
String parameter = "2.5"; // the safety parameter of the MAD policy
......
......@@ -33,7 +33,7 @@ public class MadRs {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "mad"; // Median Absolute Deviation VM allocation policy
String vmAllocationPolicy = "mad"; // Median Absolute Deviation (MAD) VM allocation policy
String vmSelectionPolicy = "rs"; // Random Selection (RS) VM selection policy
String parameter = "2.5"; // the safety parameter of the MAD policy
......
......@@ -33,7 +33,7 @@ public class ThrMc {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "thr"; // Static Threshold VM allocation policy
String vmAllocationPolicy = "thr"; // Static Threshold (THR) VM allocation policy
String vmSelectionPolicy = "mc"; // Maximum Correlation (MC) VM selection policy
String parameter = "0.8"; // the static utilization threshold
......
......@@ -33,7 +33,7 @@ public class ThrMmt {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "thr"; // Static Threshold VM allocation policy
String vmAllocationPolicy = "thr"; // Static Threshold (THR) VM allocation policy
String vmSelectionPolicy = "mmt"; // Minimum Migration Time (MMT) VM selection policy
String parameter = "0.8"; // the static utilization threshold
......
......@@ -33,7 +33,7 @@ public class ThrMu {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "thr"; // Static Threshold VM allocation policy
String vmAllocationPolicy = "thr"; // Static Threshold (THR) VM allocation policy
String vmSelectionPolicy = "mu"; // Minimum Utilization (MU) VM selection policy
String parameter = "0.8"; // the static utilization threshold
......
......@@ -33,7 +33,7 @@ public class ThrRs {
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "thr"; // Static Threshold VM allocation policy
String vmAllocationPolicy = "thr"; // Static Threshold (THR) VM allocation policy
String vmSelectionPolicy = "rs"; // Random Selection (RS) VM selection policy
String parameter = "0.8"; // the static utilization threshold
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment