23
23
1. User supplied location (specified by tools-metadata-url or image-metadata-url config settings)
24
24
2. The environment's cloud storage
25
25
3. Provider specific locations (eg keystone endpoint if on Openstack)
26
4. A web location with metadata for supported public clouds (https://streams.canonical.com)
26
4. A web location with metadata for supported public clouds (https://streams.canonical.com/juju)
28
28
Metadata may be inline signed, or unsigned. We indicate a metadata file is signed by using
29
29
a '.sjson' extension. Each location in the path is first searched for signed metadata, and
30
30
if none is found, unsigned metadata is attempted before moving onto the next path location.
32
32
Juju ships with public keys used to validate the integrity of image and tools metadata obtained
33
from https://streams.canonical.com. So out of the box, Juju will "Just Work" with any supported
33
from https://streams.canonical.com/juju. So out of the box, Juju will "Just Work" with any supported
34
34
public cloud, using signed metadata. Setting up metadata for a private (eg Openstack) cloud requires
35
35
metadata to be generated using tools which ship with Juju (more below).
148
148
juju-tools : the <path_url> value as described above in Tools Metadata Contents
149
149
product-streams : the <path_url> value as described above in Image Metadata Contents
151
4. Central web location (https://streams.canonical.com)
151
4. Central web location (https://streams.canonical.com/juju)
153
153
This is the default location used to search for image and tools metadata and is used if no matches
154
154
are found earlier in any of the above locations. No user configuration is required.
164
164
Issue 2 means that tools need to be mirrored locally to make them accessible.
166
166
Juju tools exist to help with generating and validating image and tools metadata.
167
For tools, it is often easiest to just mirror https://streams.canonical.com/tools.
167
For tools, it is often easiest to just mirror https://streams.canonical.com/juju/tools.
168
168
However image metadata cannot be simply mirrored because the image ids are taken
169
169
from the cloud storage provider, so this need to be generated and validated using
170
170
the commands described below.
172
172
The available Juju metadata tools can be seen by using the help command:
173
173
juju help metadata
175
The overall workflow is:
176
- generate image metadata
177
- copy image metadata to somewhere in the metadata search path
175
A summary of the overall workflow is (more detail next):
176
- create a local directory in which to store image and tools metadata
177
- generate image metadata to local directory
178
- optionally download tools to local directory/tools
180
- juju bootstrap --metadata-source <local_directory>
182
- optionally, copy image metadata to somewhere in the metadata search path
178
183
- optionally, mirror tools to somewhere in the metadata search path
179
184
- optionally, configure tools-metadata-url and/or image-metadata-url
186
If the bootstrap --metadata-source directory option is used, any image metadata and tools found
187
in the specified directory will be uploaded automatically to the cloud storage for that deployment.
188
This is useful for situations where image and tools metadata do not need to be shared amongst several
189
users, since each Juju environment will upload its own separate copy of the required files.
191
Using the image-metadata-url and tools-metadata-url to point to publicly accessible locations is useful
192
when several Juju environments are to be deployed on a private cloud and the metadata should be shared.
181
194
1. Image metadata
183
196
Generate image metadata using
190
203
The image metadata command can be run multiple times with different regions, series, architecture, and
191
204
it will keep adding to the metadata files. Once all required image ids have been added, the index and product
192
json files can be uploaded to a location in the Juju metadata search path. As per the Configuration section,
193
this may be somewhere specified by the image-metadata-url setting or the cloud's storage etc.
205
json files are ready to use. These can be uploaded to a location in the Juju metadata search path or the bootstrap
206
--metadata-source option may be used.
196
209
1. image-metadata-url
197
210
- upload contents of <metadata_dir> to http://somelocation
198
211
- set image-metadata-url to http://somelocation/images
200
- upload contents of <metadata_dir> directly to environment's cloud storage
213
- juju bootstrap --metadata-source <metadata_dir>
202
215
To ensure that the image metadata has been generated and uploaded correctly, use the validation command to
203
216
ensure an image id can be discovered for a given scenario (region series, arch):
211
224
2. Tools metadata
213
Generally, tools and related metadata is mirrored from https://streams.canonical.com/tools. However,
226
Generally, tools and related metadata is mirrored from https://streams.canonical.com/juju/tools. However,
214
227
it is possible to manually generate metadata for a custom built tools tarball using:
215
juju generate-tools -d <tools_dir>
228
juju generate-tools -d <metadata_dir>
217
where the required tools tarballs are first placed in a directory <tools_dir>/tools/releases.
218
Then, the contents of <tools_dir> can be uploaded to a location in the Juju metadata search path.
219
As per the Configuration section, this may be somewhere specified by the tools-metadata-url setting or
220
the cloud's storage etc.
230
where the required tools tarballs are first placed in a directory <metadata_dir>/tools/releases.
231
Then, the contents of <metadata_dir> can be uploaded to a location in the Juju metadata search path or the
232
bootstrap --metadata-source option may be used.
223
235
1. tools-metadata-url
224
- upload contents of <tools_dir> to http://somelocation
236
- upload contents of <metadata_dir> to http://somelocation
225
237
- set tools-metadata-url to http://somelocation/tools
227
- upload contents of <tools_dir> directly to environment's cloud storage
239
- juju bootstrap --metadata-source <tools_dir>
241
Note that image and tools metadata are generally written into the same local directory and the bootstrap
242
--metadata-source option will upload both types of metadata.
229
244
As with image metadata, the validation command is used to ensure tools are available for Juju to use:
230
245
juju metadata validate-tools