Add OpenStack+Ceph installation in wizard

Change-Id: Ic1c0dc5b7429083476f55f1d0cf595b6bd2e310d
This commit is contained in:
jiahuay 2014-10-07 16:48:05 -07:00
parent f6bdeb4487
commit a5eabe0343
11 changed files with 733 additions and 319 deletions

View File

@ -13,9 +13,6 @@ body {
font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif !important; font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif !important;
color: rgba(83, 83, 83, 1) !important; color: rgba(83, 83, 83, 1) !important;
} }
.main-container {
position: relative;
}
body, .main-content { body, .main-content {
background: #fff; background: #fff;
/* right: 0px; /* right: 0px;
@ -98,14 +95,16 @@ body, .main-content {
display: inline-block; display: inline-block;
font-size: 13px; font-size: 13px;
font-weight: normal; font-weight: normal;
margin-bottom: 3px; margin-bottom: 3px !important;
margin-right: 3px; margin-right: 3px;
padding: 4px 22px 5px 9px; padding: 4px 22px 5px 9px;
position: relative; position: relative;
text-transform: capitalize;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15); text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15);
transition: all 0.2s ease 0s; transition: all 0.2s ease 0s;
vertical-align: baseline; vertical-align: baseline;
white-space: nowrap; white-space: nowrap;
overflow: hidden;
} }
.no-border-search { .no-border-search {
padding-left: 10px; padding-left: 10px;
@ -235,6 +234,9 @@ button[disabled] {
pointer-events: auto !important; pointer-events: auto !important;
cursor: not-allowed !important; cursor: not-allowed !important;
} }
.wizard-steps li .title {
white-space: nowrap;
}
.wizard-steps li.active .step { .wizard-steps li.active .step {
transform: scale(1.2, 1.2); transform: scale(1.2, 1.2);
-webkit-transform: scale(1.2, 1.2); -webkit-transform: scale(1.2, 1.2);
@ -445,6 +447,9 @@ a:active {
.label:first-letter { .label:first-letter {
text-transform: uppercase !important; text-transform: uppercase !important;
} }
.label-red {
background-color: #e2755f !important;
}
.capitalize { .capitalize {
text-transform: capitalize; text-transform: capitalize;
} }
@ -626,8 +631,9 @@ div.center-align {
.network-draggable { .network-draggable {
position: relative; position: relative;
width: 132px !important; width: 155px !important;
border-radius: 7px; border-radius: 7px;
cursor: move;
} }
.external-event { .external-event {
float: left !important; float: left !important;
@ -985,24 +991,27 @@ circle[depth='4'] {
margin-left: -4px; margin-left: -4px;
} }
.table-col { .table-col {
width: 87%; width: 75%;
} }
.role-col { .role-col {
width: 10%; width: 24%;
} }
.role-panel { .role-panel {
z-index: 10; z-index: 10;
margin-left: 10px;
margin-right: -25px;
} }
.role-panel.stick { .role-panel.stick {
position: fixed; position: fixed;
z-index: 10000; z-index: 10000;
top: 0px; top: 0px;
width: 24%;
} }
.role-assign-drag { .role-assign-drag {
border: 1px solid rgba(190, 210, 219, 0.5) !important; border: 1px solid rgba(190, 210, 219, 0.5) !important;
border-radius: 4px; border-radius: 4px;
min-height: 120px; min-height: 120px;
width: 122px; width: 90%;
} }
.role-assign-drop { .role-assign-drop {
min-height: 30px; min-height: 30px;
@ -1012,8 +1021,8 @@ circle[depth='4'] {
margin-left: 7px; margin-left: 7px;
margin-top: 7px; margin-top: 7px;
display: block !important; display: block !important;
width: 105px !important;
border-radius: 4px !important; border-radius: 4px !important;
cursor: move;
} }
.drag-enter-role { .drag-enter-role {
background: none repeat scroll 0 0 #F0F9FF; background: none repeat scroll 0 0 #F0F9FF;

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,4 +1,5 @@
{ {
"openstack": {
"cluster": { "cluster": {
"id": 1, "id": 1,
"name": "demo", "name": "demo",
@ -10,7 +11,7 @@
"percentage": 30, "percentage": 30,
"max_size": "10G" "max_size": "10G"
}, },
"/home": { "/usr": {
"percentage": 30, "percentage": 30,
"max_size": "20G" "max_size": "20G"
} }
@ -126,6 +127,208 @@
"management": "", "management": "",
"tenant": "", "tenant": "",
"storage": "", "storage": "",
"public": "" "external": ""
}
},
"openstack_ceph": {
"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": "root",
"password": "huawei"
},
"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": {
"management": "",
"tenant": "",
"storage": "",
"external": "",
"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
}
}
},
"os_only": {
"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": "root",
"password": "huawei"
}
} }
} }

View File

@ -5,7 +5,7 @@
"title": "Server Selection", "title": "Server Selection",
"state": "active", "state": "active",
"template": "src/app/wizard/server_selection.tpl.html", "template": "src/app/wizard/server_selection.tpl.html",
"description": "Select the servers you want to use for OpenStack" "description": "Select the servers you want to use for your target system(s)"
}, { }, {
"id": 2, "id": 2,
"name": "os_global", "name": "os_global",
@ -29,10 +29,10 @@
"description": "" "description": ""
}, { }, {
"id": 5, "id": 5,
"name": "security", "name": "package_config",
"title": "Security", "title": "Target System Config",
"state": "", "state": "",
"template": "src/app/wizard/security.tpl.html", "template": "src/app/wizard/package_config.tpl.html",
"description": "" "description": ""
}, { }, {
"id": 6, "id": 6,
@ -58,39 +58,39 @@
}], }],
"os": [{ "os": [{
"id": 1, "id": 1,
"name": "sv_selection",
"title": "Server Selection", "title": "Server Selection",
"state": "active", "state": "active",
"template": "templates/server_selection.html" "template": "src/app/wizard/server_selection.tpl.html",
"description": "Select the servers you want to use for your targer system(s)"
}, { }, {
"id": 2, "id": 2,
"title": "Timezone & Language", "name": "os_global",
"title": "OS Global Config",
"state": "", "state": "",
"template": "templates/timezone_language.html" "template": "src/app/wizard/global.tpl.html",
"description": ""
}, { }, {
"id": 3, "id": 3,
"title": "Partition", "name": "network",
"state": "",
"template": "templates/partition.html"
}, {
"id": 4,
"title": "Network", "title": "Network",
"state": "", "state": "",
"template": "templates/network.html" "template": "src/app/wizard/network.tpl.html",
"description": ""
}, {
"id": 4,
"name": "partition",
"title": "Partition",
"state": "",
"template": "src/app/wizard/partition.tpl.html",
"description": ""
}, { }, {
"id": 5, "id": 5,
"title": "Host Configuration", "name": "review",
"state": "",
"template": "templates/host_config.html"
}, {
"id": 6,
"title": "Security",
"state": "",
"template": "templates/security.html"
}, {
"id": 7,
"title": "Review", "title": "Review",
"state": "", "state": "",
"template": "templates/review.html" "template": "src/app/wizard/review.tpl.html",
"description": "Click a section title to navigate back to that page."
}], }],
"ts": [{ "ts": [{
"id": 1, "id": 1,

View File

@ -20,78 +20,91 @@ compassAppDev.run(function($httpBackend, settings, $http) {
$httpBackend.whenGET(settings.apiUrlBase + '/adapters').respond(function(method, url, data) { $httpBackend.whenGET(settings.apiUrlBase + '/adapters').respond(function(method, url, data) {
console.log(method, url); console.log(method, url);
var adapters = [{ var adapters = [{
"id": 1, "flavors": [],
"display_name": "openstack", "display_name": "os_only",
"display": "OpenStack", "name": "os_only",
"os_installer": "cobbler", "roles": [],
"package_installer": "chef",
"supported_oses": [{ "supported_oses": [{
"name": "CentOs", "os_id": 3,
"id": 1 "id": 3,
"name": "CentOS-6.5-x86_64"
}, { }, {
"name": "Ubuntu", "os_id": 4,
"id": 2 "id": 4,
"name": "Ubuntu-12.04-x86_64"
}], }],
"id": 2
}, {
"flavors": [],
"name": "ceph(chef)",
"roles": [],
"distributed_system_id": 2,
"supported_oses": [{
"os_id": 3,
"id": 3,
"name": "CentOS-6.5-x86_64"
}, {
"os_id": 4,
"id": 4,
"name": "Ubuntu-12.04-x86_64"
}],
"distributed_system_name": "ceph",
"display_name": "ceph(chef)",
"id": 4
}, {
"flavors": [{ "flavors": [{
"display_name": "allinone",
"id": 1,
"name": "allinone",
"roles": [{ "roles": [{
"display_name": "Compute", "display_name": "all in one compute",
"name": "os-compute-worker" "description": "all in one compute",
}, { "name": "allinone-compute"
"display_name": "Controller",
"name": "os-controller"
}, {
"display_name": "Network",
"name": "os-network"
}, {
"display_name": "Storage",
"name": "os-block-storage-worker"
}]
}, {
"display_name": "multiroles",
"id": 2,
"name": "multiroles",
"roles": [{
"display_name": "Compute",
"name": "os-compute-worker"
}, {
"display_name": "Controller",
"name": "os-controller"
}, {
"display_name": "Network",
"name": "os-network"
}, {
"display_name": "Storage",
"name": "os-block-storage-worker"
}]
}]
}, {
"id": 2,
"display_name": "hadoop",
"display": "Hadoop",
"os_installer": "cobbler",
"package_installer": "chef",
"roles": [{
"display_name": "Compute",
"name": "os-compute-worker"
}, {
"display_name": "Controller",
"name": "os-controller"
}, {
"display_name": "Network",
"name": "os-network"
}], }],
"supported_oses": [{ "display_name": "All-In-One",
"name": "CentOs", "id": 1,
"id": 1 "template": "allinone.tmpl",
"name": "allinone"
}, { }, {
"name": "Ubuntu", "roles": [],
"id": 2 "display_name": "Single Controller, Multi-compute",
"id": 2,
"name": "single-contoller-multi-compute"
}, {
"roles": [],
"display_name": "Multi-node Cluster",
"id": 3,
"template": "multinodes.tmpl",
"name": "multinodes"
}],
"name": "openstack_icehouse",
"distributed_system_id": 1,
"supported_oses": [{
"os_id": 3,
"id": 3,
"name": "CentOS-6.5-x86_64"
}, {
"os_id": 4,
"id": 4,
"name": "Ubuntu-12.04-x86_64"
}],
"distributed_system_name": "openstack",
"display_name": "OpenStack Icehouse",
"id": 5
}, {
"id": 6,
"name": "ceph_openstack_icehouse",
"display_name": "OpenStack and Ceph",
"supported_oses": [{
"os_id": 3,
"id": 3,
"name": "CentOS-6.5-x86_64"
}, {
"os_id": 4,
"id": 4,
"name": "Ubuntu-12.04-x86_64"
}], }],
"flavors": [] "flavors": []
}]; }];
return [200, adapters, {}]; return [200, adapters, {}];
}); });
@ -649,9 +662,9 @@ compassAppDev.run(function($httpBackend, settings, $http) {
var index = url.indexOf("clusters/"); var index = url.indexOf("clusters/");
var id = url.substring(index).split("/")[1]; var id = url.substring(index).split("/")[1];
var cluster = { var cluster = {
"id": id, "id": parseInt(id),
"name": "Cluster" + id, "name": "Cluster" + id,
"adapter_id": 1, "adapter_id": 6,
"os_id": 1, "os_id": 1,
"editable": true, "editable": true,
"create_by": "user@someemail.com", "create_by": "user@someemail.com",
@ -674,7 +687,7 @@ compassAppDev.run(function($httpBackend, settings, $http) {
"display_name": "Network", "display_name": "Network",
"name": "os-network" "name": "os-network"
}, { }, {
"display_name": "database", "display_name": "Database",
"name": "os-db" "name": "os-db"
}] }]
}, },
@ -702,7 +715,7 @@ compassAppDev.run(function($httpBackend, settings, $http) {
"percentage": 30, "percentage": 30,
"max_size": "10G" "max_size": "10G"
}, },
"/home": { "/usr": {
"percentage": 30, "percentage": 30,
"max_size": "10G" "max_size": "10G"
} }
@ -783,7 +796,9 @@ compassAppDev.run(function($httpBackend, settings, $http) {
"management": "eth0", "management": "eth0",
"tenant": "eth0", "tenant": "eth0",
"storage": "eth0", "storage": "eth0",
"public": "eth1" "external": "eth1",
"cluster_config": "",
"public_config": ""
} }
} }
}; };
@ -957,7 +972,7 @@ compassAppDev.run(function($httpBackend, settings, $http) {
"display_name": "Message Queue", "display_name": "Message Queue",
"name": "os-mq" "name": "os-mq"
}, { }, {
"display_name": "database", "display_name": "Database",
"name": "os-db" "name": "os-db"
}]; }];

View File

@ -1,7 +1,7 @@
define(['angular'], function() { define(['angular'], function() {
var servicesModule = angular.module('compass.services', []); var servicesModule = angular.module('compass.services', []);
// stateService is used for dynamically add/edit state // stateService is used for dynamically add/edit state
/* .service('stateService', ['$state', /* .service('stateService', ['$state',
function($state) { function($state) {
this.addStates = function(pendingStates) { this.addStates = function(pendingStates) {
var existingStates = $state.get(); // get all the current existing states var existingStates = $state.get(); // get all the current existing states
@ -341,6 +341,7 @@ define(['angular'], function() {
wizard.service_credentials = {}; wizard.service_credentials = {};
wizard.console_credentials = {}; wizard.console_credentials = {};
wizard.network_mapping = {}; wizard.network_mapping = {};
wizard.ceph_config = {};
}; };
wizard.init(); wizard.init();
@ -354,6 +355,9 @@ define(['angular'], function() {
wizard.setServiceCredentials(config.service_credentials); wizard.setServiceCredentials(config.service_credentials);
wizard.setConsoleCredentials(config.console_credentials); wizard.setConsoleCredentials(config.console_credentials);
wizard.setNetworkMapping(config.network_mapping); wizard.setNetworkMapping(config.network_mapping);
if (config.ceph_config) {
wizard.setCephConfig(config.ceph_config);
}
}; };
wizard.setClusterInfo = function(cluster) { wizard.setClusterInfo = function(cluster) {
@ -403,7 +407,7 @@ define(['angular'], function() {
wizard.getAdapter = function() { ///// wizard.getAdapter = function() { /////
return angular.copy(wizard.adapter); return angular.copy(wizard.adapter);
}; };
*/ */
wizard.setGeneralConfig = function(config) { wizard.setGeneralConfig = function(config) {
wizard.generalConfig = config; wizard.generalConfig = config;
}; };
@ -478,6 +482,14 @@ define(['angular'], function() {
return angular.copy(wizard.network_mapping); return angular.copy(wizard.network_mapping);
}; };
wizard.setCephConfig = function(cephConfig) {
wizard.ceph_config = cephConfig;
};
wizard.getCephConfig = function() {
return angular.copy(wizard.ceph_config);
};
return wizard; return wizard;
} }
]) ])

View File

@ -174,6 +174,40 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group">
<div>
<label class="col-sm-4 control-label no-padding-right">
Server Credentials
<span class="text-danger">*</span>
</label>
<div class="col-sm-8">
<input type="text" class="col-xs-10 col-sm-5" placeholder="Username" name="server-username" ng-model="server_credentials.username" required>
</div>
</div>
</div>
<div class="form-group">
<div>
<label class="col-sm-4 control-label no-padding-right">
<span class="text-danger">*</span>
</label>
<div class="col-sm-8">
<input type="password" class="col-xs-10 col-sm-5" placeholder="Password" name="server-password" ng-model="server_credentials.password" required>
</div>
</div>
</div>
<div class="form-group">
<div>
<label class="col-sm-4 control-label no-padding-right">
<span class="text-danger">*</span>
</label>
<div class="col-sm-8">
<input type="password" class="col-xs-10 col-sm-5" placeholder="Confirm Password" ng-model="confirmPassword" name="server-confirmpassword" required>
</div>
</div>
</div>
</form> </form>
<!--table class="table table-hover nowrap"> <!--table class="table table-hover nowrap">

View File

@ -16,10 +16,11 @@
(Management) (Management)
</span> </span>
<div ui-on-Drop="onDrop($event, interface_key)" drag-hover-class="drag-enter" drop-channel="{{interface_value.dropChannel}}" class="interface-placeholder interface-placeholder-margin"> <div ui-on-Drop="onDrop($event, interface_key)" drag-hover-class="drag-enter" drop-channel="{{interface_value.dropChannel}}" class="interface-placeholder interface-placeholder-margin">
<div ng-repeat="(network_key, network_value) in networking" ui-draggable="true" on-drop-success="dropSuccessHandler($event, network_key, networking)" drag-channel="{{network_value.dragChannel}}" class="external-event ui-draggable network-draggable margin-right-5 fade-animation" ng-class="{'label-pink': network_key == 'management', 'label-success': network_key =='tenant', 'label-purple': network_key == 'public', 'label-warning': network_key == 'storage'}" ng-if="network_value.mapping_interface==interface_key"> <div ng-repeat="(network_key, network_value) in networking" ui-draggable="true" on-drop-success="dropSuccessHandler($event, network_key, networking)" drag-channel="{{network_value.dragChannel}}" class="external-event ui-draggable network-draggable margin-right-5 fade-animation" ng-class="{'label-pink': network_key == 'management', 'label-success': network_key == 'tenant', 'label-purple': network_key == 'external', 'label-warning': network_key == 'storage', 'label-info': network_key == 'public_network', 'label-red': network_key == 'cluster_network'}" ng-if="network_value.mapping_interface == interface_key">
<i class="ace-icon fa fa-arrows"></i> <i class="ace-icon fa fa-arrows"></i>
<span class="capitalize">{{network_key}}</span> <span class="capitalize">{{network_key}}</span>
</div> </div>
<div class="clearfix"></div>
</div> </div>
</div> </div>
</div> </div>
@ -33,11 +34,11 @@
<h4>Networks</h4> <h4>Networks</h4>
</div> </div>
<br> <br>
<p>Use drag and drop to move logical networks between physical interfaces. (Interface assigned Promisc Mode can only map with Public network)</p> <p>Use drag and drop to move logical networks between physical interfaces. (Interface assigned Promisc Mode can only map with External network)</p>
<div class="widget-body"> <div class="widget-body">
<div class="widget-main network-background"> <div class="widget-main network-background">
<div ui-on-Drop="onDrop($event, '')" drag-hover-class="drag-enter" class="network-placeholder network-margin-border" drop-channel="E"> <div ui-on-Drop="onDrop($event, '')" drag-hover-class="drag-enter" class="network-placeholder network-margin-border" drop-channel="external others">
<div ng-repeat="(key, value) in networking" ui-draggable="true" on-drop-success="dropSuccessHandler($event, key, networking);" class="external-event ui-draggable network-draggable network-margin margin-right-20 fade-animation" ng-class="{'label-pink': key == 'management', 'label-success': key =='tenant', 'label-purple': key == 'public', 'label-warning': key == 'storage'}" drag-channel="{{value.dragChannel}}" ng-if="!value.mapping_interface"> <div ng-repeat="(key, value) in networking" ui-draggable="true" on-drop-success="dropSuccessHandler($event, key, networking);" class="external-event ui-draggable network-draggable network-margin margin-right-20 fade-animation" ng-class="{'label-pink': key == 'management', 'label-success': key =='tenant', 'label-purple': key == 'external', 'label-warning': key == 'storage', 'label-info': key == 'public_network', 'label-red': key == 'cluster_network'}" drag-channel="{{value.dragChannel}}" ng-if="!value.mapping_interface">
<i class="ace-icon fa fa-arrows"></i> <i class="ace-icon fa fa-arrows"></i>
<span class="capitalize">{{key}}</span> <span class="capitalize">{{key}}</span>
</div> </div>

