vm调整相关算法(草稿)

记录一下自己整理的杂七杂八

algorithm3: VM_Resizing_SelectDestPM
input:  cannot_resize_vm_list,  vm_migration_list
output:  destPM_list

destPM_list = []
for(vm in vm_migration_list):
    min_priority = MAX_VALUE;
    dest_pm = null;
    for(pm in pm_list):
        if(pm 接收vm后不处于S3状态)
            if(priority(pm)< min_priority):
                min_priority t = priority(pm)
                dest_pm = pm
    end for
    if(dest_pm==null)
        dest_pm = 新启动的PM
    destPM_list += dest_pm
end for



algorithm2:VM_Resizing_SelectVM
input:cannot_resize_vm_list, demand_list, pm_list
output:vm_migration_list,  resize_inplace_list

vm_migration_list = []
resize_inplace_list = []
for(i=0;inull
    for(vm in pm_list[i]):
        if(物理机能满足要求,且满足后不会处于S3状态 
            && priority(vm) end for

    if(migrate_vm== cannot_resize_vm_list[i])
        resize_inplace_list[i] = false;
    else
        resize_inplace_list[i] = true;

    vm_migration_list += migrate_vm

end for


algorithm1、VM_Adjust
input:vm_list

cannot_resize_vm_list = []
demand_list = []
pm_list = []
for vm in vm_list:
    if(VM有资源利用率处于S3状态):
        new_demand = 原资源需求*1.5
        if(物理机能满足要求,且满足后不会处于S3状态)
            resizing
            update PM resource
        else
            cannot_resize_vm_list += 此VM
            demand_list += new_demand
            pm_list += 此VM所在PM
end for

vm_migration_list = VM_Resizing_SelectVM(cannot_resize_vm_list,demand_list,pm_list)

destPM_list = VM_Resizing_SelectDestPM(vm_migration_list)

execute migration and resize action

你可能感兴趣的:(研究相关)