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 |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 20 | 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 Michalec | 86ec014 | 2016-11-29 16:34:15 +0100 | [diff] [blame] | 53 | audit: |
| 54 | enabled: false |
Simon Pasquier | 2acbef5 | 2017-02-03 15:09:39 +0100 | [diff] [blame] | 55 | api_limit_max: 100 |
| 56 | limit_param_default: 50 |
| 57 | |
| 58 | The pagination is controlled by the *api_limit_max* and *limit_param_default* |
| 59 | parameters 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 Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 66 | |
Dmitry Ukov | 0a228ad | 2017-05-15 13:35:43 +0400 | [diff] [blame] | 67 | Configuration 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árek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 78 | Keystone 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 | |
| 93 | Ceph 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 | |
| 108 | RabbitMQ 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 | |
mnederlof | ad6d624 | 2017-03-30 15:31:15 +0200 | [diff] [blame] | 126 | Enable 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árek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 139 | Enable 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 | |
RobertJansen1 | 68e84f9 | 2017-03-30 15:45:12 +0200 | [diff] [blame] | 152 | Swift 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 Nederlof | 3a86781 | 2017-05-15 09:46:11 +0200 | [diff] [blame] | 174 | Another 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 Smola | e695fe8 | 2017-04-28 12:22:28 +0200 | [diff] [blame] | 198 | Enable 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árek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 211 | |
Michel Nederlof | 3ad5aac | 2017-05-15 09:46:24 +0200 | [diff] [blame] | 212 | Enable Viewing Multiple Locations |
| 213 | --------------------------------- |
| 214 | If you want to expose all locations available (for example when you have |
| 215 | multiple 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 | |
| 225 | Please 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 | |
| 228 | This feature is convenient in a scenario when you have swift and rbd configured and want to |
| 229 | benefit from rbd enhancements. |
| 230 | |
| 231 | |
Richard Felkl | 4143a0e | 2017-02-01 23:24:13 +0100 | [diff] [blame] | 232 | Client role |
| 233 | ----------- |
| 234 | |
| 235 | Glance 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 Konecny | 0456cfa | 2016-04-20 16:47:25 +0200 | [diff] [blame] | 249 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 250 | |
| 251 | Usage |
| 252 | ===== |
| 253 | |
| 254 | Import new public image |
Jiri Konecny | 0456cfa | 2016-04-20 16:47:25 +0200 | [diff] [blame] | 255 | |
| 256 | .. code-block:: yaml |
| 257 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 258 | 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] | 259 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 260 | Change new image's disk properties |
Petr Michalec | 86ec014 | 2016-11-29 16:34:15 +0100 | [diff] [blame] | 261 | |
| 262 | .. code-block:: yaml |
| 263 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 264 | glance image-update "Windows 7 x86_64" --property hw_disk_bus=ide |
Petr Michalec | 86ec014 | 2016-11-29 16:34:15 +0100 | [diff] [blame] | 265 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 266 | Change new image's NIC properties |
Jakub Pavlik | 80a41ea | 2016-03-06 14:33:42 +0100 | [diff] [blame] | 267 | |
| 268 | .. code-block:: yaml |
| 269 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 270 | glance image-update "Windows 7 x86_64" --property hw_vif_model=rtl8139 |
Jakub Pavlik | 80a41ea | 2016-03-06 14:33:42 +0100 | [diff] [blame] | 271 | |
Jiri Konecny | 0456cfa | 2016-04-20 16:47:25 +0200 | [diff] [blame] | 272 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 273 | External links |
| 274 | ============== |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 275 | |
| 276 | * http://ceph.com/docs/master/rbd/rbd-openstack/ |
| 277 | |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 278 | |
Jakub Pavlik | 9e85d17 | 2016-05-20 11:13:14 +0200 | [diff] [blame] | 279 | Documentation and Bugs |
Aleš Komárek | e5b388f | 2017-02-06 15:48:57 +0100 | [diff] [blame] | 280 | ====================== |
Filip Pytloun | d681ae2 | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 281 | |
Jakub Pavlik | 9e85d17 | 2016-05-20 11:13:14 +0200 | [diff] [blame] | 282 | To learn how to deploy OpenStack Salt, consult the documentation available |
| 283 | online at: |
| 284 | |
| 285 | https://wiki.openstack.org/wiki/OpenStackSalt |
| 286 | |
| 287 | In the unfortunate event that bugs are discovered, they should be reported to |
| 288 | the appropriate bug tracker. If you obtained the software from a 3rd party |
| 289 | operating system vendor, it is often wise to use their own bug tracker for |
| 290 | reporting problems. In all other cases use the master OpenStack bug tracker, |
| 291 | available at: |
| 292 | |
| 293 | http://bugs.launchpad.net/openstack-salt |
| 294 | |
| 295 | Developers wishing to work on the OpenStack Salt project should always base |
| 296 | their work on the latest formulas code, available from the master GIT |
| 297 | repository at: |
| 298 | |
| 299 | https://git.openstack.org/cgit/openstack/salt-formula-glance |
| 300 | |
| 301 | Developers should also join the discussion on the IRC list, at: |
| 302 | |
| 303 | https://wiki.openstack.org/wiki/Meetings/openstack-salt |
Filip Pytloun | e94a0a7 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 304 | |
| 305 | Documentation and Bugs |
| 306 | ====================== |
| 307 | |
| 308 | To learn how to install and update salt-formulas, consult the documentation |
| 309 | available online at: |
| 310 | |
| 311 | http://salt-formulas.readthedocs.io/ |
| 312 | |
| 313 | In the unfortunate event that bugs are discovered, they should be reported to |
| 314 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 315 | formula: |
| 316 | |
| 317 | https://github.com/salt-formulas/salt-formula-glance/issues |
| 318 | |
| 319 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 320 | use Launchpad salt-formulas project: |
| 321 | |
| 322 | https://launchpad.net/salt-formulas |
| 323 | |
| 324 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 325 | |
| 326 | https://launchpad.net/~salt-formulas-users |
| 327 | |
| 328 | Developers wishing to work on the salt-formulas projects should always base |
| 329 | their work on master branch and submit pull request against specific formula. |
| 330 | |
| 331 | https://github.com/salt-formulas/salt-formula-glance |
| 332 | |
| 333 | Any questions or feedback is always welcome so feel free to join our IRC |
| 334 | channel: |
| 335 | |
| 336 | #salt-formulas @ irc.freenode.net |