From 0d41c806be84f086e7a9d35b5c28e158946b92e9 Mon Sep 17 00:00:00 2001 From: chi zhang Date: Wed, 24 Dec 2014 16:46:09 -0800 Subject: [PATCH] ui can support ceph_firefly Change-Id: I70c6b3c652f454b710c18218247c92664e954fdb --- v2/data/config.json | 150 +++++++++++++++++++++- v2/src/app/appDev.js | 20 ++- v2/src/app/wizard/package_config.tpl.html | 6 +- v2/src/app/wizard/wizard.js | 45 ++++--- 4 files changed, 190 insertions(+), 31 deletions(-) diff --git a/v2/data/config.json b/v2/data/config.json index 4dd0f6b..f6feeba 100644 --- a/v2/data/config.json +++ b/v2/data/config.json @@ -52,7 +52,7 @@ "local_repo": "" }, "server_credentials": { - "username": "root", + "username": "", "password": "" }, "service_credentials": { @@ -183,8 +183,8 @@ "local_repo": "" }, "server_credentials": { - "username": "root", - "password": "huawei" + "username": "", + "password": "" }, "service_credentials": { "rabbitmq": { @@ -327,8 +327,148 @@ "local_repo": "" }, "server_credentials": { - "username": "root", - "password": "huawei" + "username": "", + "password": "" + } + }, + "ceph_firefly": { + "cluster": { + "id": 1, + "name": "demo", + "adapter_id": 1, + "os_id": 1 + }, + "partition": { + "/var": { + "percentage": 30, + "max_size": "10G" + }, + "/usr": { + "percentage": 30, + "max_size": "20G" + } + }, + "interface": { + "eth0": { + "subnet_id": 1, + "is_mgmt": true, + "is_promiscuous": false + }, + "eth1": { + "subnet_id": 2, + "is_mgmt": false, + "is_promiscuous": true + }, + "eth2": { + "subnet_id": 1, + "is_mgmt": false, + "is_promiscuous": false + }, + "eth3": { + "subnet_id": 2, + "is_mgmt": false, + "is_promiscuous": false + } + }, + "general": { + "timezone": "America/Los_Angeles", + "language": "en", + "http_proxy": "", + "https_proxy": "", + "no_proxy": [""], + "ntp_server": "", + "dns_servers": [""], + "search_path": ["ods.com"], + "domain": "ods.com", + "default_gateway": "10.145.88.1", + "local_repo": "" + }, + "server_credentials": { + "username": "", + "password": "" + }, + "service_credentials": { + "rabbitmq": { + "username": "guest", + "password": "guest" + }, + "compute": { + "username": "nova", + "password": "nova" + }, + "dashboard": { + "username": "dashboard", + "password": "dashboard" + }, + "identity": { + "username": "keystone", + "password": "keystone" + }, + "image": { + "username": "glance", + "password": "glance" + }, + "metering": { + "username": "ceilometer", + "password": "ceilometer" + }, + "mysql": { + "username": "root", + "password": "root" + }, + "volume": { + "username": "cinder", + "password": "cinder" + } + }, + "console_credentials": { + "admin": { + "username": "admin", + "password": "admin" + }, + "compute": { + "username": "nova", + "password": "nova" + }, + "dashboard": { + "username": "dashboard", + "password": "dashboard" + }, + "image": { + "username": "glance", + "password": "glance" + }, + "metering": { + "username": "ceilometer", + "password": "ceilometer" + }, + "network": { + "username": "quantum", + "password": "quantum" + }, + "object-store": { + "username": "swift", + "password": "swift" + }, + "volume": { + "username": "cinder", + "password": "cinder" + } + }, + "network_mapping": { + "public_network": "", + "cluster_network": "" + }, + "ceph_config": { + "global_config": { + "osd_pool_pg_num": "1024", + "osd_pool_pgp_num": "1024", + "osd_pool_size": "3" + }, + "osd_config": { + "journal_size": "10000", + "op_threads": 10 + } } } } \ No newline at end of file diff --git a/v2/src/app/appDev.js b/v2/src/app/appDev.js index adbbf14..bdfe737 100644 --- a/v2/src/app/appDev.js +++ b/v2/src/app/appDev.js @@ -42,8 +42,18 @@ compassAppDev.run(function($httpBackend, settings, $http) { }], "id": 2 }, { - "flavors": [], - "name": "ceph(chef)", + "flavors": [{ + "roles": [{ + "display_name": "Ceph Cluster (Firefly)", + "description": "Ceph Cluster (Firefly)", + "name": "ceph_firefly" + }], + "display_name": "Ceph Cluster (Firefly)", + "id": 1, + "template": "cephfirefly.tmpl", + "name": "ceph_firefly" + }], + "name": "ceph_firefly", "roles": [], "distributed_system_id": 2, "supported_oses": [{ @@ -56,7 +66,7 @@ compassAppDev.run(function($httpBackend, settings, $http) { "name": "Ubuntu-12.04-x86_64" }], "distributed_system_name": "ceph", - "display_name": "ceph(chef)", + "display_name": "ceph_firefly", "id": 4 }, { "flavors": [{ @@ -709,8 +719,8 @@ compassAppDev.run(function($httpBackend, settings, $http) { var config = { "os_config": { "server_credentials": { - "username": "", - "password": "" + "username": "root", + "password": "huawei" }, "partition": { "/var": { diff --git a/v2/src/app/wizard/package_config.tpl.html b/v2/src/app/wizard/package_config.tpl.html index 87e3f5e..f6378a4 100644 --- a/v2/src/app/wizard/package_config.tpl.html +++ b/v2/src/app/wizard/package_config.tpl.html @@ -34,7 +34,7 @@ - + OpenStack Database & Queue Credentials @@ -94,7 +94,7 @@ - + OpenStack Keystone User Credentials @@ -151,7 +151,7 @@ - + Ceph Global Configurations diff --git a/v2/src/app/wizard/wizard.js b/v2/src/app/wizard/wizard.js index 5666ebc..e94a24e 100644 --- a/v2/src/app/wizard/wizard.js +++ b/v2/src/app/wizard/wizard.js @@ -97,6 +97,11 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne $scope.steps = wizardStepsData["os_and_ts"]; wizardFactory.setSteps($scope.steps); break; + case "ceph_firefly": + preConfigData = data["ceph_firefly"]; + $scope.steps = wizardStepsData["os_and_ts"]; + wizardFactory.setSteps($scope.steps); + break; default: break; } @@ -672,16 +677,15 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne $scope.autoFill = false; $scope.autoFillButtonDisplay = "Enable Autofill"; //$scope.servers = wizardFactory.getServers(); - $scope.autoFillMange = function(){ + $scope.autoFillMange = function() { $scope.autoFill = !$scope.autoFill; - if($scope.autoFill) - { + if ($scope.autoFill) { $scope.autoFillButtonDisplay = "Disable Autofill"; - } - else{ + } else { $scope.autoFillButtonDisplay = "Enable Autofill"; } }; + dataService.getServerColumns().success(function(data) { $scope.server_columns = data.showless; }); @@ -1266,6 +1270,10 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne if ($scope.currentAdapterName == "ceph_openstack_icehouse") { targetSysConfigData["package_config"]["ceph_config"] = $scope.cephConfig; } + if ($scope.currentAdapterName == "ceph_firefly") { + targetSysConfigData["package_config"]={}; + targetSysConfigData["package_config"]["ceph_config"] = $scope.cephConfig; + } dataService.updateClusterConfig(cluster.id, targetSysConfigData).success(function(data) { var commitState = { "name": "package_config", @@ -1573,18 +1581,19 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne $scope.dropSuccessHandler = function($event, key, dict) { dict[key].mapping_interface = $scope.pendingInterface; }; - - angular.forEach($scope.interfaces, function(value, key) { - // The interface with promisc mode is required to be set as External Network - if (value.is_promiscuous) { - $scope.networking["external"].mapping_interface = key; - $scope.interfaces[key].dropChannel = "external"; - } - // The interface marked as management is required to be set as Management Network - if (value.is_mgmt) { - $scope.networking["management"].mapping_interface = key; - } - }); + if ($scope.currentAdapterName != "ceph_firefly") { + angular.forEach($scope.interfaces, function(value, key) { + // The interface with promisc mode is required to be set as External Network + if (value.is_promiscuous) { + $scope.networking["external"].mapping_interface = key; + $scope.interfaces[key].dropChannel = "external"; + } + // The interface marked as management is required to be set as Management Network + if (value.is_mgmt) { + $scope.networking["management"].mapping_interface = key; + } + }); + } $scope.$watch(function() { return wizardFactory.getCommitState() @@ -1922,4 +1931,4 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne }, true); }; -}); +}); \ No newline at end of file