Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 1 | ============== |
| 2 | Glance formula |
| 3 | ============== |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 4 | |
Jakub Pavlik | 9e85d17 | 2016-05-20 11:13:14 +0200 | [diff] [blame] | 5 | The Glance project provides services for discovering, registering, and |
| 6 | retrieving virtual machine images. Glance has a RESTful API that allows |
| 7 | querying of VM image metadata as well as retrieval of the actual image. |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 8 | |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 9 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 10 | Sample pillars |
| 11 | ============== |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 12 | |
| 13 | .. code-block:: yaml |
| 14 | |
| 15 | glance: |
| 16 | server: |
| 17 | enabled: true |
| 18 | version: juno |
Alena Holanova | c1e5131 | 2016-03-22 14:08:44 +0100 | [diff] [blame] | 19 | workers: 8 |
Dmitry Stremkovskiy | e9490cf | 2017-07-11 11:37:44 +0300 | [diff] [blame] | 20 | glance_uid: 302 |
| 21 | glance_gid: 302 |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 22 | 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 Michalec | 86ec014 | 2016-11-29 16:34:15 +0100 | [diff] [blame] | 55 | audit: |
| 56 | enabled: false |
Simon Pasquier | 2acbef5 | 2017-02-03 15:09:39 +0100 | [diff] [blame] | 57 | api_limit_max: 100 |
| 58 | limit_param_default: 50 |
Oleg Iurchenko | 68ae355 | 2017-10-13 18:40:42 +0300 | [diff] [blame] | 59 | barbican: |
| 60 | enabled: true |
Simon Pasquier | 2acbef5 | 2017-02-03 15:09:39 +0100 | [diff] [blame] | 61 | |
| 62 | The pagination is controlled by the *api_limit_max* and *limit_param_default* |
| 63 | parameters as shown above: |
| 64 | |
| 65 | * *api_limit_max* defines the maximum number of records that the server will |
| 66 | return. |
| 67 | |
| 68 | * *limit_param_default* is the default *limit* parameter that |
| 69 | applies if the request didn't defined it explicitly. |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 70 | |
Dmitry Ukov | 0a228ad | 2017-05-15 13:35:43 +0400 | [diff] [blame] | 71 | Configuration of policy.json file |
| 72 | |
| 73 | .. code-block:: yaml |
| 74 | |
| 75 | glance: |
| 76 | server: |
| 77 | .... |
| 78 | policy: |
| 79 | publicize_image: "role:admin" |
| 80 | # Add key without value to remove line from policy.json |
| 81 | add_member: |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 82 | Keystone and cinder region |
| 83 | |
| 84 | .. code-block:: yaml |
| 85 | |
| 86 | glance: |
| 87 | server: |
| 88 | enabled: true |
| 89 | version: kilo |
| 90 | ... |
| 91 | identity: |
| 92 | engine: keystone |
| 93 | host: 127.0.0.1 |
| 94 | region: RegionTwo |
| 95 | ... |
| 96 | |
| 97 | Ceph integration glance |
| 98 | |
| 99 | .. code-block:: yaml |
| 100 | |
| 101 | glance: |
| 102 | server: |
| 103 | enabled: true |
| 104 | version: juno |
| 105 | storage: |
| 106 | engine: rbd,http |
| 107 | user: glance |
| 108 | pool: images |
| 109 | chunk_size: 8 |
| 110 | client_glance_key: AQDOavlU6BsSJhAAnpFR906mvdgdfRqLHwu0Uw== |
| 111 | |
| 112 | RabbitMQ HA setup |
| 113 | |
| 114 | .. code-block:: yaml |
| 115 | |
| 116 | glance: |
| 117 | server: |
| 118 | .... |
| 119 | message_queue: |
| 120 | engine: rabbitmq |
| 121 | members: |
| 122 | - host: 10.0.16.1 |
| 123 | - host: 10.0.16.2 |
| 124 | - host: 10.0.16.3 |
| 125 | user: openstack |
| 126 | password: pwd |
| 127 | virtual_host: '/openstack' |
| 128 | .... |
| 129 | |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 130 | Configuring TLS communications |
| 131 | ------------------------------ |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 132 | |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 133 | |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 134 | **Note:** by default system wide installed CA certs are used, so ``cacert_file`` param is optional, as well as ``cacert``. |
| 135 | |
| 136 | |
| 137 | - **RabbitMQ TLS** |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 138 | |
| 139 | .. code-block:: yaml |
| 140 | |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 141 | glance: |
| 142 | server: |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 143 | message_queue: |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 144 | port: 5671 |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 145 | ssl: |
| 146 | enabled: True |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 147 | (optional) cacert: cert body if the cacert_file does not exists |
| 148 | (optional) cacert_file: /etc/openstack/rabbitmq-ca.pem |
| 149 | (optional) version: TLSv1_2 |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 150 | |
| 151 | |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 152 | - **MySQL TLS** |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 153 | |
| 154 | .. code-block:: yaml |
| 155 | |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 156 | glance: |
| 157 | server: |
| 158 | database: |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 159 | ssl: |
| 160 | enabled: True |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 161 | (optional) cacert: cert body if the cacert_file does not exists |
| 162 | (optional) cacert_file: /etc/openstack/mysql-ca.pem |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 163 | |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 164 | - **Openstack HTTPS API** |
| 165 | |
| 166 | |
| 167 | Set the ``https`` as protocol at ``glance:server`` sections: |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 168 | |
| 169 | .. code-block:: yaml |
| 170 | |
Kirill Bespalov | b558436 | 2017-11-20 16:42:07 +0300 | [diff] [blame^] | 171 | glance: |
| 172 | server: |
| 173 | identity: |
| 174 | protocol: https |
| 175 | (optional) cacert_file: /etc/openstack/proxy.pem |
| 176 | registry: |
| 177 | protocol: https |
| 178 | (optional) cacert_file: /etc/openstack/proxy.pem |
| 179 | storage: |
| 180 | engine: cinder, swift |
| 181 | cinder: |
| 182 | protocol: https |
| 183 | (optional) cacert_file: /etc/openstack/proxy.pem |
| 184 | swift: |
| 185 | store: |
| 186 | (optional) cafile: /etc/openstack/proxy.pem |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 187 | |
Kirill Bespalov | 365d243 | 2017-07-28 09:01:04 +0300 | [diff] [blame] | 188 | |
| 189 | |
mnederlof | ad6d624 | 2017-03-30 15:31:15 +0200 | [diff] [blame] | 190 | Enable Glance Image Cache: |
| 191 | |
| 192 | .. code-block:: yaml |
| 193 | |
| 194 | glance: |
| 195 | server: |
| 196 | image_cache: |
| 197 | enabled: true |
| 198 | enable_management: true |
| 199 | directory: /var/lib/glance/image-cache/ |
| 200 | max_size: 21474836480 |
| 201 | .... |
| 202 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 203 | Enable auditing filter (CADF): |
| 204 | |
| 205 | .. code-block:: yaml |
| 206 | |
| 207 | glance: |
| 208 | server: |
| 209 | audit: |
| 210 | enabled: true |
| 211 | .... |
| 212 | filter_factory: 'keystonemiddleware.audit:filter_factory' |
| 213 | map_file: '/etc/pycadf/glance_api_audit_map.conf' |
| 214 | .... |
| 215 | |
RobertJansen1 | 68e84f9 | 2017-03-30 15:45:12 +0200 | [diff] [blame] | 216 | Swift integration glance |
| 217 | |
| 218 | .. code-block:: yaml |
| 219 | |
| 220 | glance: |
| 221 | server: |
| 222 | enabled: true |
| 223 | version: mitaka |
| 224 | storage: |
| 225 | engine: swift,http |
| 226 | swift: |
| 227 | store: |
| 228 | auth: |
| 229 | address: http://keystone.example.com:5000/v2.0 |
| 230 | version: 2 |
| 231 | endpoint_type: publicURL |
| 232 | container: glance |
| 233 | create_container_on_put: true |
| 234 | retry_get_count: 5 |
| 235 | user: 2ec7966596504f59acc3a76b3b9d9291:glance-user |
| 236 | key: someRandomPassword |
| 237 | |
Michel Nederlof | 3a86781 | 2017-05-15 09:46:11 +0200 | [diff] [blame] | 238 | Another way, which also supports multiple swift backends, can be configured like this: |
| 239 | |
| 240 | .. code-block:: yaml |
| 241 | |
| 242 | glance: |
| 243 | server: |
| 244 | enabled: true |
| 245 | version: mitaka |
| 246 | storage: |
| 247 | engine: swift,http |
| 248 | swift: |
| 249 | store: |
| 250 | endpoint_type: publicURL |
| 251 | container: glance |
| 252 | create_container_on_put: true |
| 253 | retry_get_count: 5 |
| 254 | references: |
| 255 | my_objectstore_reference_1: |
| 256 | auth: |
| 257 | address: http://keystone.example.com:5000/v2.0 |
| 258 | version: 2 |
| 259 | user: 2ec7966596504f59acc3a76b3b9d9291:glance-user |
| 260 | key: someRandomPassword |
| 261 | |
Ondrej Smola | e695fe8 | 2017-04-28 12:22:28 +0200 | [diff] [blame] | 262 | Enable CORS parameters |
| 263 | |
| 264 | .. code-block:: yaml |
| 265 | |
| 266 | glance: |
| 267 | server: |
| 268 | cors: |
| 269 | allowed_origin: https:localhost.local,http:localhost.local |
| 270 | expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token |
| 271 | allow_methods: GET,PUT,POST,DELETE,PATCH |
| 272 | allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token |
| 273 | allow_credentials: True |
| 274 | max_age: 86400 |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 275 | |
Michel Nederlof | 3ad5aac | 2017-05-15 09:46:24 +0200 | [diff] [blame] | 276 | Enable Viewing Multiple Locations |
| 277 | --------------------------------- |
| 278 | If you want to expose all locations available (for example when you have |
| 279 | multiple backends configured), then you can configure this like so: |
| 280 | |
| 281 | .. code-block:: yaml |
| 282 | |
| 283 | glance: |
| 284 | server: |
| 285 | show_multiple_locations: True |
| 286 | location_strategy: store_type |
| 287 | store_type_preference: rbd,swift,file |
| 288 | |
| 289 | Please note: the show_multiple_locations option is deprecated since Newton and is planned |
| 290 | to be handled by policy files _only_ starting with the Pike release. |
| 291 | |
| 292 | This feature is convenient in a scenario when you have swift and rbd configured and want to |
| 293 | benefit from rbd enhancements. |
| 294 | |
| 295 | |
Oleg Iurchenko | 68ae355 | 2017-10-13 18:40:42 +0300 | [diff] [blame] | 296 | Barbican integration glance |
| 297 | --------------------------- |
| 298 | |
| 299 | .. code-block:: yaml |
| 300 | |
| 301 | glance: |
| 302 | server: |
| 303 | barbican: |
| 304 | enabled: true |
| 305 | |
| 306 | |
Richard Felkl | 4143a0e | 2017-02-01 23:24:13 +0100 | [diff] [blame] | 307 | Client role |
| 308 | ----------- |
| 309 | |
| 310 | Glance images |
| 311 | |
| 312 | .. code-block:: yaml |
| 313 | |
| 314 | glance: |
| 315 | client: |
| 316 | enabled: true |
| 317 | server: |
| 318 | profile_admin: |
| 319 | image: |
| 320 | cirros-test: |
| 321 | visibility: public |
| 322 | protected: false |
| 323 | location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img |
Jiri Konecny | 0456cfa | 2016-04-20 16:47:25 +0200 | [diff] [blame] | 324 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 325 | |
| 326 | Usage |
| 327 | ===== |
| 328 | |
| 329 | Import new public image |
Jiri Konecny | 0456cfa | 2016-04-20 16:47:25 +0200 | [diff] [blame] | 330 | |
| 331 | .. code-block:: yaml |
| 332 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 333 | glance image-create --name 'Windows 7 x86_64' --is-public true --container-format bare --disk-format qcow2 < ./win7.qcow2 |
Jiri Konecny | 0456cfa | 2016-04-20 16:47:25 +0200 | [diff] [blame] | 334 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 335 | Change new image's disk properties |
Petr Michalec | 86ec014 | 2016-11-29 16:34:15 +0100 | [diff] [blame] | 336 | |
| 337 | .. code-block:: yaml |
| 338 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 339 | glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide |
Petr Michalec | 86ec014 | 2016-11-29 16:34:15 +0100 | [diff] [blame] | 340 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 341 | Change new image's NIC properties |
Jakub Pavlik | 80a41ea | 2016-03-06 14:33:42 +0100 | [diff] [blame] | 342 | |
| 343 | .. code-block:: yaml |
| 344 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 345 | glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139 |
Jakub Pavlik | 80a41ea | 2016-03-06 14:33:42 +0100 | [diff] [blame] | 346 | |
Jiri Konecny | 0456cfa | 2016-04-20 16:47:25 +0200 | [diff] [blame] | 347 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 348 | External links |
| 349 | ============== |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 350 | |
| 351 | * http://ceph.com/docs/master/rbd/rbd-openstack/ |
| 352 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 353 | |
Jakub Pavlik | 9e85d17 | 2016-05-20 11:13:14 +0200 | [diff] [blame] | 354 | Documentation and Bugs |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 355 | ====================== |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 356 | |
Jakub Pavlik | 9e85d17 | 2016-05-20 11:13:14 +0200 | [diff] [blame] | 357 | To learn how to deploy OpenStack Salt, consult the documentation available |
| 358 | online at: |
| 359 | |
| 360 | https://wiki.openstack.org/wiki/OpenStackSalt |
| 361 | |
| 362 | In the unfortunate event that bugs are discovered, they should be reported to |
| 363 | the appropriate bug tracker. If you obtained the software from a 3rd party |
| 364 | operating system vendor, it is often wise to use their own bug tracker for |
| 365 | reporting problems. In all other cases use the master OpenStack bug tracker, |
| 366 | available at: |
| 367 | |
| 368 | http://bugs.launchpad.net/openstack-salt |
| 369 | |
| 370 | Developers wishing to work on the OpenStack Salt project should always base |
| 371 | their work on the latest formulas code, available from the master GIT |
| 372 | repository at: |
| 373 | |
| 374 | https://git.openstack.org/cgit/openstack/salt-formula-glance |
| 375 | |
| 376 | Developers should also join the discussion on the IRC list, at: |
| 377 | |
| 378 | https://wiki.openstack.org/wiki/Meetings/openstack-salt |
Filip Pytloun | e94a0a7 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 379 | |
| 380 | Documentation and Bugs |
| 381 | ====================== |
| 382 | |
| 383 | To learn how to install and update salt-formulas, consult the documentation |
| 384 | available online at: |
| 385 | |
| 386 | http://salt-formulas.readthedocs.io/ |
| 387 | |
| 388 | In the unfortunate event that bugs are discovered, they should be reported to |
| 389 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 390 | formula: |
| 391 | |
| 392 | https://github.com/salt-formulas/salt-formula-glance/issues |
| 393 | |
| 394 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 395 | use Launchpad salt-formulas project: |
| 396 | |
| 397 | https://launchpad.net/salt-formulas |
| 398 | |
| 399 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 400 | |
| 401 | https://launchpad.net/~salt-formulas-users |
| 402 | |
| 403 | Developers wishing to work on the salt-formulas projects should always base |
| 404 | their work on master branch and submit pull request against specific formula. |
| 405 | |
| 406 | https://github.com/salt-formulas/salt-formula-glance |
| 407 | |
| 408 | Any questions or feedback is always welcome so feel free to join our IRC |
| 409 | channel: |
| 410 | |
| 411 | #salt-formulas @ irc.freenode.net |