-/** @brief Create a new VM with specified parameters.
- * @ingroup msg_VMs*
- * @param pm Physical machine that will host the VM
- * @param name Must be unique
- * @param coreAmount Must be >= 1
- * @param ramsize [TODO]
- * @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 coreAmount, int ramsize, int mig_netspeed, int dp_intensity)
-{
- simgrid::vm::VmHostExt::ensureVmExtInstalled();
-
- /* For the moment, intensity_rate is the percentage against the migration bandwidth */
-
- msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, coreAmount, static_cast<sg_size_t>(ramsize) * 1024 * 1024);
- s_vm_params_t params;
- params.max_downtime = 0.03;
- params.mig_speed = static_cast<double>(mig_netspeed) * 1024 * 1024; // mig_speed
- params.dp_intensity = static_cast<double>(dp_intensity) / 100;
- params.dp_cap = vm->getRamsize() * 0.9; // assume working set memory is 90% of ramsize
-
- XBT_DEBUG("migspeed : %f intensity mem : %d", params.mig_speed, dp_intensity);
- vm->setParameters(¶ms);
-
- return vm;
-}
-