Today I actually read the documentation in juju-core/doc/simplestreams-metadata.txt and there it explains that the --metadata-source option needs a local directory that's accessible by the nodes. The current help for --metadata-source says:
--metadata-source (= "")
local path to use as tools and/or metadata source
Private clouds may need to specify their own custom image metadata, and possibly upload
Juju tools to cloud storage if no outgoing Internet access is available. In this case,
use the --metadata-source paramater to tell bootstrap a local directory from which to
upload tools and/or image metadata.
So I just assume that juju would make some kind of magic to make the local directory file accessible to the bootstrapped node. So at a minimum this bug is about improve that documentation, but this is not the extra info I want to add.
Following the instruction in simplestreams-metadata.txt, I set up a local webserver to serve the metadata files to juju.
Created the metadata directory under /var/www/juju-metadata
Copied the 1.17.1-precise-amd64.tgz tarball from http://juju-dist.s3.amazonaws.com
Generated the metadata using metadata generate-tools option
Notice how the sha256 differ but I continued anyway.
Changed the permission of the generated index.json and com.ubuntu.juju:released:tools.json so they will be accessible through the webserver
$ sudo chmod 644 juju-metadata/tools/streams/v1/*
I got more info about this bug:
Today I actually read the documentation in juju-core/ doc/simplestrea ms-metadata. txt and there it explains that the --metadata-source option needs a local directory that's accessible by the nodes. The current help for --metadata-source says:
--metadata-source (= "")
local path to use as tools and/or metadata source
Private clouds may need to specify their own custom image metadata, and possibly upload
Juju tools to cloud storage if no outgoing Internet access is available. In this case,
use the --metadata-source paramater to tell bootstrap a local directory from which to
upload tools and/or image metadata.
So I just assume that juju would make some kind of magic to make the local directory file accessible to the bootstrapped node. So at a minimum this bug is about improve that documentation, but this is not the extra info I want to add. metadata. txt, I set up a local webserver to serve the metadata files to juju.
Following the instruction in simplestreams-
Created the metadata directory under /var/www/ juju-metadata precise- amd64.tgz tarball from http:// juju-dist. s3.amazonaws. com
Copied the 1.17.1-
Generated the metadata using metadata generate-tools option
$ wget -c http:// juju-dist. s3.amazonaws. com/testing/ tools/releases/ juju-1. 17.1-precise- amd64.tgz juju-1. 17.1-precise- amd64.tgz d1e5f9fa356825c 91ce9bbfce92b41 42e44827f32d828 9753 tools/releases/ juju-1. 17.1-precise- amd64.tgz juju-metadata tools/streams/ v1/com. ubuntu. juju\:released\ :tools. json
"com.ubuntu. juju:12. 04:amd64" : {
"version" : "1.17.1",
"versions" : {
"20142301" : {
" items": {
"1.17. 1-precise- amd64": {
"release" : "precise",
"version" : "1.17.1",
"arch": "amd64",
"size": 19,
"path": "releases/ juju-1. 17.1-precise- amd64.tgz" ,
"ftype" : "tar.gz",
"sha256" : "b16e15764b8bc0 6c5c3f9f19bc8b9 9fa48e7894aa5a6 ccdad65da49bbf5 64793"
}
}
$ sha256sum tools/releases/
3c3c04ec40c2f52
I used sudo so juju would have permission to write to /var/www/
$ sudo juju --debug metadata generate-tools -d juju-metadata
$ juju --version
1.16.5-trusty-amd64
$ sudo cat juju-metadata/
{
"products": {
"arch": "amd64",
}
}
}
},
"updated": "Thu, 23 Jan 2014 13:01:51 -0500",
"format": "products:1.0"
Notice how the sha256 differ but I continued anyway. juju:released: tools.json so they will be accessible through the webserver tools/streams/ v1/*
Changed the permission of the generated index.json and com.ubuntu.
$ sudo chmod 644 juju-metadata/
I logged into the Trusty VM where I tried to bootstrap MAAS: 10.98.3. 20/juju- metadata/ tools
# juju bootstrap --debug --metadata-source=http://
and got this failure in the node's /var/log/ cloud-init- output. log 10.98.3. 20/juju- metadata/ tools/releases/ juju-1. 17.1-precise- amd64.tgz'\''' lib/juju/ tools/1. 17.1-precise- amd64 juju/tools/ 1.17.1- precise- amd64 juju/tools/ 1.17.1- precise- amd64/tools. tar.gz http:// 10.98.3. 20/juju- metadata/ tools/releases/ juju-1. 17.1-precise- amd64.tgz 10.98.3. 20/juju- metadata/ tools/releases/ juju-1. 17.1-precise- amd64.tgz [5209799/5209799] -> "/var/lib/ juju/tools/ 1.17.1- precise- amd64/tools. tar.gz" [1] juju/tools/ 1.17.1- precise- amd64/tools. tar.gz c5c3f9f19bc8b99 fa48e7894aa5a6c cdad65da49bbf56 4793 /var/lib/ juju/tools/ 1.17.1- precise- amd64/juju1. 17.1-precise- amd64.sha256
...
Adding new user `mongodb' (UID 107) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb' (GID 114) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
mongodb stop/waiting
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
+ mkdir -p /var/lib/juju
+ mkdir -p /var/log/juju
+ echo 'Fetching tools: wget --no-verbose -O $bin/tools.tar.gz '\''http://
+ bin=/var/
+ mkdir -p /var/lib/
+ wget --no-verbose -O /var/lib/
2014-01-23 16:48:18 URL:http://
+ sha256sum /var/lib/
+ grep b16e15764b8bc06
+ echo 'Tools checksum mismatch'
Tools checksum mismatch
+ exit 1
Broadcast message from root@6bgr7
(unknown) at 16:48 ...
The system is going down for halt NOW!
Power button pressed
So, I don't know exactly what I did wrong, but the generated metadata has a different sha256 checksum than the one from the file I downloaded from s3.