Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
cc-node
Commits
b9ff8338
Commit
b9ff8338
authored
9 years ago
by
Antoine Millet
Browse files
Options
Downloads
Patches
Plain Diff
Implemented VM cycle
parent
fb9cb22e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cloudcontrol/node/hypervisor/__init__.py
+16
-0
16 additions, 0 deletions
cloudcontrol/node/hypervisor/__init__.py
with
16 additions
and
0 deletions
cloudcontrol/node/hypervisor/__init__.py
+
16
−
0
View file @
b9ff8338
...
...
@@ -14,6 +14,7 @@
# along with CloudControl. If not, see <http://www.gnu.org/licenses/>.
import
time
import
logging
import
socket
import
json
...
...
@@ -355,6 +356,21 @@ class Handler(HostHandler):
logger
.
error
(
msg
)
raise
UndefinedDomain
(
msg
)
@libvirt_handler
def
vm_cycle
(
self
,
name
):
logger
.
debug
(
'
VM cycle %s
'
,
name
)
try
:
self
.
hypervisor
.
domains
[
name
].
destroy
()
time
.
sleep
(
1
)
self
.
hypervisor
.
domains
[
name
].
start
()
except
libvirt
.
libvirtError
:
logger
.
exception
(
'
Error while cycle VM %s
'
,
name
)
raise
except
KeyError
:
msg
=
'
Cannot cycle VM %s because it is not defined
'
%
name
logger
.
error
(
msg
)
raise
UndefinedDomain
(
msg
)
@libvirt_handler
def
vm_change_title
(
self
,
name
,
new_title
):
logger
.
debug
(
'
VM edit title %s
'
,
name
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment