Skip to content

Instantly share code, notes, and snippets.

@superlayone
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save superlayone/9802880 to your computer and use it in GitHub Desktop.

Select an option

Save superlayone/9802880 to your computer and use it in GitHub Desktop.
Nova scheduler weight function

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment