File tree Expand file tree Collapse file tree 3 files changed +60
-1
lines changed
Expand file tree Collapse file tree 3 files changed +60
-1
lines changed Original file line number Diff line number Diff line change 3232
3333CONF = cfg .CONF
3434
35+ opts = [
36+ cfg .StrOpt ('region_name' ,
37+ default = None ,
38+ help = 'OpenStack Region to use. This option will force cASO to '
39+ 'extract records from a specific OpenStack Region, in '
40+ 'there are several defined in the OpenStack site. '
41+ 'Defaults to None.' )
42+ ]
43+
44+ CONF .register_opts (opts )
45+
3546CONF .import_opt ("site_name" , "caso.extract.base" )
3647CONF .import_opt ("benchmark_name_key" , "caso.extract.base" )
3748CONF .import_opt ("benchmark_value_key" , "caso.extract.base" )
@@ -44,8 +55,10 @@ def __init__(self):
4455 super (OpenStackExtractor , self ).__init__ ()
4556
4657 def _get_nova_client (self , project ):
58+ region_name = CONF .region_name
4759 session = keystone_client .get_session (CONF , project )
48- return novaclient .client .Client (2 , session = session )
60+ return novaclient .client .Client (2 , session = session ,
61+ region_name = region_name )
4962
5063 def _get_glance_client (self , project ):
5164 session = keystone_client .get_session (CONF , project )
Original file line number Diff line number Diff line change 1+ ============
2+ cASO multi-region support
3+ ============
4+
5+ * In case the monitored projects rely on a specific region, define the
6+ following variable in the /etc/caso/caso.conf
7+
8+ .. code-block :: bash
9+
10+ [DEFAULT]
11+ region_name = < REGION>
12+
13+
14+ * In case the monitored Project(s) rely on different regions, prepare different
15+ files /etc/caso/caso-<REGION>.conf
16+
17+ .. code-block :: bash
18+
19+ [DEFAULT]
20+ region_name = < REGION>
21+
22+
23+ * List the Project(s) in the /etc/caso/voms.json as from the documentation
24+
25+ .. code-block :: JSON
26+
27+ {
28+ "Project1" : {
29+ "projects" : [" Project1" ]
30+ },
31+ "Project2" : {
32+ "projects" : [" Project2" ]
33+ }
34+ }
35+
36+ * Execute caso-extract for each Project (and related REGION) to be monitored (Project1-REGION1, Project2-REGION2)
37+
38+ .. code-block :: bash
39+
40+ /usr/bin/caso-extract --projects " Project1" --config-file /etc/caso/caso-< REGION1> .conf
41+ /usr/bin/caso-extract --projects " Project2" --config-file /etc/caso/caso-< REGION2> .conf
Original file line number Diff line number Diff line change 1+ ---
2+ features :
3+ - |
4+ Add multi-region support in order to extract information from several
5+ regions through different configuration files.
You can’t perform that action at this time.
0 commit comments