juju/juju-gui — pull request #194 by frankban (2014-03-24 14:01:04+00:00)
Title: Update machine model.

Include new info from the mega-watcher for machines.

QA:
- Bootstrap an ec2 environment with juju-core trunk (at least revno 2463):
`juju bootstrap -e ec2 --upload-tools`.
- Deploy and expose the GUI:
`juju deploy -e ec2 juju-gui && juju expose -e ec2 juju-gui`.
- Switch to this branch:
`juju set -e ec2 juju-gui juju-gui-source="https://github.com/frankban/juju-gui.git machine-model-changes"`.
- Wait for the unit to be ready, log in and open the JS console.
- Check that two machines are present in the db:
`app.db.machines.size();` --> 2.
- Inspect the GUI machine:
`app.db.machines.getById('1');`.
- Check the returned fields, i.e. check that the machines properly includes:
- four addresses (name is empty for now);
- hardware characteristics (arch, cpuCores etc. in the hardware property);
- jobs ('JobHostUnits');
- life ('alive');
- series ('precise');
- supportedContainers ('lxc').
- Check that the bootstrap node also manages environments:
`app.db.machines.getById('0').jobs;`
- Now create a new machine:
`juju add-machine -e ec2 --series saucy`.
- And we have three machines:
`app.db.machines.size();`.
- Check the new machine attributes multiple times:
`app.db.machines.getById('2');`.
- You should see that supportedContainers is initially null, and then it will
switch to ['lxc']. Also, series is 'saucy'.
- Let's add a container to machine 2:
`juju add-machine -e ec2 lxc:2`.
- Retrieve information on the new container:
`app.db.machines.getById('2/lxc/0');`
- You should see that initially hardware is an empty object and also
supportedContainers is null.
- Wait until the container is fully provisioned (this can take a while):
supportedContainers is an empty list and hardware include the architecture.
- Note that containers' addresses are not present because they are not
returned by the cloud provider. The juju db also stores addresses returned
by the machine itself. A change to juju-core is required if we find out
we need to know LXC addresses.
- Done, destroy the environment, thank you!