Skip to content

Commit 2d1b460

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Add documentation for glance-download plugin"
2 parents c342c0e + f09c338 commit 2d1b460

File tree

3 files changed

+88
-6
lines changed

3 files changed

+88
-6
lines changed

api-ref/source/v2/images-import.inc

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ the import methods available in the cloud in which you want to import
1818
an image. Each of these methods is well defined (which is what makes
1919
this process interoperable among different OpenStack clouds).
2020

21-
Three import methods are defined:
21+
Four import methods are defined:
2222

2323
* ``glance-direct``
2424
* ``web-download``
2525
* ``copy-image``
26+
* ``glance-download``
2627

2728
.. note::
2829

@@ -92,6 +93,17 @@ The ``copy-image`` workflow has **two** parts:
9293
the import process. You will specify that you are using the
9394
``copy-image`` import method in the body of the import call.
9495

96+
The glance-download import method
97+
---------------------------------
98+
99+
The ``glance-download`` workflow has **two** parts:
100+
101+
1. Create an image record as described above.
102+
103+
2. Issue the :ref:`Image Import <image-import-call>` call to complete
104+
the import process. You will specify that you are using the
105+
``glance-download`` import method in the body of the import call.
106+
95107
.. _image-stage-call:
96108

97109
Stage binary image data
@@ -183,6 +195,10 @@ service by being posted to an accessible location with a URL that you know.
183195
In the ``copy-image`` workflow, the data is made available to the Image
184196
service by copying existing image data to the staging area.
185197

198+
In the ``glance-download`` workflow, the data is made available to the Image
199+
service by fetching an image accessible from another glance service specified
200+
by a region name and an image id that you know.
201+
186202
Beginning with API version 2.8, an optional ``stores`` parameter may be added
187203
to the body request. When present, it contains the list of backing store
188204
identifiers to import the image binary data to. If at least one store
@@ -289,11 +305,22 @@ If you are using the ``copy-image`` import method:
289305
permission to copy unowned images. Consult your cloud's local
290306
documentation for details.
291307

308+
If you are using the ``glance-download`` import method:
309+
310+
- The image status must be ``queued``. (This indicates that no image data
311+
has yet been associated with the image.)
312+
313+
- The body of your request must indicate that you are using the
314+
``glance-download`` import method, and it must contain the region name of the
315+
remote openstack region and the image id to fetch.
316+
You might optionaly set the service interface name (public by default) to
317+
request.
318+
292319
**Synchronous Postconditions**
293320

294321
- With correct permissions, you can see the image status as
295-
``importing`` (only for glance-direct and web-download import methods)
296-
through API calls. (Be aware, however, that if the import
322+
``importing`` (only for glance-direct, web-download and glance-download
323+
import methods) through API calls. (Be aware, however, that if the import
297324
process completes before you make the API call, the image may already
298325
show as ``active``.)
299326

@@ -335,3 +362,9 @@ Request Example - copy-image import method
335362

336363
.. literalinclude:: samples/image-import-c-i-request.json
337364
:language: json
365+
366+
Request Example - glance-download import method
367+
-----------------------------------------------
368+
369+
.. literalinclude:: samples/image-import-gd-request.json
370+
:language: json
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"method": {
3+
"name": "glance-download",
4+
"glance_image_id": "c4705b36-b281-40f6-a01d-bf98883ead8e",
5+
"glance_region": "REGION2",
6+
"glance_service_interface": "public"
7+
}
8+
}

doc/source/admin/interoperable-image-import.rst

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ task-related policies:
7979
Image Import Methods
8080
--------------------
8181

82-
Glance provides three import methods that you can make available to your
83-
users: ``glance-direct``, ``web-download`` and ``copy-image``. By default,
84-
all three methods are enabled.
82+
Glance provides four import methods that you can make available to your
83+
users: ``glance-direct``, ``web-download``, ``glance-download``, and
84+
``copy-image``. By default, all four methods are enabled.
8585

8686
* The ``glance-direct`` import method allows your users to upload image data
8787
directly to Glance.
@@ -95,6 +95,10 @@ all three methods are enabled.
9595
that was available in the Image API v1 but previously absent from v2.
9696
Additionally, the Image API v1 was removed in Glance 17.0.0 (Rocky).
9797

98+
* The ``glance-download`` method allows an end user to import an image from a
99+
remote glance. This import method is used to import an image from another
100+
openstack region which is federated by the same keystone.
101+
98102
* The ``copy-image`` method allows and end user to copy existing image to
99103
other Glance backends available in deployment. This import method is
100104
only used if multiple glance backends are enabled in your deployment.
@@ -261,6 +265,43 @@ be either 80 or 443.)
261265
subdirectory of the Glance source code tree. Make sure that you are looking
262266
in the correct branch for the OpenStack release you are working with.
263267

268+
Configuring the glance-download method
269+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270+
271+
To enable the ``glance-download`` import method, make sure that it is included
272+
in the list of methods in the ``enabled_import_methods`` option, and that all
273+
the options described above are set properly.
274+
275+
Additionally, you have the following configuration available.
276+
277+
Depending your needs on image properties you may configure addional properties
278+
to be copied from the remote image to the local image.
279+
280+
You can do this by configuring options in the
281+
``[glance_download_opts]`` section of the **glance-image-import.conf** file.
282+
283+
``extra_properties`` options is a list of properties that should be copied from
284+
the remote image. The properties listed should be read as properties that
285+
"start with" as it allows you to set a namespace instead of explicitly listing
286+
each property of the namespace.
287+
288+
Default values are :
289+
``['hw_', 'trait:', 'os_distro', 'os_secure_boot', 'os_type']``
290+
291+
If you decide to set this option the default values will be totally ignored
292+
unless you explicitly set them.
293+
294+
.. note::
295+
The ``extra_properties`` option will ignore namespaces reserved by glance,
296+
meaning that all the properties starting with ``os_glance`` won't be set
297+
on the local image.
298+
299+
.. note::
300+
The **glance-image-import.conf** is an optional file. You can find an
301+
example file named glance-image-import.conf.sample in the **etc/**
302+
subdirectory of the Glance source code tree. Make sure that you are looking
303+
in the correct branch for the OpenStack release you are working with.
304+
264305
Configuring the copy-image method
265306
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
266307

0 commit comments

Comments
 (0)