Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cd43c8bd
authored
Feb 18, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
instance/node: fixed monitoring for missin vms
parent
e056cb01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
circle/vm/models/instance.py
+7
-2
circle/vm/models/node.py
+2
-0
No files found.
circle/vm/models/instance.py
View file @
cd43c8bd
...
@@ -286,8 +286,13 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -286,8 +286,13 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
def
vm_state_changed
(
self
,
new_state
):
def
vm_state_changed
(
self
,
new_state
):
try
:
try
:
act
=
InstanceActivity
.
create
(
code_suffix
=
'vm_state_changed'
,
act
=
InstanceActivity
.
create
(
instance
=
self
)
code_suffix
=
'monitor_event_
%
s'
%
new_state
,
instance
=
self
)
if
new_state
==
"STOPPED"
:
self
.
vnc_port
=
None
self
.
node
=
None
self
.
save
()
except
ActivityInProgressError
:
except
ActivityInProgressError
:
pass
# discard state change if another activity is in progress.
pass
# discard state change if another activity is in progress.
else
:
else
:
...
...
circle/vm/models/node.py
View file @
cd43c8bd
...
@@ -194,6 +194,8 @@ class Node(TimeStampedModel):
...
@@ -194,6 +194,8 @@ class Node(TimeStampedModel):
except
KeyError
:
except
KeyError
:
logger
.
info
(
'Node
%
s update: instance
%
s missing from '
logger
.
info
(
'Node
%
s update: instance
%
s missing from '
'libvirt'
,
self
,
i
[
'id'
])
'libvirt'
,
self
,
i
[
'id'
])
# Set state to STOPPED when instance is missing
self
.
instance_set
.
get
(
id
=
i
[
'id'
])
.
vm_state_changed
(
'STOPPED'
)
else
:
else
:
if
d
!=
i
[
'state'
]:
if
d
!=
i
[
'state'
]:
logger
.
info
(
'Node
%
s update: instance
%
s state changed '
logger
.
info
(
'Node
%
s update: instance
%
s state changed '
...
...
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