blob: c791b9ae2699e37966ce9437b4949a93a645198d [file] [log] [blame]
Aleš Komáreke5b388f2017-02-06 15:48:57 +01001==============
2Glance formula
3==============
Filip Pytlound681ae22015-10-06 16:28:31 +02004
Jakub Pavlik9e85d172016-05-20 11:13:14 +02005The Glance project provides services for discovering, registering, and
6retrieving virtual machine images. Glance has a RESTful API that allows
7querying of VM image metadata as well as retrieval of the actual image.
Filip Pytlound681ae22015-10-06 16:28:31 +02008
Filip Pytlound681ae22015-10-06 16:28:31 +02009
Aleš Komáreke5b388f2017-02-06 15:48:57 +010010Sample pillars
11==============
Filip Pytlound681ae22015-10-06 16:28:31 +020012
13.. code-block:: yaml
14
15 glance:
16 server:
17 enabled: true
18 version: juno
Alena Holanovac1e51312016-03-22 14:08:44 +010019 workers: 8
Filip Pytlound681ae22015-10-06 16:28:31 +020020 policy:
21 publicize_image:
22 - "role:admin"
23 - "role:image_manager"
24 database:
25 engine: mysql
26 host: 127.0.0.1
27 port: 3306
28 name: glance
29 user: glance
30 password: pwd
31 identity:
32 engine: keystone
33 host: 127.0.0.1
34 port: 35357
35 tenant: service
36 user: glance
37 password: pwd
38 message_queue:
39 engine: rabbitmq
40 host: 127.0.0.1
41 port: 5672
42 user: openstack
43 password: pwd
44 virtual_host: '/openstack'
45 storage:
46 engine: file
47 images:
48 - name: "CirrOS 0.3.1"
49 format: qcow2
50 file: cirros-0.3.1-x86_64-disk.img
51 source: http://cdn.download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img
52 public: true
Petr Michalec86ec0142016-11-29 16:34:15 +010053 audit:
54 enabled: false
Simon Pasquier2acbef52017-02-03 15:09:39 +010055 api_limit_max: 100
56 limit_param_default: 50
57
58The pagination is controlled by the *api_limit_max* and *limit_param_default*
59parameters as shown above:
60
61* *api_limit_max* defines the maximum number of records that the server will
62 return.
63
64* *limit_param_default* is the default *limit* parameter that
65 applies if the request didn't defined it explicitly.
Filip Pytlound681ae22015-10-06 16:28:31 +020066
Dmitry Ukov0a228ad2017-05-15 13:35:43 +040067Configuration of policy.json file
68
69.. code-block:: yaml
70
71 glance:
72 server:
73 ....
74 policy:
75 publicize_image: "role:admin"
76 # Add key without value to remove line from policy.json
77 add_member:
Aleš Komáreke5b388f2017-02-06 15:48:57 +010078Keystone and cinder region
79
80.. code-block:: yaml
81
82 glance:
83 server:
84 enabled: true
85 version: kilo
86 ...
87 identity:
88 engine: keystone
89 host: 127.0.0.1
90 region: RegionTwo
91 ...
92
93Ceph integration glance
94
95.. code-block:: yaml
96
97 glance:
98 server:
99 enabled: true
100 version: juno
101 storage:
102 engine: rbd,http
103 user: glance
104 pool: images
105 chunk_size: 8
106 client_glance_key: AQDOavlU6BsSJhAAnpFR906mvdgdfRqLHwu0Uw==
107
108RabbitMQ HA setup
109
110.. code-block:: yaml
111
112 glance:
113 server:
114 ....
115 message_queue:
116 engine: rabbitmq
117 members:
118 - host: 10.0.16.1
119 - host: 10.0.16.2
120 - host: 10.0.16.3
121 user: openstack
122 password: pwd
123 virtual_host: '/openstack'
124 ....
125
mnederlofad6d6242017-03-30 15:31:15 +0200126Enable Glance Image Cache:
127
128.. code-block:: yaml
129
130 glance:
131 server:
132 image_cache:
133 enabled: true
134 enable_management: true
135 directory: /var/lib/glance/image-cache/
136 max_size: 21474836480
137 ....
138
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100139Enable auditing filter (CADF):
140
141.. code-block:: yaml
142
143 glance:
144 server:
145 audit:
146 enabled: true
147 ....
148 filter_factory: 'keystonemiddleware.audit:filter_factory'
149 map_file: '/etc/pycadf/glance_api_audit_map.conf'
150 ....
151
RobertJansen168e84f92017-03-30 15:45:12 +0200152Swift integration glance
153
154.. code-block:: yaml
155
156 glance:
157 server:
158 enabled: true
159 version: mitaka
160 storage:
161 engine: swift,http
162 swift:
163 store:
164 auth:
165 address: http://keystone.example.com:5000/v2.0
166 version: 2
167 endpoint_type: publicURL
168 container: glance
169 create_container_on_put: true
170 retry_get_count: 5
171 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
172 key: someRandomPassword
173
Michel Nederlof3a867812017-05-15 09:46:11 +0200174Another way, which also supports multiple swift backends, can be configured like this:
175
176.. code-block:: yaml
177
178 glance:
179 server:
180 enabled: true
181 version: mitaka
182 storage:
183 engine: swift,http
184 swift:
185 store:
186 endpoint_type: publicURL
187 container: glance
188 create_container_on_put: true
189 retry_get_count: 5
190 references:
191 my_objectstore_reference_1:
192 auth:
193 address: http://keystone.example.com:5000/v2.0
194 version: 2
195 user: 2ec7966596504f59acc3a76b3b9d9291:glance-user
196 key: someRandomPassword
197
Ondrej Smolae695fe82017-04-28 12:22:28 +0200198Enable CORS parameters
199
200.. code-block:: yaml
201
202 glance:
203 server:
204 cors:
205 allowed_origin: https:localhost.local,http:localhost.local
206 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
207 allow_methods: GET,PUT,POST,DELETE,PATCH
208 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
209 allow_credentials: True
210 max_age: 86400
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100211
Michel Nederlof3ad5aac2017-05-15 09:46:24 +0200212Enable Viewing Multiple Locations
213---------------------------------
214If you want to expose all locations available (for example when you have
215multiple backends configured), then you can configure this like so:
216
217.. code-block:: yaml
218
219 glance:
220 server:
221 show_multiple_locations: True
222 location_strategy: store_type
223 store_type_preference: rbd,swift,file
224
225Please note: the show_multiple_locations option is deprecated since Newton and is planned
226 to be handled by policy files _only_ starting with the Pike release.
227
228This feature is convenient in a scenario when you have swift and rbd configured and want to
229benefit from rbd enhancements.
230
231
Richard Felkl4143a0e2017-02-01 23:24:13 +0100232Client role
233-----------
234
235Glance images
236
237.. code-block:: yaml
238
239 glance:
240 client:
241 enabled: true
242 server:
243 profile_admin:
244 image:
245 cirros-test:
246 visibility: public
247 protected: false
248 location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200249
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100250
251Usage
252=====
253
254Import new public image
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200255
256.. code-block:: yaml
257
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100258 glance image-create --name 'Windows 7 x86_64' --is-public true --container-format bare --disk-format qcow2 < ./win7.qcow2
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200259
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100260Change new image's disk properties
Petr Michalec86ec0142016-11-29 16:34:15 +0100261
262.. code-block:: yaml
263
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100264 glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide
Petr Michalec86ec0142016-11-29 16:34:15 +0100265
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100266Change new image's NIC properties
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100267
268.. code-block:: yaml
269
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100270 glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139
Jakub Pavlik80a41ea2016-03-06 14:33:42 +0100271
Jiri Konecny0456cfa2016-04-20 16:47:25 +0200272
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100273External links
274==============
Filip Pytlound681ae22015-10-06 16:28:31 +0200275
276* http://ceph.com/docs/master/rbd/rbd-openstack/
277
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100278
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200279Documentation and Bugs
Aleš Komáreke5b388f2017-02-06 15:48:57 +0100280======================
Filip Pytlound681ae22015-10-06 16:28:31 +0200281
Jakub Pavlik9e85d172016-05-20 11:13:14 +0200282To learn how to deploy OpenStack Salt, consult the documentation available
283online at:
284
285 https://wiki.openstack.org/wiki/OpenStackSalt
286
287In the unfortunate event that bugs are discovered, they should be reported to
288the appropriate bug tracker. If you obtained the software from a 3rd party
289operating system vendor, it is often wise to use their own bug tracker for
290reporting problems. In all other cases use the master OpenStack bug tracker,
291available at:
292
293 http://bugs.launchpad.net/openstack-salt
294
295Developers wishing to work on the OpenStack Salt project should always base
296their work on the latest formulas code, available from the master GIT
297repository at:
298
299 https://git.openstack.org/cgit/openstack/salt-formula-glance
300
301Developers should also join the discussion on the IRC list, at:
302
303 https://wiki.openstack.org/wiki/Meetings/openstack-salt
Filip Pytloune94a0a72017-02-02 13:02:03 +0100304
305Documentation and Bugs
306======================
307
308To learn how to install and update salt-formulas, consult the documentation
309available online at:
310
311 http://salt-formulas.readthedocs.io/
312
313In the unfortunate event that bugs are discovered, they should be reported to
314the appropriate issue tracker. Use Github issue tracker for specific salt
315formula:
316
317 https://github.com/salt-formulas/salt-formula-glance/issues
318
319For feature requests, bug reports or blueprints affecting entire ecosystem,
320use Launchpad salt-formulas project:
321
322 https://launchpad.net/salt-formulas
323
324You can also join salt-formulas-users team and subscribe to mailing list:
325
326 https://launchpad.net/~salt-formulas-users
327
328Developers wishing to work on the salt-formulas projects should always base
329their work on master branch and submit pull request against specific formula.
330
331 https://github.com/salt-formulas/salt-formula-glance
332
333Any questions or feedback is always welcome so feel free to join our IRC
334channel:
335
336 #salt-formulas @ irc.freenode.net