示例#1
0
 public void RemoveMigratingInVm(Vm vm)
 {
     VmDeallocate(vm);
     VmsMigratingIn.Remove(vm);
     VmList.Remove(vm);
     VmScheduler.VmsMigratingIn.Remove(vm.Uid);
     vm.InMigration = false;
 }
示例#2
0
        public void AddMigratingInVm(Vm vm)
        {
            vm.InMigration = true;

            if (!VmsMigratingIn.Contains(vm))
            {
                if (Storage < vm.Size)
                {
                    Log.WriteConcatLine("[VmScheduler.addMigratingInVm] Allocation of VM #", vm.Id, " to Host #",
                                        Id, " failed by storage");
                    Environment.Exit(0);
                }

                if (!RamProvisioner.AllocateRamForVm(vm, vm.GetCurrentRequestedRam()))
                {
                    Log.WriteConcatLine("[VmScheduler.addMigratingInVm] Allocation of VM #", vm.Id, " to Host #",
                                        Id, " failed by RAM");
                    Environment.Exit(0);
                }

                if (!BwProvisioner.AllocateBwForVm(vm, vm.GetCurrentRequestedBw()))
                {
                    Log.WriteLine("[VmScheduler.addMigratingInVm] Allocation of VM #" + vm.Id + " to Host #"
                                  + Id + " failed by BW");
                    Environment.Exit(0);
                }

                VmScheduler.VmsMigratingIn.Add(vm.Uid);
                if (!VmScheduler.AllocatePesForVm(vm, vm.GetCurrentRequestedMips()))
                {
                    Log.WriteLine("[VmScheduler.addMigratingInVm] Allocation of VM #" + vm.Id + " to Host #"
                                  + Id + " failed by MIPS");
                    Environment.Exit(0);
                }

                Storage = Storage - vm.Size;

                VmsMigratingIn.Add(vm);
                VmList.Add(vm);
                UpdateVmsProcessing(Core.CloudSim.Clock);
                vm.Host.UpdateVmsProcessing(Core.CloudSim.Clock);
            }
        }