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