simplestreams path
Scott Moser
smoser at ubuntu.com
Thu Aug 1 14:33:59 UTC 2013
On Thu, 1 Aug 2013, Andreas Hasenack wrote:
> I'm on a quest to have juju use a custom image when launching instances, as
> opposed to the one specified in the product-streams keystone catalog.
>
> I ran the juju-metadata generate-image command, and this is the output:
>
> andreas at nsn7:~$ juju-metadata generate-image -i
> 65a1e7ba-eb56-48e6-9b4e-8f7c0c05e779 -s precise -r serverstack
> Boilerplate image metadata files "index.json, imagemetadata.json" have been
> written to /home/andreas/.juju.
> Copy the files to the path "streams/v1" in your cloud's public bucket.
>
> What is my cloud public bucket? Is it the public-bucket-url from
> environments.yaml? Because that doesn't specify a bucket, it stops short of
> specifying one:
>
> public-bucket-url: http://host.com:8080/v1/AUTH_someid
>
> Is "streams" in "streams/v1" above the bucket? Or is it the magical name
> "juju-dist", and inside that "streams/v1" and then the files?
I can't speak to what is implemented, but what I had thought we were going
for was something like this:
* There are 2 "data locations" that juju needs to know about
- cloud_image_data_path
- juju_tools_path
* For each of these there is:
- global default
- provider-default
- user default
- user-specified value
So, for openstack path the selection of each of cloud_image_data_path and
juju_tools_path would look something like this:
datapaths = {}
for pathname in ('juju_tools_path', 'cloud_image_data_path'):
if pathname in user_config.get(path):
# perhaps the user explicitly says:
# juju_tools_path: http://mytools.example.com/juju
datapaths[path] = user_config.get(path)
continue
# the openstack provider fills this with:
# http://SWIFT_URL/AUTH_ABCDEFG/product-streams
# where there is a streams/v1/ under that path.
userp = provider.get_user_specific_path(pathname)
if userp and has_necessary_data(userp, pathname):
datapaths[path] = userp
continue
# the openstack provider fills this with
# whatever it finds in keystone under the 'product-streams'
# entry. That may not exist (the admin didn't populate)
# or maybe on EC2, there no place for such things
# openstack provider might have
# https://swift.mycloud.com/v1/AUTH_a48765cced4/simplestreams/data/
# (again, under there is streams/v1/index.json)
provp = provider.get_path(pathname)
if provp and has_necessary_data(provp, pathname):
datapaths[path] = provp
continue
# The global path probably ends up being
# http://cloud-images.ubuntu.com/releases
globalp = get_global_path(pathname)
if globalp and has_necessary_data(globalp, pathname)
datapaths[path] = globalp
continue
'has_necessary_paths' basically has to load the stream and verify that
that stream location has the specific data. Ie, its possible that the
admin has not uploaded juju data to the product-streams, but has uploaded
cloud-images data.
I think the above path basically fills Andres need and allows for "magic"
to happen, and allows him to put local cloud image data into a bucket and
use vendor-provided juju data (or vice versa).
Basically, there are those 2 variables, they just happen to be the same
sometimes.
Scott
More information about the Juju
mailing list