View File

@ -1,10 +1,10 @@
<div ng-controller="securityCtrl"> <div ng-controller="packageConfigCtrl">
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="accordion-style1 panel-group accordion-style2" id="accordion"> <div class="accordion-style1 panel-group accordion-style2" id="accordion">
<accordion close-others="true"> <accordion close-others="true">
<accordion-group is-open="serverAccordion.open" ng-init="serverAccordion.open=true"> <!--accordion-group is-open="serverAccordion.open" ng-init="serverAccordion.open=true">
<accordion-heading> <accordion-heading>
<i class="ace-icon fa fa-angle-right" ng-class="{'fa-angle-down': status1.open, 'fa-angle-right': !status1.open}"></i> Server Credentials <i class="ace-icon fa fa-angle-right" ng-class="{'fa-angle-down': status1.open, 'fa-angle-right': !status1.open}"></i> Server Credentials
</accordion-heading> </accordion-heading>
@ -32,12 +32,12 @@
</form> </form>
</div> </div>
</div> </div>
</accordion-group> </accordion-group-->
<accordion-group is-open="serviceAccordion.open"> <accordion-group is-open="serviceAccordion.open">
<accordion-heading> <accordion-heading>
<i class="ace-icon fa fa-angle-right" ng-class="{'fa-angle-down': status2.open, 'fa-angle-right': !status2.open}"></i> OpenStack Database &amp; Queue Credentials <i class="ace-icon fa fa-angle-right" ng-class="{'fa-angle-down': serviceAccordion.open, 'fa-angle-right': !serviceAccordion.open}"></i> OpenStack Database &amp; Queue Credentials
</accordion-heading> </accordion-heading>
<div class="row"> <div class="row">
<div class="col-lg-1"> <div class="col-lg-1">
@ -96,7 +96,7 @@
<accordion-group is-open="mgmtAccordion.open"> <accordion-group is-open="mgmtAccordion.open">
<accordion-heading> <accordion-heading>
<i class="ace-icon fa fa-angle-right" ng-class="{'fa-angle-down': status.open, 'fa-angle-right': !status.open}"></i> OpenStack Keystone User Credentials <i class="ace-icon fa fa-angle-right" ng-class="{'fa-angle-down': mgmtAccordion.open, 'fa-angle-right': !mgmtAccordion.open}"></i> OpenStack Keystone User Credentials
</accordion-heading> </accordion-heading>
<div class="row"> <div class="row">
<div class="col-lg-1"> <div class="col-lg-1">
@ -151,6 +151,96 @@
</div> </div>
</accordion-group> </accordion-group>
<accordion-group is-open="cephAccordion.open" ng-if="currentAdapterName == 'ceph_openstack_icehouse'">
<accordion-heading>
<i class="ace-icon fa fa-angle-right" ng-class="{'fa-angle-down': cephAccordion.open, 'fa-angle-right': !cephAccordion.open}"></i> Ceph Global Configurations
</accordion-heading>
<div class="row">
<div class="col-xs-12">
<form id="cephForm" name="cephForm" class="form-horizontal" role="form">
<div class="form-group">
<div>
<label class="col-sm-4 control-label no-padding-right">
OSD Pool PG Number
<span class="text-danger">*</span>
</label>
<div class="col-sm-8">
<input ng-model="cephConfig.global_config.osd_pool_pg_num" type="text" class="col-xs-10 col-sm-5" placeholder="OSD Pool PG Number" name="osd_pool_pg_num" required>
</div>
</div>
</div>
<div class="form-group">
<div>
<label class="col-sm-4 control-label no-padding-right">
OSD Pool PGP Number
<span class="text-danger">*</span>
</label>
<div class="col-sm-8">
<input ng-model="cephConfig.global_config.osd_pool_pgp_num" type="text" class="col-xs-10 col-sm-5" placeholder="OSD Pool PGP Number" name="osd_pool_pgp_num" required>
</div>
</div>
</div>
<div class="form-group">
<div>
<label class="col-sm-4 control-label no-padding-right">
OSD Pool Size
<span class="text-danger">*</span>
</label>
<div class="col-sm-8">
<input ng-model="cephConfig.global_config.osd_pool_size" type="text" class="col-xs-10 col-sm-5" placeholder="OSD Pool Size" name="osd_pool_size" required>
</div>
</div>
</div>
<div class="form-group">
<div>
<label class="col-sm-4 control-label no-padding-right">
Journal Size
<span class="text-danger opacity-zero">*</span>
</label>
<div class="col-sm-8">
<input ng-model="cephConfig.osd_config.journal_size" type="text" class="col-xs-10 col-sm-5" placeholder="Journal Size" name="journal_size">
</div>
</div>
</div>
<div class="form-group">
<div>
<label class="col-sm-4 control-label no-padding-right">
OP Threads
<span class="text-danger opacity-zero">*</span>
</label>
<div class="col-sm-8">
<input ng-model="cephConfig.osd_config.op_threads" type="number" class="col-xs-10 col-sm-5" placeholder="OP Threads" name="op_threads">
</div>
</div>
</div>
<!--div class="form-group">
<div>
<label class="col-sm-4 control-label no-padding-right">
OSD Devices
<span class="text-danger opacity-zero">*</span>
</label>
<div class="col-sm-8">
<input ng-model="cephConfig.osd_devices" type="text" class="col-xs-5 col-sm-2" placeholder="Device" name="device">
<input ng-model="cephConfig.journals" type="text" class="col-xs-5 col-sm-3" placeholder="Journal" name="journal">
<span class="col-xs-2 col-sm-3"-->
<!--Add Action-->
<!--span class="action" ng-click="addValue('dns_servers')">
<i class="fa fa-plus-circle bigger-140 blue"></i>
</span-->
<!--Remove Action-->
<!--span ng-show="general.dns_servers.length > 1" class="action" ng-click="general.dns_servers.splice($index,1)">
<i class="fa fa-minus-circle bigger-140 blue"></i>
</span-->
<!--/span>
</div>
</div>
</div-->
</form>
</div>
</div>
</accordion-group>
</accordion> </accordion>
</div> </div>

