Commit f696fb61 authored by Dietmar Maurer's avatar Dietmar Maurer

clone: use new API entry point

parent 231d98f9
...@@ -7,25 +7,26 @@ Ext.define('PVE.window.Clone', { ...@@ -7,25 +7,26 @@ Ext.define('PVE.window.Clone', {
create_clone: function(snapname, name, newvmid, clonemode, storage, format, diskarray) { create_clone: function(snapname, name, newvmid, clonemode, storage, format, diskarray) {
var me = this; var me = this;
params = { name: name, clonefrom: me.vmid, vmid: newvmid, clonemode: clonemode }; params = { name: name, newid: newvmid };
if (snapname && snapname !== 'current') { if (snapname && snapname !== 'current') {
params.snapname = snapname; params.snapname = snapname;
} }
if (clonemode === 'copy' && storage){ if (clonemode === 'copy') {
params.full = 1;
Ext.Array.each(diskarray, function(disk) { if (storage) {
var myformat = format ? format : ''; params.storage = storage;
params[disk] = storage + ':' + myformat; if (format) {
}); params.format = format;
}
}
} }
PVE.Utils.API2Request({ PVE.Utils.API2Request({
params: params, params: params,
url: '/nodes/' + me.nodename + '/qemu', url: '/nodes/' + me.nodename + '/qemu/' + me.vmid + '/clone',
waitMsgTarget: me, waitMsgTarget: me,
method: 'POST', method: 'POST',
failure: function(response, opts) { failure: function(response, opts) {
......
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 to comment