}
}
+ // TODO: migrate apps to get an empty VM and shut it down.
+ // TODO: run all delayed.
+
for (SchedulerEvent evt : events) {
if (evt.getType() == EventType.startApplication) {
VirtualMachine vm = null;
* Set the VM size to the given new values.
*
* @param newSize
+ * the new size of the VM, excluding the initial consumption.
* @param newRAM
+ * the new RAM of the VM, excluding the initial consumption.
* @param newCPU
+ * the new CPU of the VM, excluding the initial consumption.
* @return
*/
public boolean resizeVM(int newSize, int newRAM, int newCPU) {
- if (type == VMType.Resizable && runningOn.checkVM(newSize, newRAM, newCPU)) {
+ if (type == VMType.Resizable
+ && runningOn.checkVM(newSize - reservedSize, newRAM - reservedRAM, newCPU - reservedCPU)) {
// Resize VM
reservedSize = initialSize + newSize;
reservedRAM = initialRAM + newRAM;