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