mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8301: Enable configuring local storage use for system VMs at zone level. This commit contains the UI changes for the feature.
Signed-off-by: Koushik Das <koushik@apache.org> This closes #259
This commit is contained in:
parent
8ff90008b8
commit
2148dca24b
@ -757,7 +757,8 @@ label.load.balancer=Load Balancer
|
||||
label.load.balancing.policies=Load balancing policies
|
||||
label.load.balancing=Load Balancing
|
||||
label.loading=Loading
|
||||
label.local.storage.enabled=Local storage enabled
|
||||
label.local.storage.enabled=Enable local storage for User VMs
|
||||
label.local.storage.enabled.system.vms=Enable local storage for System VMs
|
||||
label.local.storage=Local Storage
|
||||
label.local=Local
|
||||
label.login=Login
|
||||
|
||||
@ -1057,6 +1057,7 @@ under the License.
|
||||
'label.add.private.gateway': '<fmt:message key="label.add.private.gateway" />',
|
||||
'label.ovm3.pool': '<fmt:message key="label.ovm3.pool" />',
|
||||
'label.ovm3.cluster': '<fmt:message key="label.ovm3.cluster" />',
|
||||
'label.ovm3.vip': '<fmt:message key="label.ovm3.vip" />'
|
||||
'label.ovm3.vip': '<fmt:message key="label.ovm3.vip" />',
|
||||
'label.local.storage.enabled.system.vms': '<fmt:message key="label.local.storage.enabled.system.vms" />'
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -388,7 +388,10 @@
|
||||
},
|
||||
|
||||
addPrimaryStorage: function(args) {
|
||||
return args.data.localstorageenabled != 'on';
|
||||
if(args.data.localstorageenabled == 'on' && args.data.localstorageenabledforsystemvm == 'on') {
|
||||
return false; //skip step only when both localstorage and localstorage for system vm are checked
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
@ -689,23 +692,15 @@
|
||||
label: 'label.local.storage.enabled',
|
||||
isBoolean: true,
|
||||
onChange: function(args) {
|
||||
var $checkbox = args.$checkbox;
|
||||
|
||||
if ($checkbox.is(':checked')) {
|
||||
cloudStack.dialog.confirm({
|
||||
message: 'message.zoneWizard.enable.local.storage',
|
||||
action: function() {
|
||||
$checkbox.attr('checked', true);
|
||||
},
|
||||
cancelAction: function() {
|
||||
$checkbox.attr('checked', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
return false;
|
||||
}
|
||||
localstorageenabledforsystemvm: {
|
||||
label: 'label.local.storage.enabled.system.vms',
|
||||
isBoolean: true,
|
||||
onChange: function(args) {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2346,8 +2341,8 @@
|
||||
},
|
||||
|
||||
action: function(args) {
|
||||
var $wizard = args.wizard;
|
||||
|
||||
var $wizard = args.wizard;
|
||||
var formData = args.data;
|
||||
var advZoneConfiguredVirtualRouterCount = 0; //for multiple physical networks in advanced zone. Each physical network has 2 virtual routers: regular one and VPC one.
|
||||
|
||||
var success = args.response.success;
|
||||
@ -4522,29 +4517,52 @@
|
||||
});
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL("addHost"),
|
||||
type: "POST",
|
||||
data: data,
|
||||
success: function(json) {
|
||||
stepFns.addPrimaryStorage({
|
||||
data: $.extend(args.data, {
|
||||
returnedHost: json.addhostresponse.host[0]
|
||||
})
|
||||
});
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
error('addHost', errorMsg, {
|
||||
fn: 'addHost',
|
||||
args: args
|
||||
});
|
||||
}
|
||||
});
|
||||
var addHostAjax = function() {
|
||||
$.ajax({
|
||||
url: createURL("addHost"),
|
||||
type: "POST",
|
||||
data: data,
|
||||
success: function(json) {
|
||||
stepFns.addPrimaryStorage({
|
||||
data: $.extend(args.data, {
|
||||
returnedHost: json.addhostresponse.host[0]
|
||||
})
|
||||
});
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
error('addHost', errorMsg, {
|
||||
fn: 'addHost',
|
||||
args: args
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if(args.data.zone.localstorageenabledforsystemvm == 'on') {
|
||||
$.ajax({
|
||||
url: createURL("updateConfiguration&name=system.vm.use.local.storage&value=true&zoneid=" + args.data.returnedZone.id),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
addHostAjax();
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
error('addHost', errorMsg, {
|
||||
fn: 'addHost',
|
||||
args: args
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addHostAjax();
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
addPrimaryStorage: function(args) {
|
||||
if (args.data.zone.localstorageenabled == 'on') { //use local storage, don't need primary storage. So, skip this step.
|
||||
if (args.data.zone.localstorageenabled == 'on' && args.data.zone.localstorageenabledforsystemvm == 'on') { //use local storage, don't need primary storage. So, skip this step.
|
||||
stepFns.addSecondaryStorage({
|
||||
data: args.data
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user