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
snf-ganeti
Commits
3a7c308e
Commit
3a7c308e
authored
Jul 19, 2007
by
Guido Trotter
Browse files
Check for memory size requirements before failing over an instance.
Reviewed-By: iustinp
parent
16ebf761
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/cmdlib.py
View file @
3a7c308e
...
...
@@ -2059,6 +2059,19 @@ class LUFailoverInstance(LogicalUnit):
raise
errors
.
OpPrereqError
,
(
"Instance '%s' not known"
%
self
.
op
.
instance_name
)
# check memory requirements on the secondary node
target_node
=
instance
.
secondary_nodes
[
0
]
nodeinfo
=
rpc
.
call_node_info
([
target_node
],
self
.
cfg
.
GetVGName
())
info
=
nodeinfo
.
get
(
target_node
,
None
)
if
not
info
:
raise
errors
.
OpPrereqError
,
(
"Cannot get current information"
" from node '%s'"
%
nodeinfo
)
if
instance
.
memory
>
info
[
'memory_free'
]:
raise
errors
.
OpPrereqError
,
(
"Not enough memory on target node %s."
" %d MB available, %d MB required"
%
(
target_node
,
info
[
'memory_free'
],
instance
.
memory
))
# check bridge existance
brlist
=
[
nic
.
bridge
for
nic
in
instance
.
nics
]
if
not
rpc
.
call_bridges_exist
(
instance
.
primary_node
,
brlist
):
...
...
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