View File

@ -55,7 +55,7 @@
</div> </div>
</div> </div>
<div class="pull-right"> <div class="pull-right">
<span class="opacity-zero"> <span style="display: none">
<input type="text" placeholder="HA VIP" ng-model="ha_vip"> <input type="text" placeholder="HA VIP" ng-model="ha_vip">
</span> </span>
<button class="btn btn-sm btn-info" ng-init="autoAssignRoles.isCollapsed = true;" ng-click="autoAssignRoles.isCollapsed = !autoAssignRoles.isCollapsed"> <button class="btn btn-sm btn-info" ng-init="autoAssignRoles.isCollapsed = true;" ng-click="autoAssignRoles.isCollapsed = !autoAssignRoles.isCollapsed">
@ -141,12 +141,12 @@
<div id="sticky-anchor"></div> <div id="sticky-anchor"></div>
<div class="row role-panel" rolepanelscroll> <div class="row role-panel" rolepanelscroll>
<div class="blue"> <div class="blue">
<h4 class="margin-left-neg4">Drag to Assign</h4> <h4>Drag to Assign</h4>
</div> </div>
<div class="role-assign-drag"> <div class="role-assign-drag">
<div tooltip-placement="left" tooltip="{{role_value.display_name}}" tooltip-popup-delay='100' ui-draggable="true" on-drop-success="dropSuccessHandler($event,role_value,role_key)" class="role-tag drag-roles ui-draggable" ng-repeat="(role_key, role_value) in roles" ng-style="{'background-color': role_value.color}" drag-channel="{{role_value.dragChannel}}"> <div tooltip-placement="left" tooltip="{{role_value.display_name}}" tooltip-popup-delay='100' ui-draggable="true" on-drop-success="dropSuccessHandler($event,role_value,role_key)" class="role-tag drag-roles ui-draggable" ng-repeat="(role_key, role_value) in roles" ng-style="{'background-color': role_value.color}" drag-channel="{{role_value.dragChannel}}">
<i class="ace-icon fa fa-arrows margin-left-neg4"></i> <i class="ace-icon fa fa-arrows margin-left-neg4"></i>
<span >{{role_value.display_name | limitTo: 10 }}</span> <span >{{role_value.display_name}}</span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -33,7 +33,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
}); });
return deferred.promise; return deferred.promise;
}, },
wizardStepsData: function($q, dataService) { wizardStepsData: function($q, dataService) { // get the create-cluster-wizard steps
var deferred = $q.defer(); var deferred = $q.defer();
dataService.getWizardSteps().success(function(data) { dataService.getWizardSteps().success(function(data) {
deferred.resolve(data); deferred.resolve(data);
@ -47,28 +47,63 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
deferred.resolve(data); deferred.resolve(data);
}); });
return deferred.promise; return deferred.promise;
},
adaptersData: function($q, dataService) {
var deferred = $q.defer();
dataService.getAdapters().success(function(data) {
deferred.resolve(data);
});
return deferred.promise;
} }
} }
}); });
}); });
wizardModule.controller('wizardCtrl', function($scope, dataService, wizardFactory, $stateParams, $state, $modal, clusterData, machinesHostsData, wizardStepsData, clusterConfigData) { wizardModule.controller('wizardCtrl', function($scope, dataService, wizardFactory, $stateParams, $state, $modal, clusterData, adaptersData, machinesHostsData, wizardStepsData, clusterConfigData) {
$scope.loading = false; $scope.loading = false;
$scope.clusterId = $stateParams.id; $scope.clusterId = $stateParams.id;
$scope.cluster = clusterData; $scope.cluster = clusterData;
wizardFactory.setClusterInfo($scope.cluster); wizardFactory.setClusterInfo($scope.cluster);
wizardFactory.setAllMachinesHost(machinesHostsData); wizardFactory.setAllMachinesHost(machinesHostsData);
var oldConfig = clusterConfigData; $scope.adapters = adaptersData;
$scope.$on('loading', function(event, data) { angular.forEach($scope.adapters, function(adapter) {
$scope.loading = data; if (adapter.id == $scope.cluster.adapter_id) {
$scope.currentAdapterName = adapter.name;
}
}); });
// get pre-config data for wizard
// get pre-config data for wizard and set wizard steps based on different adapters
var oldConfig = clusterConfigData;
$scope.steps = [];
if ($stateParams.config == "true") { if ($stateParams.config == "true") {
dataService.getWizardPreConfig().success(function(data) { dataService.getWizardPreConfig().success(function(data) {
wizardFactory.preConfig(data); var preConfigData = {};
switch ($scope.currentAdapterName) {
case "openstack_icehouse":
preConfigData = data["openstack"];
$scope.steps = wizardStepsData["os_and_ts"];
wizardFactory.setSteps($scope.steps);
break;
case "os_only":
preConfigData = data["os_only"];
$scope.steps = wizardStepsData["os"];
wizardFactory.setSteps($scope.steps);
break;
case "ceph_openstack_icehouse":
preConfigData = data["openstack_ceph"];
$scope.steps = wizardStepsData["os_and_ts"];
wizardFactory.setSteps($scope.steps);
break;
default:
break;
}
if (preConfigData) {
wizardFactory.preConfig(preConfigData);
if (oldConfig.os_config) { if (oldConfig.os_config) {
if (oldConfig.os_config.general) { if (oldConfig.os_config.general) {
@ -93,19 +128,22 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
if (oldConfig.package_config.network_mapping) { if (oldConfig.package_config.network_mapping) {
wizardFactory.setNetworkMapping(oldConfig.package_config.network_mapping); wizardFactory.setNetworkMapping(oldConfig.package_config.network_mapping);
} }
if (oldConfig.package_config.ceph_config) {
wizardFactory.setCephConfig(oldConfig.package_config.ceph_config);
}
}
} }
}); });
} }
$scope.$on('loading', function(event, data) {
$scope.loading = data;
});
$scope.currentStep = 1; $scope.currentStep = 1;
$scope.maxStep = 1; $scope.maxStep = 1;
$scope.pendingStep = 1; $scope.pendingStep = 1;
// get the create-cluster-wizard steps for os, ts or os_and_ts
$scope.steps = wizardStepsData["os_and_ts"];
wizardFactory.setSteps($scope.steps);
// Watch commit state change // Watch commit state change
$scope.$watch(function() { $scope.$watch(function() {
return wizardFactory.getCommitState() return wizardFactory.getCommitState()
@ -479,6 +517,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
var cluster = wizardFactory.getClusterInfo(); var cluster = wizardFactory.getClusterInfo();
$scope.general = wizardFactory.getGeneralConfig(); $scope.general = wizardFactory.getGeneralConfig();
$scope.server_credentials = wizardFactory.getServerCredentials();
if (!$scope.general["dns_servers"]) { if (!$scope.general["dns_servers"]) {
$scope.general["dns_servers"] = [""]; $scope.general["dns_servers"] = [""];
@ -538,13 +577,17 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
return; return;
} }
$scope.$emit("loading", true); $scope.$emit("loading", true);
var os_global_general = { var osGlobalConfig = {
"os_config": { "os_config": {
"general": $scope.general "general": $scope.general,
"server_credentials": {
"username": $scope.server_credentials.username,
"password": $scope.server_credentials.password
}
} }
}; };
if ($scope.generalForm.$valid) { if ($scope.generalForm.$valid) {
dataService.updateClusterConfig(cluster.id, os_global_general).success(function(configData) { dataService.updateClusterConfig(cluster.id, osGlobalConfig).success(function(configData) {
wizardFactory.setGeneralConfig($scope.general); wizardFactory.setGeneralConfig($scope.general);
var commitState = { var commitState = {
"name": "os_global", "name": "os_global",
@ -571,7 +614,6 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
}; };
wizardFactory.setCommitState(commitState); wizardFactory.setCommitState(commitState);
} }
}; };
@ -1062,11 +1104,10 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
}); });
} }
}; };
}) });
wizardModule.controller('securityCtrl', function($scope, wizardFactory, dataService) { wizardModule.controller('packageConfigCtrl', function($scope, wizardFactory, dataService) {
var cluster = wizardFactory.getClusterInfo(); var cluster = wizardFactory.getClusterInfo();
$scope.server_credentials = wizardFactory.getServerCredentials();
$scope.service_credentials = wizardFactory.getServiceCredentials(); $scope.service_credentials = wizardFactory.getServiceCredentials();
$scope.console_credentials = wizardFactory.getConsoleCredentials(); $scope.console_credentials = wizardFactory.getConsoleCredentials();
@ -1092,7 +1133,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
return wizardFactory.getCommitState() return wizardFactory.getCommitState()
}, function(newCommitState, oldCommitState) { }, function(newCommitState, oldCommitState) {
if (newCommitState !== undefined) { if (newCommitState !== undefined) {
if (newCommitState.name == "security" && newCommitState.state == "triggered") { if (newCommitState.name == "package_config" && newCommitState.state == "triggered") {
$scope.commit(newCommitState.sendRequest); $scope.commit(newCommitState.sendRequest);
} }
} }
@ -1167,10 +1208,19 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
$scope.service_credentials = angular.copy($scope.originalServiceData); $scope.service_credentials = angular.copy($scope.originalServiceData);
} }
// Ceph Config
$scope.cephAccordion = {};
/*$scope.cephConfig = {
"global_config": {},
"osd_config": {},
"osd_devices": {}
};*/
$scope.cephConfig = wizardFactory.getCephConfig();
$scope.commit = function(sendRequest) { $scope.commit = function(sendRequest) {
if (!sendRequest) { if (!sendRequest) {
var commitState = { var commitState = {
"name": "security", "name": "package_config",
"state": "goToPreviousStep", "state": "goToPreviousStep",
"message": "" "message": ""
}; };
@ -1178,13 +1228,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
return; return;
} }
$scope.$emit("loading", true); $scope.$emit("loading", true);
var securityData = { var targetSysConfigData = {
"os_config": {
"server_credentials": {
"username": $scope.server_credentials.username,
"password": $scope.server_credentials.password
}
},
"package_config": { "package_config": {
"security": { "security": {
"service_credentials": $scope.service_credentials, "service_credentials": $scope.service_credentials,
@ -1192,16 +1236,19 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
} }
} }
}; };
dataService.updateClusterConfig(cluster.id, securityData).success(function(data) { if($scope.currentAdapterName == "ceph_openstack_icehouse") {
targetSysConfigData["package_config"]["ceph_config"] = $scope.cephConfig;
}
dataService.updateClusterConfig(cluster.id, targetSysConfigData).success(function(data) {
var commitState = { var commitState = {
"name": "security", "name": "package_config",
"state": "success", "state": "success",
"message": "" "message": ""
}; };
wizardFactory.setCommitState(commitState); wizardFactory.setCommitState(commitState);
}).error(function(response) { }).error(function(response) {
var commitState = { var commitState = {
"name": "security", "name": "package_config",
"state": "error", "state": "error",
"message": response "message": response
}; };
@ -1236,7 +1283,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
angular.forEach($scope.servers[key].roles, function(server_role, server_role_key) { angular.forEach($scope.servers[key].roles, function(server_role, server_role_key) {
$scope.server_role = ""; $scope.server_role = "";
angular.forEach($scope.roles, function(role, role_key) { angular.forEach($scope.roles, function(role, role_key) {
if (server_role.display_name == $scope.roles[role_key].display_name) { if (server_role.name == $scope.roles[role_key].name) {
$scope.server_role = role_key; $scope.server_role = role_key;
} }
}); });
@ -1263,7 +1310,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
var roleIndex = $scope.servers[serverIndex].roles.indexOf(role); var roleIndex = $scope.servers[serverIndex].roles.indexOf(role);
$scope.servers[serverIndex].roles.splice(roleIndex, 1); $scope.servers[serverIndex].roles.splice(roleIndex, 1);
angular.forEach($scope.roles, function(role_value, role_key) { angular.forEach($scope.roles, function(role_value, role_key) {
if (role.display_name == $scope.roles[role_key].display_name) { if (role.name == $scope.roles[role_key].name) {
$scope.existingRoles[serverIndex].splice(role_key, 1, role_key) $scope.existingRoles[serverIndex].splice(role_key, 1, role_key)
} }
}); });
@ -1460,7 +1507,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
angular.forEach($scope.servers, function(value, key) { angular.forEach($scope.servers, function(value, key) {
angular.forEach($scope.servers[key].roles, function(server_role, server_role_key) { angular.forEach($scope.servers[key].roles, function(server_role, server_role_key) {
angular.forEach($scope.roles, function(role, role_key) { angular.forEach($scope.roles, function(role, role_key) {
if ($scope.servers[key].roles[server_role_key].display_name == $scope.roles[role_key].display_name) { if ($scope.servers[key].roles[server_role_key].name == $scope.roles[role_key].name) {
$scope.existingRoles[key].splice(role_key, 1, "p"); $scope.existingRoles[key].splice(role_key, 1, "p");
} }
}); });
@ -1481,28 +1528,29 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
}; };
angular.forEach($scope.interfaces, function(value, key) { angular.forEach($scope.interfaces, function(value, key) {
$scope.interfaces[key].dropChannel = "E"; $scope.interfaces[key].dropChannel = "others";
}) });
$scope.networking = {}; $scope.networking = {};
angular.forEach($scope.original_networking, function(value, key) { angular.forEach($scope.original_networking, function(value, key) {
$scope.networking[key] = {}; $scope.networking[key] = {};
$scope.networking[key].mapping_interface = value; $scope.networking[key].mapping_interface = value;
if (key == "public") { if (key == "external") {
$scope.networking[key].dragChannel = "P"; $scope.networking[key].dragChannel = "external";
} else } else
$scope.networking[key].dragChannel = "E"; $scope.networking[key].dragChannel = "others";
}) });
$scope.dropSuccessHandler = function($event, key, dict) { $scope.dropSuccessHandler = function($event, key, dict) {
dict[key].mapping_interface = $scope.pendingInterface; dict[key].mapping_interface = $scope.pendingInterface;
}; };
angular.forEach($scope.interfaces, function(value, key) { angular.forEach($scope.interfaces, function(value, key) {
// The interface with promisc mode is required to be set as Public Network // The interface with promisc mode is required to be set as External Network
if (value.is_promiscuous) { if (value.is_promiscuous) {
$scope.networking["public"].mapping_interface = key; $scope.networking["external"].mapping_interface = key;
$scope.interfaces[key].dropChannel = "P"; $scope.interfaces[key].dropChannel = "external";
} }
// The interface marked as management is required to be set as Management Network // The interface marked as management is required to be set as Management Network
if (value.is_mgmt) { if (value.is_mgmt) {
@ -1558,7 +1606,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
wizardFactory.setCommitState(commitState); wizardFactory.setCommitState(commitState);
}); });
}; };
}) });
wizardModule.controller('reviewCtrl', function($scope, wizardFactory, dataService, $filter, ngTableParams, sortingService) { wizardModule.controller('reviewCtrl', function($scope, wizardFactory, dataService, $filter, ngTableParams, sortingService) {
var cluster = wizardFactory.getClusterInfo(); var cluster = wizardFactory.getClusterInfo();
@ -1709,9 +1757,11 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
angular.element($window).bind("scroll", function() { angular.element($window).bind("scroll", function() {
var window_top = this.pageYOffset; var window_top = this.pageYOffset;
var sticky_anchor_elem = angular.element($('#sticky-anchor')); var sticky_anchor_elem = angular.element($('#sticky-anchor'));
var window_height = $(window).height();
var scroll_panel_height = $('.role-assign-drag').height();
if (sticky_anchor_elem.length != 0) { if (sticky_anchor_elem.length != 0) {
var div_top = sticky_anchor_elem.offset().top; var div_top = sticky_anchor_elem.offset().top;
if (window_top > div_top) { if (window_top > div_top + 10 && window_height > scroll_panel_height + 150) {
$('.role-panel').addClass('stick'); $('.role-panel').addClass('stick');
} else { } else {
$('.role-panel').removeClass('stick'); $('.role-panel').removeClass('stick');