# File lib/fission/action/vm/cloner.rb, line 35 def clone unless @source_vm.exists? return Response.new :code => 1, :message => 'VM does not exist' end if @target_vm.exists? return Response.new :code => 1, :message => 'VM already exists' end FileUtils.cp_r @source_vm.path, @target_vm.path rename_vm_files @source_vm.name, @target_vm.name update_config @source_vm.name, @target_vm.name Response.new :code => 0 end