Added engine_name parameter to action creation.

With implementation of new engines (nova, rsync, ...) a regression was
introduced - user is no longer able to create working action for nova instance
backup because config generated by freezer-scheduler passed to freezer-agent
doesn't contain 'engine_name' thus falling back to default value 'tar'
even when 'mode' is set to 'nova'. This patch adds possibility to specify
'engine_name' in web UI which is then passed to freezer-scheduler job cfg.

Change-Id: Ifc4ed728db369da54fecef3c2ecf4dfcbfe4fefb
This commit is contained in:
Jakub Jursa 2018-05-17 13:05:12 +02:00
parent 6bf20357fe
commit 357117beff
1 changed files with 22 additions and 0 deletions

View File

@ -41,6 +41,18 @@ class ActionConfigurationAction(workflows.Action):
storage = forms.ChoiceField(
help_text=_("Set storage backend for a backup"))
engine_name = forms.ChoiceField(
help_text=_("Engine to be used for backup/restore. "
"With tar, the file inode will be checked for changes "
"amid backup execution. If the file inode changed, the "
"whole file will be backed up. With rsync, the data "
"blocks changes will be verified and only the changed "
"blocks will be backed up. Tar is faster, but is uses "
"more space and bandwidth. Rsync is slower, but uses "
"less space and bandwidth. Nova engine can be used to"
" backup/restore running instances. Backing up instances"
" and it's metadata."))
mysql_conf = forms.CharField(
label=_("MySQL Configuration File *"),
help_text=_("Set the path where the MySQL configuration file "
@ -247,6 +259,15 @@ class ActionConfigurationAction(workflows.Action):
('ssh', _("SSH")),
]
def populate_engine_name_choices(self, request, context):
return [
('tar', _("tar")),
('rsync', _("rsync")),
('rsyncv2', _("rsyncv2")),
('nova', _("nova")),
('osbrick', _("osbrick")),
]
def __init__(self, request, context, *args, **kwargs):
self.request = request
self.context = context
@ -265,6 +286,7 @@ class ActionConfiguration(workflows.Step):
'action',
'mode',
'storage',
'engine_name',
'backup_name',
'mysql_conf',
'sql_server_conf',