Commit 8700a6da by Guba Sándor

add async_queue parameters to use slow queue for long tasks

parent 611af2e3
...@@ -215,6 +215,7 @@ class DownloadDiskOperation(InstanceOperation): ...@@ -215,6 +215,7 @@ class DownloadDiskOperation(InstanceOperation):
has_percentage = True has_percentage = True
required_perms = ('storage.download_disk', ) required_perms = ('storage.download_disk', )
accept_states = ('STOPPED', 'PENDING', 'RUNNING') accept_states = ('STOPPED', 'PENDING', 'RUNNING')
async_queue = "localhost.man.slow"
def _operation(self, user, url, task, activity, name=None): def _operation(self, user, url, task, activity, name=None):
activity.result = url activity.result = url
...@@ -356,6 +357,7 @@ class MigrateOperation(InstanceOperation): ...@@ -356,6 +357,7 @@ class MigrateOperation(InstanceOperation):
"seconds of interruption (live migration).") "seconds of interruption (live migration).")
required_perms = () required_perms = ()
accept_states = ('RUNNING', ) accept_states = ('RUNNING', )
async_queue = "localhost.man.slow"
def rollback(self, activity): def rollback(self, activity):
with activity.sub_activity( with activity.sub_activity(
...@@ -506,6 +508,7 @@ class SaveAsTemplateOperation(InstanceOperation): ...@@ -506,6 +508,7 @@ class SaveAsTemplateOperation(InstanceOperation):
abortable = True abortable = True
required_perms = ('vm.create_template', ) required_perms = ('vm.create_template', )
accept_states = ('RUNNING', 'PENDING', 'STOPPED') accept_states = ('RUNNING', 'PENDING', 'STOPPED')
async_queue = "localhost.man.slow"
def is_preferred(self): def is_preferred(self):
return (self.instance.is_base and return (self.instance.is_base and
...@@ -664,6 +667,7 @@ class SleepOperation(InstanceOperation): ...@@ -664,6 +667,7 @@ class SleepOperation(InstanceOperation):
"storage resources, and keep network resources allocated.") "storage resources, and keep network resources allocated.")
required_perms = () required_perms = ()
accept_states = ('RUNNING', ) accept_states = ('RUNNING', )
async_queue = "localhost.man.slow"
def is_preferred(self): def is_preferred(self):
return (not self.instance.is_base and return (not self.instance.is_base and
...@@ -830,6 +834,7 @@ class FlushOperation(NodeOperation): ...@@ -830,6 +834,7 @@ class FlushOperation(NodeOperation):
name = _("flush") name = _("flush")
description = _("Disable node and move all instances to other ones.") description = _("Disable node and move all instances to other ones.")
required_perms = () required_perms = ()
async_queue = "localhost.man.slow"
def on_abort(self, activity, error): def on_abort(self, activity, error):
from manager.scheduler import TraitsUnsatisfiableException from manager.scheduler import TraitsUnsatisfiableException
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment