- MSG_storage_set_property_value()
* VM properties. Since msg_vm_t are msg_host_t, just use
MSG_host_get_property_value() and friends
+ * MSG_vm_create had ignored parameters, that are now dropped:
+ core_nb, disk_path and disk_size.
* MSG_as_router_get_property_value() was redundent with
MSG_environment_as_get_property_value().
- Removed MSG_as_router_*propert*() functions
Msg.info("Load of collocated VMs fluctuate between 0 and 90% in order to create a starvation issue and see "
+ "whether it impacts or not the migration time");
XVM vm1 = new XVM(host0, "vm0",
- 1, // Nb of vcpu
2048, // Ramsize,
- 125, // Net Bandwidth
- null, //VM disk image
- -1, //size of disk image,
125, // Net bandwidth,
dpRate // Memory intensity
);
XVM tmp;
for (int i=1 ; i<= collocatedSrc ; i++){
tmp = new XVM(host0, "vm"+i,
- 1, // Nb of vcpu
2048, // Ramsize,
- 125, // Net Bandwidth
- null, //VM disk image
- -1, //size of disk image,
125, // Net bandwidth,
dpRate // Memory intensity
);
for (int i=1 ; i <= collocatedDst ; i++){
tmp = new XVM(host1, "vm"+(i+collocatedSrc),
- 1, // Nb of vcpu
2048, // Ramsize,
- 125, // Net Bandwidth
- null, //VM disk image
- -1, //size of disk image,
125, // Net bandwidth,
dpRate // Memory intensity
);
int dpRate = 70;
XVM vm0 = null;
vm0 = new XVM(host1, "vm0",
- 1, // Nb of vcpu
2048, // Ramsize,
- 125, // Net Bandwidth
- null, //VM disk image
- -1, //size of disk image,
125, // Net bandwidth,
dpRate // Memory intensity
);
// Create VM0
int dpRate = 70;
XVM vm0 = new XVM(host1, "vm0",
- 1, // Nb of vcpu
2048, // Ramsize,
- 125, // Net Bandwidth
- null, //VM disk image
- -1, //size of disk image,
125, // Net bandwidth,
dpRate // Memory intensity
);
Msg.info("Restart VM0");
vm0 = new XVM(host1, "vm0",
- 1, // Nb of vcpu
2048, // Ramsize,
- 125, // Net Bandwidth
- null, //VM disk image
- -1, //size of disk image,
125, // Net bandwidth,
dpRate // Memory intensity
);
private Daemon daemon;
- public XVM(Host host, String name,
- int nbCores, int ramsize, int netBW, String diskPath, int diskSize, int migNetBW, int dpIntensity){
- super(host, name, nbCores, ramsize, netBW, diskPath, diskSize, (int)(migNetBW*0.9), dpIntensity);
+ public XVM(Host host, String name, int ramsize, int migNetBW, int dpIntensity){
+ super(host, name, ramsize, (int)(migNetBW*0.9), dpIntensity);
this.currentLoad = 0;
- this. dpIntensity = dpIntensity ;
+ this.dpIntensity = dpIntensity ;
this.ramsize= ramsize;
this.daemon = new Daemon(this, 100);
}
Host host3 = Host.getByName("MyHost3");
Msg.info("Creating and starting two VMs");
- VM vmHost1 = new VM(host1, "vmHost1", 4, 2048, 100, null, 1024 * 20, 10,50);
+ VM vmHost1 = new VM(host1, "vmHost1", 2048, 10, 50);
vmHost1.start();
- VM vmHost3 = new VM(host3, "vmHost3", 4, 2048, 100, null, 1024 * 20, 10,50);
+ VM vmHost3 = new VM(host3, "vmHost3", 2048, 10, 50);
vmHost3.start();
Msg.info("Create two tasks on Host1: one inside a VM, the other directly on the host");
/* Host 1 */
XBT_INFO("Creating and starting two VMs");
- msg_vm_t vm_host1 = MSG_vm_create(host1, "vm_host1", 4, 2048, 100, NULL, 1024 * 20, 10,50);
+ msg_vm_t vm_host1 = MSG_vm_create(host1, "vm_host1", 2048, 10, 50);
MSG_vm_start(vm_host1);
- msg_vm_t vm_host3 = MSG_vm_create(host3, "vm_host3", 4, 2048, 100, NULL, 1024 * 20, 10,50);
+ msg_vm_t vm_host3 = MSG_vm_create(host3, "vm_host3", 2048, 10, 50);
MSG_vm_start(vm_host3);
XBT_INFO("Create two tasks on Host1: one inside a VM, the other directly on the host");
// TODO add VDI later
XBT_PUBLIC(msg_vm_t) MSG_vm_create_core(msg_host_t location, const char *name);
-XBT_PUBLIC(msg_vm_t) MSG_vm_create(msg_host_t ind_pm, const char *name,
- int core_nb, int mem_cap, int net_cap, char *disk_path, int disk_size, int mig_netspeed, int dp_intensity);
+XBT_PUBLIC(msg_vm_t)
+MSG_vm_create(msg_host_t ind_pm, const char* name, int ramsize, int mig_netspeed, int dp_intensity);
XBT_PUBLIC(void) MSG_vm_destroy(msg_vm_t vm);
MSG_vm_set_bound(vm, bound);
}
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
- jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath,
- jint jdisksize, jint jmig_netspeed, jint jdp_intensity)
+JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv* env, jobject jvm, jobject jhost, jstring jname,
+ jint jramsize, jint jmig_netspeed, jint jdp_intensity)
{
msg_host_t host = jhost_get_native(env, jhost);
- const char *name;
- name = env->GetStringUTFChars(jname, 0);
+ const char* name = env->GetStringUTFChars(jname, 0);
name = xbt_strdup(name);
// TODO disk concerns are not taken into account yet
// disk_path = (*env)->GetStringUTFChars(env, jdiskpath, 0);
// disk_path = xbt_strdup(disk_path);
- msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (int) jramsize, (int) jnetcap, nullptr, (int) jdisksize,
- (int) jmig_netspeed, (int) jdp_intensity);
+ msg_vm_t vm = MSG_vm_create(host, name, (int)jramsize, (int)jmig_netspeed, (int)jdp_intensity);
- jvm_bind(env,jvm,vm);
+ jvm_bind(env, jvm, vm);
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeFinalize(JNIEnv *env, jobject jvm)
* Method create
* Signature ()V
*/
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
- jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath,
- jint jdisksize, jint dprate, jint mig_netspeed);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv* env, jobject jvm, jobject jhost, jstring jname,
+ jint jramsize, jint dprate, jint mig_netspeed);
/**
* Class org_simgrid_msg_VM
/* Constructors / destructors */
/**
- * Create a `basic' VM (i.e. 1 core, 1GB of RAM, other values are not taken into account).
+ * Create a `basic' VM (i.e. 1GB of RAM, other values are not taken into account).
*/
public VM(Host host, String name) {
- this(host,name,1,1024, -1, null, -1,0 , 0);
+ this(host,name,1024, 0, 0);
}
/**
* Create a VM
* @param host Host node
* @param name name of the machine
- * @param nCore number of core
* @param ramSize size of the RAM that should be allocated (in MBytes)
- * @param netCap (not used for the moment)
- * @param diskPath (not used for the moment)
- * @param diskSize (not used for the moment)
* @param migNetSpeed (network bandwith allocated for migrations in MB/s, if you don't know put zero ;))
* @param dpIntensity (dirty page percentage according to migNetSpeed, [0-100], if you don't know put zero ;))
*/
- public VM(Host host, String name, int nCore, int ramSize,
- int netCap, String diskPath, int diskSize, int migNetSpeed, int dpIntensity){
+ public VM(Host host, String name, int ramSize, int migNetSpeed, int dpIntensity){
super();
super.name = name;
this.currentHost = host;
- create(host, name, nCore, ramSize, netCap, diskPath, diskSize, migNetSpeed, dpIntensity);
+ create(host, name, ramSize, migNetSpeed, dpIntensity);
vms.add(this);
}
/**
* Natively implemented method create the VM.
- * @param nCore number of core
* @param ramSize size of the RAM that should be allocated (in MB)
- * @param netCap (not used for the moment)
- * @param diskPath (not used for the moment)
- * @param diskSize (not used for the moment)
* @param migNetSpeed (network bandwith allocated for migrations in MB/s, if you don't know put zero ;))
* @param dpIntensity (dirty page intensity, a percentage of migNetSpeed [0-100], if you don't know put zero ;))
*/
- private native void create(Host host, String name, int nCore, int ramSize,
- int netCap, String diskPath, int diskSize, int migNetSpeed, int dpIntensity);
+ private native void create(Host host, String name, int ramSize, int migNetSpeed, int dpIntensity);
/**
/** @brief Create a new VM with specified parameters.
* @ingroup msg_VMs*
* @param pm Physical machine that will host the VM
- * @param name [TODO]
- * @param ncpus [TODO]
+ * @param name Must be unique
* @param ramsize [TODO]
- * @param net_cap Maximal bandwidth that the VM can consume (in MByte/s)
- * @param disk_path (unused) Path to the image that boots
- * @param disksize (unused) will represent the size of the VM (will be used during migrations)
* @param mig_netspeed Amount of Mbyte/s allocated to the migration (cannot be larger than net_cap). Use 0 if unsure.
* @param dp_intensity Dirty page percentage according to migNetSpeed, [0-100]. Use 0 if unsure.
*/
-msg_vm_t MSG_vm_create(msg_host_t pm, const char* name, int ncpus, int ramsize, int net_cap, char* disk_path,
- int disksize, int mig_netspeed, int dp_intensity)
+msg_vm_t MSG_vm_create(msg_host_t pm, const char* name, int ramsize, int mig_netspeed, int dp_intensity)
{
simgrid::vm::VmHostExt::ensureVmExtInstalled();
s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = (sg_size_t)ramsize * 1024 * 1024;
- //params.overcommit = 0;
params.devsize = 0;
params.skip_stage2 = 0;
params.max_downtime = 0.03;
msg_vm_t vm0;
msg_process_t daemon;
- vm0 = MSG_vm_create (jupiter, "vm0", 1, 2048, 125, NULL, -1, 125, dpRate);
+ vm0 = MSG_vm_create(jupiter, "vm0", 2048, 125, dpRate);
MSG_vm_start(vm0);
argvF = xbt_new(char*, 2);