change to directory
cd /usr/share/pyshared/nova/scheduler/weights
add a new weight function
vim disk.py
go to bin directory
cd /usr/lib/python2.7/dist-packages/nova/scheduler/weights
sudo ln -s /usr/share/pyshared/nova/scheduler/weights/disk.py disk.py
change host_manager_opts
cfg.ListOpt('scheduler_default_filter',
default=[
'RetryFilter',
'AvailabilityZoneFilter',
'RamFilter',
'CoreFilter',
'ComputeFilter'
...])
change default val
cpu_allocation_ratio = 1.0
ram_allocation_ratio = 1.0
compile .py to .pyc
python -m py_compile file.py