虚拟机启动过程浅析

时间:2022-12-23 19:09:26
VmListModel.java
run()-->
RunVmCommand.java
  canDoAction()-->
    RunVmValidator.java
    canRunVm()-->SchedulingManager.getInstance().canSchedule()
      SchedulingManager.java
      它会先load一些策略-->init()-->loadPolicyUnits()/loadClusterPolicies()
      canSchedule()-->1.用来将主机加入黑白名单 -->runFilters()-->2. 根据前面load的策略进行匹配-->
        PolicyUnitImpl.java--内存匹配
        getPolicyUnitImpl()-->
          MemoryPolicyUnit.java
          MemoryPolicyUnit()-->filter()
  runVm()-->getVdsToRunOn()-->
    SchedulingManager.java
    schedule()-->1.用来将主机加入黑白名单,看哪台主机适合启动虚拟机 -->runFilters()-->selectBestHost()