root / docs / collection_of_examples / configuration.rst @ ef04bdeb
History | View | Annotate | Download (10.7 kB)
1 | b4ed3a7e | Stavros Sachtouris | Configuration |
---|---|---|---|
2 | b4ed3a7e | Stavros Sachtouris | ============= |
3 | b4ed3a7e | Stavros Sachtouris | |
4 | b4ed3a7e | Stavros Sachtouris | Since kamaki 0.9, the format of the configuration file has changed. In this |
5 | b4ed3a7e | Stavros Sachtouris | scenario, we have an old configuration file at ${HOME}/.kamakirc that we need |
6 | b4ed3a7e | Stavros Sachtouris | to convert. We also create a new one from scratch. In both cases, we have to |
7 | b4ed3a7e | Stavros Sachtouris | set up one or more clouds in a single configuration and we also examine a case |
8 | b4ed3a7e | Stavros Sachtouris | of multiple configurations. |
9 | b4ed3a7e | Stavros Sachtouris | |
10 | b4ed3a7e | Stavros Sachtouris | Convert old configuration file |
11 | b4ed3a7e | Stavros Sachtouris | ------------------------------ |
12 | b4ed3a7e | Stavros Sachtouris | |
13 | b4ed3a7e | Stavros Sachtouris | First, back up the old file |
14 | b4ed3a7e | Stavros Sachtouris | |
15 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
16 | b4ed3a7e | Stavros Sachtouris | |
17 | b4ed3a7e | Stavros Sachtouris | $ cp ~/.kamakirc ~/backups/.kamakirc |
18 | b4ed3a7e | Stavros Sachtouris | |
19 | b4ed3a7e | Stavros Sachtouris | Now, let kamaki do the conversion |
20 | b4ed3a7e | Stavros Sachtouris | |
21 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
22 | b4ed3a7e | Stavros Sachtouris | |
23 | b4ed3a7e | Stavros Sachtouris | $ kamaki user authenticate |
24 | b4ed3a7e | Stavros Sachtouris | . Config file format version >= 9.0 is required |
25 | b4ed3a7e | Stavros Sachtouris | . Configuration file: /home/someuser/.kamakirc |
26 | b4ed3a7e | Stavros Sachtouris | . Attempting to fix this: |
27 | b4ed3a7e | Stavros Sachtouris | . Calculating changes while preserving information |
28 | b4ed3a7e | Stavros Sachtouris | . ... rescue global.token => cloud.default.token |
29 | b4ed3a7e | Stavros Sachtouris | . ... rescue user.cli => global.user_cli |
30 | b4ed3a7e | Stavros Sachtouris | . ... rescue network.cli => global.network_cli |
31 | b4ed3a7e | Stavros Sachtouris | . ... rescue file.cli => global.file_cli |
32 | b4ed3a7e | Stavros Sachtouris | . ... rescue flavor.cli => global.flavor_cli |
33 | b4ed3a7e | Stavros Sachtouris | . ... rescue config.cli => global.config_cli |
34 | b4ed3a7e | Stavros Sachtouris | . ... rescue image.cli => global.image_cli |
35 | b4ed3a7e | Stavros Sachtouris | . ... rescue server.cli => global.server_cli |
36 | b4ed3a7e | Stavros Sachtouris | . ... rescue history.file => global.history_file |
37 | b4ed3a7e | Stavros Sachtouris | . ... rescue history.cli => global.history_cli |
38 | b4ed3a7e | Stavros Sachtouris | . ... DONE |
39 | b4ed3a7e | Stavros Sachtouris | . The following information will NOT be preserved: |
40 | b4ed3a7e | Stavros Sachtouris | . global.account = AccountName |
41 | b4ed3a7e | Stavros Sachtouris | . user.url = https://accounts.example.com |
42 | b4ed3a7e | Stavros Sachtouris | . user.account = UserAccountName |
43 | b4ed3a7e | Stavros Sachtouris | . compute.url = https://cyclades.example.com/api/v1.1 |
44 | b4ed3a7e | Stavros Sachtouris | . file.url = https://pithos.example.com/v1 |
45 | b4ed3a7e | Stavros Sachtouris | . image.url = https://cyclades.example.com/plankton |
46 | b4ed3a7e | Stavros Sachtouris | . store.account = OldForgotenAccountName |
47 | b4ed3a7e | Stavros Sachtouris | . Kamaki is ready to convert the config file |
48 | b4ed3a7e | Stavros Sachtouris | . Create (overwrite) file .kamakirc.okeanos ? [y/N] |
49 | b4ed3a7e | Stavros Sachtouris | . |
50 | b4ed3a7e | Stavros Sachtouris | <y is pressed> |
51 | b4ed3a7e | Stavros Sachtouris | . |
52 | b4ed3a7e | Stavros Sachtouris | . No cloud "default" is configured |
53 | b4ed3a7e | Stavros Sachtouris | . | To configure a new cloud "default", find and set the |
54 | b4ed3a7e | Stavros Sachtouris | . | single authentication URL and token: |
55 | b4ed3a7e | Stavros Sachtouris | . | kamaki config set cloud.default.url <URL> |
56 | b4ed3a7e | Stavros Sachtouris | . | kamaki config set cloud.default.token <t0k3n> |
57 | b4ed3a7e | Stavros Sachtouris | $ |
58 | b4ed3a7e | Stavros Sachtouris | |
59 | b4ed3a7e | Stavros Sachtouris | .. warning:: A new cloud configuration with the name "default" is created. The |
60 | b4ed3a7e | Stavros Sachtouris | global token that was set in the old configuration file, is preserved as |
61 | b4ed3a7e | Stavros Sachtouris | the token of the "default" cloud. Still, kamaki needs a url for the cloud |
62 | b4ed3a7e | Stavros Sachtouris | and it encourages you to reset the token as well. |
63 | b4ed3a7e | Stavros Sachtouris | |
64 | b4ed3a7e | Stavros Sachtouris | .. note:: Some options are discarded. Among them, are the service urls, like |
65 | b4ed3a7e | Stavros Sachtouris | user.url, compute.url, image.url and file.url . These settings are obsolete |
66 | b4ed3a7e | Stavros Sachtouris | since Synnefo 0.14 and kamaki 0.9 so you do not need to recover them. The |
67 | b4ed3a7e | Stavros Sachtouris | same is true for user accounts (retrieved automatically) |
68 | b4ed3a7e | Stavros Sachtouris | |
69 | b4ed3a7e | Stavros Sachtouris | .. note:: You can safely remove the global.XXX_cli options from kamaki |
70 | b4ed3a7e | Stavros Sachtouris | configuration file. Kamaki can automatically resolve the default values for |
71 | b4ed3a7e | Stavros Sachtouris | these internal options. These options are usefull when overloading the |
72 | b4ed3a7e | Stavros Sachtouris | default command behaviors, but are not needed otherwise. |
73 | b4ed3a7e | Stavros Sachtouris | |
74 | b4ed3a7e | Stavros Sachtouris | Attempt to create a new configuration |
75 | b4ed3a7e | Stavros Sachtouris | ------------------------------------- |
76 | b4ed3a7e | Stavros Sachtouris | |
77 | b4ed3a7e | Stavros Sachtouris | Ask kamaki to load from a non-existing configuration file |
78 | b4ed3a7e | Stavros Sachtouris | |
79 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
80 | b4ed3a7e | Stavros Sachtouris | |
81 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c nonexisting.cnf user authenticate |
82 | b4ed3a7e | Stavros Sachtouris | . No cloud is configured |
83 | b4ed3a7e | Stavros Sachtouris | . | To configure a new cloud "<cloud name>", find and set the |
84 | b4ed3a7e | Stavros Sachtouris | . | single authentication URL and token: |
85 | b4ed3a7e | Stavros Sachtouris | . | kamaki config set cloud.<cloud name>.url <URL> |
86 | b4ed3a7e | Stavros Sachtouris | . | kamaki config set cloud.<cloud name>.token <t0k3n> |
87 | b4ed3a7e | Stavros Sachtouris | $ ls -l nonexisting.cnf |
88 | b4ed3a7e | Stavros Sachtouris | . ls: cannot access nonexisting.cnf: No such file or directory |
89 | b4ed3a7e | Stavros Sachtouris | $ |
90 | b4ed3a7e | Stavros Sachtouris | |
91 | b4ed3a7e | Stavros Sachtouris | .. note:: configuration file is not created, but it will be when we set the |
92 | b4ed3a7e | Stavros Sachtouris | first configuration value in it, as shown in the following subsection. |
93 | b4ed3a7e | Stavros Sachtouris | |
94 | b4ed3a7e | Stavros Sachtouris | Configure a cloud and create a new configuration |
95 | b4ed3a7e | Stavros Sachtouris | ------------------------------------------------ |
96 | b4ed3a7e | Stavros Sachtouris | |
97 | b4ed3a7e | Stavros Sachtouris | Set the URL for new cloud "mytest" |
98 | b4ed3a7e | Stavros Sachtouris | |
99 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
100 | b4ed3a7e | Stavros Sachtouris | |
101 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c nonexisting.cnf config set cloud.mytest.url https://accounts.example.com/identity/v2.0/ |
102 | b4ed3a7e | Stavros Sachtouris | |
103 | b4ed3a7e | Stavros Sachtouris | Try to connect |
104 | b4ed3a7e | Stavros Sachtouris | |
105 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
106 | b4ed3a7e | Stavros Sachtouris | |
107 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c nonexisting.cnf user authenticate |
108 | b4ed3a7e | Stavros Sachtouris | . No authentication token provided for cloud "mytest" |
109 | b4ed3a7e | Stavros Sachtouris | . | Set a token for cloud mytest: |
110 | b4ed3a7e | Stavros Sachtouris | . | kamaki config set cloud.mytest.token <token> |
111 | b4ed3a7e | Stavros Sachtouris | |
112 | b4ed3a7e | Stavros Sachtouris | Set token to cloud "mytest" |
113 | b4ed3a7e | Stavros Sachtouris | |
114 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
115 | b4ed3a7e | Stavros Sachtouris | |
116 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c nonexisting.cnf config set cloud.mytest.token myt35t70k3n== |
117 | b4ed3a7e | Stavros Sachtouris | |
118 | b4ed3a7e | Stavros Sachtouris | Check that the file is created, everything is set up correctly and working |
119 | b4ed3a7e | Stavros Sachtouris | |
120 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
121 | b4ed3a7e | Stavros Sachtouris | |
122 | b4ed3a7e | Stavros Sachtouris | $ ls -l nonexisting.cnf |
123 | b4ed3a7e | Stavros Sachtouris | . -rw======- 1 someuser someuser 491 Jun 17 13:39 nonexisting.cnf |
124 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c nonexisting.cnf config get cloud |
125 | b4ed3a7e | Stavros Sachtouris | . cloud.mytest.url = https://accounts.example.com/identity/v2.0/ |
126 | b4ed3a7e | Stavros Sachtouris | . cloud.mytest.token = myt35t70k3n== |
127 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c nonexisting.cnf user autenticate |
128 | b4ed3a7e | Stavros Sachtouris | . ... |
129 | b4ed3a7e | Stavros Sachtouris | . user: |
130 | b4ed3a7e | Stavros Sachtouris | . id: s0me-3x4mp13-u53r-1d |
131 | b4ed3a7e | Stavros Sachtouris | . name: Some User |
132 | b4ed3a7e | Stavros Sachtouris | . roles: |
133 | b4ed3a7e | Stavros Sachtouris | . id: 1 |
134 | b4ed3a7e | Stavros Sachtouris | . name: default |
135 | b4ed3a7e | Stavros Sachtouris | . roles_links: |
136 | b4ed3a7e | Stavros Sachtouris | $ |
137 | b4ed3a7e | Stavros Sachtouris | |
138 | b4ed3a7e | Stavros Sachtouris | Failed or incomplete cloud configurations |
139 | b4ed3a7e | Stavros Sachtouris | ----------------------------------------- |
140 | b4ed3a7e | Stavros Sachtouris | |
141 | b4ed3a7e | Stavros Sachtouris | Now let kamaki use the default configuration ( ${HOME}/.kamakirc ). Let the old |
142 | b4ed3a7e | Stavros Sachtouris | token be `my0ld70k3n==` and let it be invalid. |
143 | b4ed3a7e | Stavros Sachtouris | |
144 | b4ed3a7e | Stavros Sachtouris | Check for clouds and attempt to authenticate |
145 | b4ed3a7e | Stavros Sachtouris | |
146 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
147 | b4ed3a7e | Stavros Sachtouris | |
148 | b4ed3a7e | Stavros Sachtouris | $ kamaki config get cloud |
149 | b4ed3a7e | Stavros Sachtouris | . cloud.default.token = my0ld70k3n== |
150 | b4ed3a7e | Stavros Sachtouris | $ kamaki user authenticate |
151 | b4ed3a7e | Stavros Sachtouris | . No authentication URL provided for cloud "mytest" |
152 | b4ed3a7e | Stavros Sachtouris | . | Set a URL for cloud mytest: |
153 | b4ed3a7e | Stavros Sachtouris | . | kamaki config set cloud.mytest.url <URL> |
154 | b4ed3a7e | Stavros Sachtouris | $ |
155 | b4ed3a7e | Stavros Sachtouris | |
156 | b4ed3a7e | Stavros Sachtouris | Set a non-existing URL for cloud.default and attempt authentication |
157 | b4ed3a7e | Stavros Sachtouris | |
158 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
159 | b4ed3a7e | Stavros Sachtouris | |
160 | b4ed3a7e | Stavros Sachtouris | $ kamaki config set cloud.default.url https://nonexisting.example.com |
161 | b4ed3a7e | Stavros Sachtouris | $ kamaki user authenticate |
162 | b4ed3a7e | Stavros Sachtouris | . Failed while http-connecting to https://nonexisting.example.com |
163 | b4ed3a7e | Stavros Sachtouris | $ |
164 | b4ed3a7e | Stavros Sachtouris | |
165 | b4ed3a7e | Stavros Sachtouris | Set the URL from the previous example and attempt authentication |
166 | b4ed3a7e | Stavros Sachtouris | |
167 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
168 | b4ed3a7e | Stavros Sachtouris | |
169 | b4ed3a7e | Stavros Sachtouris | $ kamaki config set cloud.default.url https://accounts.example.com/identity/v2.0/ |
170 | b4ed3a7e | Stavros Sachtouris | $ kamaki user authenticate |
171 | b4ed3a7e | Stavros Sachtouris | . (401) Authorization failed for token gZH99orgkfYHmGksZKvHJw== |
172 | b4ed3a7e | Stavros Sachtouris | . | UNAUTHORIZED unauthorized (Invalid token) |
173 | b4ed3a7e | Stavros Sachtouris | $ |
174 | b4ed3a7e | Stavros Sachtouris | |
175 | b4ed3a7e | Stavros Sachtouris | After some searching at the deployments UI, you found out that the URL/token |
176 | b4ed3a7e | Stavros Sachtouris | pair you need is:: |
177 | b4ed3a7e | Stavros Sachtouris | |
178 | b4ed3a7e | Stavros Sachtouris | URL: https://accounts.deploymentexample.com/identity/v2.0 |
179 | b4ed3a7e | Stavros Sachtouris | TOKEN: myd3pl0ym3nt70k3n== |
180 | b4ed3a7e | Stavros Sachtouris | |
181 | b4ed3a7e | Stavros Sachtouris | Set up the correct values and attempt authentication |
182 | b4ed3a7e | Stavros Sachtouris | |
183 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
184 | b4ed3a7e | Stavros Sachtouris | |
185 | b4ed3a7e | Stavros Sachtouris | $ kamaki config set cloud.default.url https://accounts.deploymentexample.com/identity/v2.0 |
186 | b4ed3a7e | Stavros Sachtouris | $ kamaki config set cloud.default.token myd3pl0ym3nt70k3n== |
187 | b4ed3a7e | Stavros Sachtouris | $ kamaki user authenticate |
188 | b4ed3a7e | Stavros Sachtouris | . ... |
189 | b4ed3a7e | Stavros Sachtouris | . user: |
190 | b4ed3a7e | Stavros Sachtouris | . id: my-d3pl0ym3nt-u53r-1d |
191 | b4ed3a7e | Stavros Sachtouris | . name: Example Username |
192 | b4ed3a7e | Stavros Sachtouris | $ |
193 | b4ed3a7e | Stavros Sachtouris | |
194 | b4ed3a7e | Stavros Sachtouris | Multiple clouds in a single configuration |
195 | b4ed3a7e | Stavros Sachtouris | ----------------------------------------- |
196 | b4ed3a7e | Stavros Sachtouris | |
197 | b4ed3a7e | Stavros Sachtouris | We now have two configurations:: |
198 | b4ed3a7e | Stavros Sachtouris | |
199 | b4ed3a7e | Stavros Sachtouris | Configuration file: ${HOME}/.kamakirc (default) |
200 | b4ed3a7e | Stavros Sachtouris | Clouds: |
201 | b4ed3a7e | Stavros Sachtouris | ALIAS: default |
202 | b4ed3a7e | Stavros Sachtouris | URL: https://accounts.deploymentexample.com/identity/v2.0 |
203 | b4ed3a7e | Stavros Sachtouris | TOKEN: myd3pl0ym3nt70k3n== |
204 | b4ed3a7e | Stavros Sachtouris | |
205 | b4ed3a7e | Stavros Sachtouris | Copnfiguration file: nonexisting.cnf |
206 | b4ed3a7e | Stavros Sachtouris | Clouds: |
207 | b4ed3a7e | Stavros Sachtouris | ALIAS: mytest |
208 | b4ed3a7e | Stavros Sachtouris | URL: https://accounts.example.com/identity/v2.0/ |
209 | b4ed3a7e | Stavros Sachtouris | TOKEN: myt35t70k3n== |
210 | b4ed3a7e | Stavros Sachtouris | |
211 | b4ed3a7e | Stavros Sachtouris | As we can see, the default configuration handles only one cloud, aliased as |
212 | b4ed3a7e | Stavros Sachtouris | "default". We will add the second cloud as well. |
213 | b4ed3a7e | Stavros Sachtouris | |
214 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
215 | b4ed3a7e | Stavros Sachtouris | |
216 | b4ed3a7e | Stavros Sachtouris | $ kamaki config set cloud.mytest.url https://accounts.example.com/identity/v2.0/ |
217 | b4ed3a7e | Stavros Sachtouris | $ kamaki config set cloud.mytest.token myt35t70k3n== |
218 | b4ed3a7e | Stavros Sachtouris | $ |
219 | b4ed3a7e | Stavros Sachtouris | |
220 | b4ed3a7e | Stavros Sachtouris | Check all clouds |
221 | b4ed3a7e | Stavros Sachtouris | |
222 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
223 | b4ed3a7e | Stavros Sachtouris | |
224 | b4ed3a7e | Stavros Sachtouris | $ kamaki config get cloud |
225 | b4ed3a7e | Stavros Sachtouris | . cloud.default.url = https://accounts.deploymentexample.com/identity/v2.0/ |
226 | b4ed3a7e | Stavros Sachtouris | . cloud.default.token = myd3pl0ym3nt70k3n== |
227 | b4ed3a7e | Stavros Sachtouris | . cloud.mytest.url = https://accounts.example.com/identity/v2.0/ |
228 | b4ed3a7e | Stavros Sachtouris | . cloud.mytest.token = myt35t70k3n== |
229 | b4ed3a7e | Stavros Sachtouris | $ |
230 | b4ed3a7e | Stavros Sachtouris | |
231 | b4ed3a7e | Stavros Sachtouris | Check if kamaki knows one of the clouds to be the default |
232 | b4ed3a7e | Stavros Sachtouris | |
233 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
234 | b4ed3a7e | Stavros Sachtouris | |
235 | b4ed3a7e | Stavros Sachtouris | $ kamaki config get default_cloud |
236 | b4ed3a7e | Stavros Sachtouris | . default |
237 | b4ed3a7e | Stavros Sachtouris | $ |
238 | b4ed3a7e | Stavros Sachtouris | |
239 | b4ed3a7e | Stavros Sachtouris | Authenticate against different clouds |
240 | b4ed3a7e | Stavros Sachtouris | |
241 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
242 | b4ed3a7e | Stavros Sachtouris | |
243 | b4ed3a7e | Stavros Sachtouris | $ kamaki user authenticate |
244 | b4ed3a7e | Stavros Sachtouris | . ... |
245 | b4ed3a7e | Stavros Sachtouris | . <response from deploymentexample.com> |
246 | b4ed3a7e | Stavros Sachtouris | . ... |
247 | 9d0a8ecf | Stavros Sachtouris | $ kamaki --cloud=mytest user authenticate |
248 | b4ed3a7e | Stavros Sachtouris | . ... |
249 | b4ed3a7e | Stavros Sachtouris | . <response from example.com> |
250 | b4ed3a7e | Stavros Sachtouris | . ... |
251 | 9d0a8ecf | Stavros Sachtouris | $ kamaki --cloud=default user authenticate |
252 | b4ed3a7e | Stavros Sachtouris | . ... |
253 | b4ed3a7e | Stavros Sachtouris | . <response from deploymentexample.com, same as default behavior> |
254 | b4ed3a7e | Stavros Sachtouris | . ... |
255 | 9d0a8ecf | Stavros Sachtouris | $ kamaki --cloud=nonexistingcloud user authenticate |
256 | b4ed3a7e | Stavros Sachtouris | . No cloud "nonexistingcloud" is configured |
257 | b4ed3a7e | Stavros Sachtouris | . | To configure a new cloud "nonexistingcloud", find and set the |
258 | b4ed3a7e | Stavros Sachtouris | . | single authentication URL and token: |
259 | b4ed3a7e | Stavros Sachtouris | . | kamaki config set cloud.nonexistingcloud.url <URL> |
260 | b4ed3a7e | Stavros Sachtouris | . | kamaki config set cloud.nonexistingcloud.token <t0k3n> |
261 | b4ed3a7e | Stavros Sachtouris | $ |
262 | b4ed3a7e | Stavros Sachtouris | |
263 | b4ed3a7e | Stavros Sachtouris | Confuse kamaki by removing the default_cloud option, set mytest as default |
264 | b4ed3a7e | Stavros Sachtouris | |
265 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
266 | b4ed3a7e | Stavros Sachtouris | |
267 | b4ed3a7e | Stavros Sachtouris | $ kamaki config delete default_cloud |
268 | b4ed3a7e | Stavros Sachtouris | $ kamaki user authenticate |
269 | b4ed3a7e | Stavros Sachtouris | . Found 2 clouds but none of them is set as default |
270 | b4ed3a7e | Stavros Sachtouris | . | Please, choose one of the following cloud names: |
271 | b4ed3a7e | Stavros Sachtouris | . | default, mytest |
272 | b4ed3a7e | Stavros Sachtouris | . | To set a default cloud: |
273 | b4ed3a7e | Stavros Sachtouris | . | kamaki config set default_cloud <cloud name> |
274 | b4ed3a7e | Stavros Sachtouris | $ kamaki config set default_cloud mytest |
275 | b4ed3a7e | Stavros Sachtouris | $ kamaki user authenticate |
276 | b4ed3a7e | Stavros Sachtouris | . ... |
277 | b4ed3a7e | Stavros Sachtouris | . <response from example.com> |
278 | b4ed3a7e | Stavros Sachtouris | . ... |
279 | b4ed3a7e | Stavros Sachtouris | $ |
280 | b4ed3a7e | Stavros Sachtouris | |
281 | b4ed3a7e | Stavros Sachtouris | `Question`: What will happen if the "default" cloud alias **and** the |
282 | b4ed3a7e | Stavros Sachtouris | default_cloud option are removed? |
283 | b4ed3a7e | Stavros Sachtouris | |
284 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
285 | b4ed3a7e | Stavros Sachtouris | |
286 | b4ed3a7e | Stavros Sachtouris | $ kamaki config delete cloud.default |
287 | b4ed3a7e | Stavros Sachtouris | $ kamaki config delete default_cloud |
288 | b4ed3a7e | Stavros Sachtouris | $ kamaki user authenticate |
289 | b4ed3a7e | Stavros Sachtouris | . ... |
290 | b4ed3a7e | Stavros Sachtouris | . <response from example.com> |
291 | b4ed3a7e | Stavros Sachtouris | . ... |
292 | b4ed3a7e | Stavros Sachtouris | $ |
293 | b4ed3a7e | Stavros Sachtouris | |
294 | b4ed3a7e | Stavros Sachtouris | `Answer`: kamaki doesn't have a default_cloud option, but there is only one |
295 | b4ed3a7e | Stavros Sachtouris | cloud configuration (`mytest`), therefore there is no ambiguity in resolving |
296 | b4ed3a7e | Stavros Sachtouris | the default cloud. |
297 | b4ed3a7e | Stavros Sachtouris | |
298 | b4ed3a7e | Stavros Sachtouris | Multiple configurations |
299 | b4ed3a7e | Stavros Sachtouris | ----------------------- |
300 | b4ed3a7e | Stavros Sachtouris | |
301 | b4ed3a7e | Stavros Sachtouris | In the following example, a user wants to experiment with upload and download |
302 | b4ed3a7e | Stavros Sachtouris | for different number of threads. The plan is to contuct a set of tests with 3 |
303 | b4ed3a7e | Stavros Sachtouris | threads at most and another one with 5. All experiments will be run against the |
304 | b4ed3a7e | Stavros Sachtouris | same Synnefo cloud (the "mytest" cloud from the previous example). |
305 | b4ed3a7e | Stavros Sachtouris | |
306 | b4ed3a7e | Stavros Sachtouris | Let's create the 3-threaded configuration first |
307 | b4ed3a7e | Stavros Sachtouris | |
308 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
309 | b4ed3a7e | Stavros Sachtouris | |
310 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c 3thread config set cloud.test.url https://accounts.example.com/identity/v2.0/ |
311 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c 3thread config set cloud.test.token myt35t70k3n== |
312 | b4ed3a7e | Stavros Sachtouris | $ |
313 | b4ed3a7e | Stavros Sachtouris | |
314 | b4ed3a7e | Stavros Sachtouris | Let's set the max_thread option to 3 as well as a seperate file for logs. |
315 | b4ed3a7e | Stavros Sachtouris | |
316 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
317 | b4ed3a7e | Stavros Sachtouris | |
318 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c 3thread config set max_thread 3 |
319 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c 3thread config log_file ./logs/kamaki.3threads.log |
320 | b4ed3a7e | Stavros Sachtouris | $ |
321 | b4ed3a7e | Stavros Sachtouris | |
322 | b4ed3a7e | Stavros Sachtouris | Now, let's create the 5-threaded configuration by modifying a copy of 3thread |
323 | b4ed3a7e | Stavros Sachtouris | |
324 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
325 | b4ed3a7e | Stavros Sachtouris | |
326 | b4ed3a7e | Stavros Sachtouris | $ cp 3thread 5thread |
327 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c 5thread config set max_thread 5 |
328 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c 5thread config log_file ./logs/kamaki.5threads.log |
329 | b4ed3a7e | Stavros Sachtouris | $ |
330 | b4ed3a7e | Stavros Sachtouris | |
331 | b4ed3a7e | Stavros Sachtouris | Use kamaki to upload with 3 threads and 5 threads respectively |
332 | b4ed3a7e | Stavros Sachtouris | |
333 | b4ed3a7e | Stavros Sachtouris | .. code-block:: console |
334 | b4ed3a7e | Stavros Sachtouris | |
335 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c 3thread file upload testfiles/test1 testcontainer |
336 | b4ed3a7e | Stavros Sachtouris | $ kamaki -c 5thread file upload testfiles/test1 testcontainer |
337 | b4ed3a7e | Stavros Sachtouris | $ |