diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml
index 6998277548..56d3137ea8 100644
--- a/src/sunstone/etc/sunstone-views/admin.yaml
+++ b/src/sunstone/etc/sunstone-views/admin.yaml
@@ -215,6 +215,7 @@ tabs:
vm_snapshot_tab: true
vm_placement_tab: true
vm_actions_tab: true
+ vm_conf_tab: true
vm_template_tab: true
vm_log_tab: true
table_columns:
@@ -273,6 +274,7 @@ tabs:
VM.resched: true
VM.unresched: true
VM.saveas_template: true
+ VM.updateconf: true
oneflow-services-tab:
panel_tabs:
service_info_tab: true
diff --git a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml
index cd9e81f03d..be109db7a1 100644
--- a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml
+++ b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml
@@ -215,6 +215,7 @@ tabs:
vm_snapshot_tab: true
vm_placement_tab: true
vm_actions_tab: true
+ vm_conf_tab: false
vm_template_tab: true
vm_log_tab: true
table_columns:
@@ -273,6 +274,7 @@ tabs:
VM.resched: true
VM.unresched: true
VM.saveas_template: false
+ VM.updateconf: false
oneflow-services-tab:
panel_tabs:
service_info_tab: true
diff --git a/src/sunstone/etc/sunstone-views/groupadmin.yaml b/src/sunstone/etc/sunstone-views/groupadmin.yaml
index 1b841f24a0..a9f0842525 100644
--- a/src/sunstone/etc/sunstone-views/groupadmin.yaml
+++ b/src/sunstone/etc/sunstone-views/groupadmin.yaml
@@ -214,6 +214,7 @@ tabs:
vm_snapshot_tab: false
vm_placement_tab: false
vm_actions_tab: false
+ vm_conf_tab: false
vm_template_tab: false
vm_log_tab: false
table_columns:
@@ -272,6 +273,7 @@ tabs:
VM.resched: false
VM.unresched: false
VM.saveas_template: true
+ VM.updateconf: false
oneflow-services-tab:
panel_tabs:
service_info_tab: true
diff --git a/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml b/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml
index 2179a918a5..3fa9259f50 100644
--- a/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml
+++ b/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml
@@ -216,6 +216,7 @@ tabs:
vm_snapshot_tab: false
vm_placement_tab: false
vm_actions_tab: false
+ vm_conf_tab: false
vm_template_tab: false
vm_log_tab: false
table_columns:
@@ -274,6 +275,7 @@ tabs:
VM.resched: false
VM.unresched: false
VM.saveas_template: false
+ VM.updateconf: false
oneflow-services-tab:
panel_tabs:
service_info_tab: true
diff --git a/src/sunstone/etc/sunstone-views/user.yaml b/src/sunstone/etc/sunstone-views/user.yaml
index 2b87cf26cb..9436ff7597 100644
--- a/src/sunstone/etc/sunstone-views/user.yaml
+++ b/src/sunstone/etc/sunstone-views/user.yaml
@@ -218,6 +218,7 @@ tabs:
vm_snapshot_tab: true
vm_placement_tab: false
vm_actions_tab: true
+ vm_conf_tab: true
vm_template_tab: false
vm_log_tab: false
table_columns:
@@ -276,6 +277,7 @@ tabs:
VM.resched: false
VM.unresched: false
VM.saveas_template: true
+ VM.updateconf: true
oneflow-services-tab:
panel_tabs:
service_info_tab: true
diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb
index b76067e2a0..675319e00f 100644
--- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb
+++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb
@@ -72,6 +72,7 @@ module OpenNebulaJSON
when "attachnic" then self.nic_attach(action_hash['params'])
when "detachnic" then self.nic_detach(action_hash['params'])
when "update" then self.update(action_hash['params'])
+ when "updateconf" then self.updateconf(action_hash['params'])
when "rename" then self.rename(action_hash['params'])
when "undeploy" then self.undeploy(action_hash['params'])
when "resched" then self.resched
@@ -180,6 +181,10 @@ module OpenNebulaJSON
end
end
+ def updateconf(params=Hash.new)
+ super(params['template_raw'])
+ end
+
def rename(params=Hash.new)
super(params['name'])
end
diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js
index aa0a71979a..6a25f35431 100644
--- a/src/sunstone/public/app/opennebula/vm.js
+++ b/src/sunstone/public/app/opennebula/vm.js
@@ -476,6 +476,10 @@ define(function(require) {
var action_obj = {"template_raw" : params.data.extra_param};
OpenNebulaAction.simple_action(params, RESOURCE, "update", action_obj);
},
+ "updateconf": function(params) {
+ var action_obj = {"template_raw" : params.data.extra_param};
+ OpenNebulaAction.simple_action(params, RESOURCE, "updateconf", action_obj);
+ },
"monitor" : function(params) {
OpenNebulaAction.monitor(params, RESOURCE, false);
},
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js
index a6b0233d72..d47b5d6c1a 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js
@@ -28,6 +28,7 @@ define(function(require) {
var FilesTable = require('tabs/files-tab/datatable')
var OpenNebulaHost = require('opennebula/host');
var UserInputs = require('utils/user-inputs');
+ var UniqueId = require('utils/unique-id');
/*
TEMPLATES
@@ -50,12 +51,12 @@ define(function(require) {
throw "Wizard Tab not enabled";
}
- this.wizardTabId = WIZARD_TAB_ID;
+ this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
this.icon = 'fa-folder';
this.title = Locale.tr("Context");
this.classes = "hypervisor only_kvm only_vcenter";
- this.contextFilesTable = new FilesTable(this.wizardTabId + 'ContextTable', {
+ this.contextFilesTable = new FilesTable('ContextTable' + UniqueId.id(), {
'select': true,
'selectOptions': {
'multiple_choice': true,
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context/html.hbs
index cacdbe558a..7e54e8e0aa 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context/html.hbs
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context/html.hbs
@@ -99,19 +99,17 @@
-
-
-
-
-
+
+
+
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js
index 278bd4637b..3e7082878f 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js
@@ -25,6 +25,7 @@ define(function(require) {
var WizardFields = require('utils/wizard-fields');
var Config = require('sunstone-config');
var UserInputs = require('utils/user-inputs');
+ var UniqueId = require('utils/unique-id');
/*
TEMPLATES
@@ -43,7 +44,7 @@ define(function(require) {
*/
function WizardTab() {
- this.wizardTabId = WIZARD_TAB_ID;
+ this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
this.icon = 'fa-laptop';
this.title = Locale.tr("General");
}
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/hybrid.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/hybrid.js
index 257e01019d..3ce9940d41 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/hybrid.js
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/hybrid.js
@@ -24,6 +24,7 @@ define(function(require) {
var Locale = require('utils/locale');
var Tips = require('utils/tips');
var WizardFields = require('utils/wizard-fields');
+ var UniqueId = require('utils/unique-id');
/*
TEMPLATES
@@ -229,7 +230,7 @@ define(function(require) {
throw "Wizard Tab not enabled";
}
- this.wizardTabId = WIZARD_TAB_ID;
+ this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
this.icon = 'fa-cloud';
this.title = Locale.tr("Hybrid");
}
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/io.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/io.js
index 32c3b58df7..ba1a70c728 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/io.js
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/io.js
@@ -24,6 +24,7 @@ define(function(require) {
var Tips = require('utils/tips');
var WizardFields = require('utils/wizard-fields');
var TemplateUtils = require('utils/template-utils');
+ var UniqueId = require('utils/unique-id');
/*
TEMPLATES
@@ -46,7 +47,7 @@ define(function(require) {
throw "Wizard Tab not enabled";
}
- this.wizardTabId = WIZARD_TAB_ID;
+ this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
this.icon = 'fa-exchange';
this.title = Locale.tr("Input/Output");
}
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/io/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/io/html.hbs
index 94135b78e3..c96b8bb902 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/io/html.hbs
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/io/html.hbs
@@ -27,7 +27,7 @@
-
+
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network.js
index 84d1ec9242..180915779e 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network.js
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network.js
@@ -25,6 +25,7 @@ define(function(require) {
var Tips = require('utils/tips');
var WizardFields = require('utils/wizard-fields');
var NicTab = require('./network/nic-tab');
+ var UniqueId = require('utils/unique-id');
/*
TEMPLATES
@@ -49,7 +50,7 @@ define(function(require) {
throw "Wizard Tab not enabled";
}
- this.wizardTabId = WIZARD_TAB_ID;
+ this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
this.icon = 'fa-globe';
this.title = Locale.tr("Network");
this.classes = "hypervisor only_kvm only_vcenter"
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os.js
index 824bb74bd4..fd7d0c205c 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os.js
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/os.js
@@ -25,6 +25,7 @@ define(function(require) {
var Tips = require('utils/tips');
var WizardFields = require('utils/wizard-fields');
var FilesTable = require('tabs/files-tab/datatable');
+ var UniqueId = require('utils/unique-id');
/*
TEMPLATES
@@ -141,21 +142,23 @@ define(function(require) {
throw "Wizard Tab not enabled";
}
- this.wizardTabId = WIZARD_TAB_ID;
+ this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
this.icon = 'fa-power-off';
this.title = Locale.tr("OS Booting");
this.classes = "hypervisor only_kvm"
- this.kernelFilesTable = new FilesTable(this.wizardTabId + 'KernelTable', {
- 'select': true,
- 'selectOptions': {
- "filter_fn": function(file) { return file.TYPE == 3; } // KERNEL
+ this.kernelFilesTable = new FilesTable(
+ this.wizardTabId + UniqueId.id(),
+ { 'select': true,
+ 'selectOptions': {
+ "filter_fn": function(file) { return file.TYPE == 3; } // KERNEL
}
});
- this.initrdFilesTable = new FilesTable(this.wizardTabId + 'InitrdTable', {
- 'select': true,
- 'selectOptions': {
- "filter_fn": function(file) { return file.TYPE == 4; } // RAMDISK
+ this.initrdFilesTable = new FilesTable(
+ this.wizardTabId + UniqueId.id(),
+ { 'select': true,
+ 'selectOptions': {
+ "filter_fn": function(file) { return file.TYPE == 4; } // RAMDISK
}
});
}
@@ -272,6 +275,15 @@ define(function(require) {
function _fill(context, templateJSON) {
var osJSON = templateJSON['OS'];
if (osJSON) {
+
+ if (osJSON['KERNEL_DS'] == undefined && osJSON['KERNEL'] != undefined){
+ $('input#radioKernelPath', context).click();
+ }
+
+ if (osJSON['INITRD_DS'] == undefined && osJSON['INITRD'] != undefined){
+ $('input#radioInitrdPath', context).click();
+ }
+
WizardFields.fill(context, osJSON);
if (osJSON && osJSON['BOOT']) {
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other.js
index af4f4c1452..bb98ead3ae 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other.js
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other.js
@@ -26,6 +26,7 @@ define(function(require) {
var TemplateUtils = require('utils/template-utils');
var CustomTagsTable = require('utils/custom-tags-table');
var OpenNebulaHost = require('opennebula/host');
+ var UniqueId = require('utils/unique-id');
/*
TEMPLATES
@@ -49,7 +50,7 @@ define(function(require) {
throw "Wizard Tab not enabled";
}
- this.wizardTabId = WIZARD_TAB_ID;
+ this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
this.icon = 'fa-ellipsis-h';
this.title = Locale.tr("Other");
}
@@ -146,12 +147,15 @@ define(function(require) {
var templateJSON = CustomTagsTable.retrieve(context);
var rawJSON = {}
- t = $('#raw_type', context).val();
- if (t) { rawJSON['TYPE'] = t; }
- t = TemplateUtils.escapeDoubleQuotes($('#raw_data', context).val());
- if (t) { rawJSON['DATA'] = t; }
- t = TemplateUtils.escapeDoubleQuotes($('#raw_data_vmx', context).val());
- if (t) { rawJSON['DATA_VMX'] = t; }
+ var rawData = TemplateUtils.escapeDoubleQuotes($('#raw_data', context).val());
+ if (rawData != "") {
+ rawJSON['DATA'] = rawData;
+
+ var rawType = $('#raw_type', context).val();
+ if (rawType != undefined) {
+ rawJSON['TYPE'] = rawType;
+ }
+ }
if (!$.isEmptyObject(rawJSON)) { templateJSON['RAW'] = rawJSON; };
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other/html.hbs
index b654d8863f..f658477f7e 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other/html.hbs
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/other/html.hbs
@@ -21,8 +21,7 @@
-
@@ -35,7 +34,7 @@
-