Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
89214a55
Commit
89214a55
authored
Jul 23, 2012
by
Christos Stavrakakis
Browse files
Consider cpu ratio when allocating vm's
parent
67ed2904
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/logic/allocators/default_allocator.py
View file @
89214a55
...
...
@@ -67,5 +67,5 @@ def vm_fits_in_backend(backend, vm):
def
backend_score
(
backend
,
flavor
):
mratio
=
1
-
(
backend
[
'mfree'
]
/
backend
[
'mtotal'
])
dratio
=
1
-
(
backend
[
'dfree'
]
/
backend
[
'dtotal'
])
#
cratio = (backend
.
pinst_cnt
+1)/
backend
.
ctotal
return
0.
5
*
(
mratio
+
dratio
)
cratio
=
(
backend
[
'
pinst_cnt
'
]
+
1
)
/
(
backend
[
'
ctotal
'
]
*
4
)
return
0.
7
*
(
mratio
+
dratio
)
*
0.3
*
cratio
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment