diff --git a/app/models/vm_or_template/operations.rb b/app/models/vm_or_template/operations.rb index 7a6e56dccae..772785a8d11 100644 --- a/app/models/vm_or_template/operations.rb +++ b/app/models/vm_or_template/operations.rb @@ -75,6 +75,24 @@ def rename(new_name) raw_rename(new_name) end + def rename_queue(userid, new_name) + task_opts = { + :action => "Renaming VM for user #{userid}", + :userid => userid + } + + queue_opts = { + :class_name => self.class.name, + :method_name => 'rename', + :instance_id => id, + :role => 'ems_operations', + :zone => my_zone, + :args => [new_name] + } + + MiqTask.generic_action_with_callback(task_opts, queue_opts) + end + private #