Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(85)

Delta Between Two Patch Sets: doc/simplestreams-metadata.txt

Issue 68990043: System SSH key upgrader (Closed)
Left Patch Set: Created 11 years, 1 month ago
Right Patch Set: System SSH key upgrader Created 11 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « cmd/jujud/upgrade_test.go ('k') | environs/bootstrap/state.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 Introduction 1 Introduction
2 ============ 2 ============
3 3
4 When Juju bootstraps, it needs two critical pieces of information: 4 When Juju bootstraps, it needs two critical pieces of information:
5 1. The uuid of the image to use when starting new compute instances 5 1. The uuid of the image to use when starting new compute instances
6 2. The URL from which to download the correct version of a tools tarball 6 2. The URL from which to download the correct version of a tools tarball
7 7
8 The necessary information is stored in a json metadata format called simplestrea ms. 8 The necessary information is stored in a json metadata format called simplestrea ms.
9 The simplestreams format is used to describe related items in a structural fashi on. 9 The simplestreams format is used to describe related items in a structural fashi on.
10 See the Launchpad project lp:simplestreams for more details. 10 See the Launchpad project lp:simplestreams for more details.
11 11
12 For supported public clouds like Amazon, HP Cloud etc, no action is required by the 12 For supported public clouds like Amazon, HP Cloud etc, no action is required by the
13 end user so the following information is more for those interested in what happe ns 13 end user so the following information is more for those interested in what happe ns
14 under the covers. Those setting up a private cloud, or who want to change how th ings 14 under the covers. Those setting up a private cloud, or who want to change how th ings
15 work (eg use a different Ubuntu image), need to pay closer attention. 15 work (eg use a different Ubuntu image), need to pay closer attention.
16 16
17 Basic Workflow 17 Basic Workflow
18 ============== 18 ==============
19 19
20 Whether images or tools, Juju uses a search path to try and find suitable metada ta. 20 Whether images or tools, Juju uses a search path to try and find suitable metada ta.
21 The path components (in order of lookup) are: 21 The path components (in order of lookup) are:
22 22
23 1. User supplied location (specified by tools-metadata-url or image-metadata-url config settings) 23 1. User supplied location (specified by tools-metadata-url or image-metadata-url config settings)
24 2. The environment's cloud storage 24 2. The environment's cloud storage
25 3. Provider specific locations (eg keystone endpoint if on Openstack) 25 3. Provider specific locations (eg keystone endpoint if on Openstack)
26 4. A web location with metadata for supported public clouds (https://streams.can onical.com) 26 4. A web location with metadata for supported public clouds (https://streams.can onical.com/juju)
27 27
28 Metadata may be inline signed, or unsigned. We indicate a metadata file is signe d by using 28 Metadata may be inline signed, or unsigned. We indicate a metadata file is signe d by using
29 a '.sjson' extension. Each location in the path is first searched for signed met adata, and 29 a '.sjson' extension. Each location in the path is first searched for signed met adata, and
30 if none is found, unsigned metadata is attempted before moving onto the next pat h location. 30 if none is found, unsigned metadata is attempted before moving onto the next pat h location.
31 31
32 Juju ships with public keys used to validate the integrity of image and tools me tadata obtained 32 Juju ships with public keys used to validate the integrity of image and tools me tadata obtained
33 from https://streams.canonical.com. So out of the box, Juju will "Just Work" wit h any supported 33 from https://streams.canonical.com/juju. So out of the box, Juju will "Just Work " with any supported
34 public cloud, using signed metadata. Setting up metadata for a private (eg Opens tack) cloud requires 34 public cloud, using signed metadata. Setting up metadata for a private (eg Opens tack) cloud requires
35 metadata to be generated using tools which ship with Juju (more below). 35 metadata to be generated using tools which ship with Juju (more below).
36 36
37 Image Metadata Contents 37 Image Metadata Contents
38 ======================= 38 =======================
39 39
40 Image metadata uses a simplestreams content type of "image-ids". 40 Image metadata uses a simplestreams content type of "image-ids".
41 The product id is formed as follows: 41 The product id is formed as follows:
42 "com.ubuntu.cloud:server:<series_version>:<arch>" 42 "com.ubuntu.cloud:server:<series_version>:<arch>"
43 eg 43 eg
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 are placed according to the above structure. That's why the tools are then avail able for Juju to use. 141 are placed according to the above structure. That's why the tools are then avail able for Juju to use.
142 142
143 3. Provider specific storage 143 3. Provider specific storage
144 144
145 Providers may allow additional locations to search for metadata and tools. For O penstack, keystone 145 Providers may allow additional locations to search for metadata and tools. For O penstack, keystone
146 endpoints may be created by the cloud administrator. These are defined as follow s: 146 endpoints may be created by the cloud administrator. These are defined as follow s:
147 147
148 juju-tools : the <path_url> value as described above in Tools Metadata Cont ents 148 juju-tools : the <path_url> value as described above in Tools Metadata Cont ents
149 product-streams : the <path_url> value as described above in Image Metadata Cont ents 149 product-streams : the <path_url> value as described above in Image Metadata Cont ents
150 150
151 4. Central web location (https://streams.canonical.com) 151 4. Central web location (https://streams.canonical.com/juju)
152 152
153 This is the default location used to search for image and tools metadata and is used if no matches 153 This is the default location used to search for image and tools metadata and is used if no matches
154 are found earlier in any of the above locations. No user configuration is requir ed. 154 are found earlier in any of the above locations. No user configuration is requir ed.
155 155
156 Deploying Private Clouds 156 Deploying Private Clouds
157 ======================== 157 ========================
158 158
159 There are two main issues when deploying a private cloud: 159 There are two main issues when deploying a private cloud:
160 1. Images ids will be specific to the cloud 160 1. Images ids will be specific to the cloud
161 2. Often, outside internet access is blocked 161 2. Often, outside internet access is blocked
162 162
163 Issue 1 means that image id metadata needs to be generated and made available. 163 Issue 1 means that image id metadata needs to be generated and made available.
164 Issue 2 means that tools need to be mirrored locally to make them accessible. 164 Issue 2 means that tools need to be mirrored locally to make them accessible.
165 165
166 Juju tools exist to help with generating and validating image and tools metadata . 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/tool s. 167 For tools, it is often easiest to just mirror https://streams.canonical.com/juju /tools.
168 However image metadata cannot be simply mirrored because the image ids are taken 168 However image metadata cannot be simply mirrored because the image ids are taken
169 from the cloud storage provider, so this need to be generated and validated usin g 169 from the cloud storage provider, so this need to be generated and validated usin g
170 the commands described below. 170 the commands described below.
171 171
172 The available Juju metadata tools can be seen by using the help command: 172 The available Juju metadata tools can be seen by using the help command:
173 juju help metadata 173 juju help metadata
174 174
175 The overall workflow is: 175 A summary of the overall workflow is (more detail next):
176 - generate image metadata 176 - create a local directory in which to store image and tools metadata
177 - copy image metadata to somewhere in the metadata search path 177 - generate image metadata to local directory
178 - optionally download tools to local directory/tools
179 Then either
180 - juju bootstrap --metadata-source <local_directory>
181 or
182 - optionally, copy image metadata to somewhere in the metadata search path
178 - optionally, mirror tools to somewhere in the metadata search path 183 - optionally, mirror tools to somewhere in the metadata search path
179 - optionally, configure tools-metadata-url and/or image-metadata-url 184 - optionally, configure tools-metadata-url and/or image-metadata-url
185
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 f or that deployment.
188 This is useful for situations where image and tools metadata do not need to be s hared amongst several
189 users, since each Juju environment will upload its own separate copy of the requ ired files.
190
191 Using the image-metadata-url and tools-metadata-url to point to publicly accessi ble locations is useful
192 when several Juju environments are to be deployed on a private cloud and the met adata should be shared.
180 193
181 1. Image metadata 194 1. Image metadata
182 195
183 Generate image metadata using 196 Generate image metadata using
184 juju metadata generate-image -d <metadata_dir> 197 juju metadata generate-image -d <metadata_dir>
185 198
186 As a minimum, the above command needs to know the image id to use and a director y in which to write the files. 199 As a minimum, the above command needs to know the image id to use and a director y in which to write the files.
187 Other required parameters like region, series, architecture etc are taken from t he current Juju environment (or 200 Other required parameters like region, series, architecture etc are taken from t he current Juju environment (or
188 an environment specified with the -e option). These parameters can also be overr idden on the command line. 201 an environment specified with the -e option). These parameters can also be overr idden on the command line.
189 202
190 The image metadata command can be run multiple times with different regions, ser ies, architecture, and 203 The image metadata command can be run multiple times with different regions, ser ies, architecture, and
191 it will keep adding to the metadata files. Once all required image ids have been added, the index and product 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 pe r the Configuration section, 205 json files are ready to use. These can be uploaded to a location in the Juju met adata search path or the bootstrap
193 this may be somewhere specified by the image-metadata-url setting or the cloud's storage etc. 206 --metadata-source option may be used.
194 207
195 Examples: 208 Examples:
196 1. image-metadata-url 209 1. image-metadata-url
197 - upload contents of <metadata_dir> to http://somelocation 210 - upload contents of <metadata_dir> to http://somelocation
198 - set image-metadata-url to http://somelocation/images 211 - set image-metadata-url to http://somelocation/images
199 2. Cloud storage 212 2. bootstrap option
200 - upload contents of <metadata_dir> directly to environment's cloud storage 213 - juju bootstrap --metadata-source <metadata_dir>
201 214
202 To ensure that the image metadata has been generated and uploaded correctly, use the validation command to 215 To ensure that the image metadata has been generated and uploaded correctly, use the validation command to
203 ensure an image id can be discovered for a given scenario (region series, arch): 216 ensure an image id can be discovered for a given scenario (region series, arch):
204 juju metadata validate-images 217 juju metadata validate-images
205 218
206 If run without parameters, the validation command will take all required details from the current Juju 219 If run without parameters, the validation command will take all required details from the current Juju
207 environment (or as specified by -e) and print the image id it would use to spin up an instance. 220 environment (or as specified by -e) and print the image id it would use to spin up an instance.
208 Alternatively, series, region, architecture etc can be specified on the command line to override values 221 Alternatively, series, region, architecture etc can be specified on the command line to override values
209 in the environment config. 222 in the environment config.
210 223
211 2. Tools metadata 224 2. Tools metadata
212 225
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 it is possible to manually generate metadata for a custom built tools tarball us ing: 227 it is possible to manually generate metadata for a custom built tools tarball us ing:
215 juju generate-tools -d <tools_dir> 228 juju generate-tools -d <metadata_dir>
216 229
217 where the required tools tarballs are first placed in a directory <tools_dir>/to ols/releases. 230 where the required tools tarballs are first placed in a directory <metadata_dir> /tools/releases.
218 Then, the contents of <tools_dir> can be uploaded to a location in the Juju meta data search path. 231 Then, the contents of <metadata_dir> can be uploaded to a location in the Juju m etadata search path or the
219 As per the Configuration section, this may be somewhere specified by the tools-m etadata-url setting or 232 bootstrap --metadata-source option may be used.
220 the cloud's storage etc.
221 233
222 Examples: 234 Examples:
223 1. tools-metadata-url 235 1. tools-metadata-url
224 - upload contents of <tools_dir> to http://somelocation 236 - upload contents of <metadata_dir> to http://somelocation
225 - set tools-metadata-url to http://somelocation/tools 237 - set tools-metadata-url to http://somelocation/tools
226 2. Cloud storage 238 2. bootstrap option
227 - upload contents of <tools_dir> directly to environment's cloud storage 239 - juju bootstrap --metadata-source <tools_dir>
240
241 Note that image and tools metadata are generally written into the same local dir ectory and the bootstrap
242 --metadata-source option will upload both types of metadata.
228 243
229 As with image metadata, the validation command is used to ensure tools are avail able for Juju to use: 244 As with image metadata, the validation command is used to ensure tools are avail able for Juju to use:
230 juju metadata validate-tools 245 juju metadata validate-tools
231 246
232 The same comments apply. Run the validation tool without parameters to use detai ls from the Juju 247 The same comments apply. Run the validation tool without parameters to use detai ls from the Juju
233 environment, or override values as required on the command line. See juju help m etadata validate-tools 248 environment, or override values as required on the command line. See juju help m etadata validate-tools
234 for more details. 249 for more details.
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b