Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f408ecd0
authored
Nov 28, 2025
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fured fix
parent
840dd333
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
celeryconfig.py
+2
-2
miscellaneous/netdriver.sudo
+3
-0
vmdriver.py
+12
-6
No files found.
celeryconfig.py
View file @
f408ecd0
result_backend
=
'amqp://'
task_result_expires
=
300
result_expires
=
300
timezone
=
'
utc
'
timezone
=
'
UTC
'
enable_utc
=
True
accept_content
=
[
'json'
,
'pickle_v2'
]
accept_content
=
[
'json'
,
'pickle_v2'
,
'pickle'
]
task_serializer
=
'json'
result_serializer
=
'pickle_v2'
task_store_errors_even_if_ignored
=
True
...
...
miscellaneous/netdriver.sudo
0 → 100644
View file @
f408ecd0
Defaults: cloud !requiretty
cloud ALL = (ALL) NOPASSWD: /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl, /sbin/ip link set *
vmdriver.py
View file @
f408ecd0
...
...
@@ -198,24 +198,31 @@ def create(vm_desc):
return
vm_xml_dump
class
shutdown
(
AbortableTask
):
@celery.task
(
name
=
'vmdriver.shutdown'
,
bind
=
True
,
base
=
AbortableTask
,
time_limit
=
120
,
)
@req_connection
@wrap_libvirtError
def
shutdown
(
self
,
args
):
""" Shutdown virtual machine (need ACPI support).
Return When domain is missiing.
This job is abortable:
AbortableAsyncResult(id="<<jobid>>").abort()
"""
time_limit
=
120
@req_connection
def
run
(
self
,
args
):
from
time
import
sleep
name
,
=
args
logger
.
info
(
"Shutdown started for vm:
%
s"
,
name
)
try
:
# VM lookup
domain
=
lookupByName
(
name
)
logger
.
info
(
"
%
s domain found in shutdown"
,
name
)
# ACPI shutdown
domain
.
shutdown
()
logger
.
info
(
"Domain shutdown called for vm:
%
s"
,
name
)
# Wait for disappearance
while
True
:
try
:
Connection
.
get
()
.
lookupByName
(
name
)
...
...
@@ -234,7 +241,6 @@ class shutdown(AbortableTask):
new_e
.
libvirtError
=
True
raise
new_e
@celery.task
@req_connection
@wrap_libvirtError
...
...
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