[01:56] <Azendale> I've been using Juju with MaaS for testing purposes. I accidentally destroyed the Juju client machine I was running without having run something like "juju destroy-environment" to clean up the machines in MaaS. Is there a way to reset all the machines in maas to no being claimed?
[01:56] <Azendale> I've tried going into the webui and stopping the machine and then deleting it (and then readding it) but when I try to connect a new juju client install to it, it says "ERROR environment is already bootstrapped"
[02:05] <roaksoax> Azendale: run juju destroy-environment
[02:09] <Azendale> Hm, tried that, it gives "ERROR gomaasapi: got error back from server: 409 CONFLICT"
[02:10] <Azendale> mind you, this is not the old juju client with the old .juju folder (which I accidentally got rid of before I should have)
[02:10] <Azendale> (I'm assuming that the juju client store all it's info in the .juju folder)
[02:11] <roaksoax> Azendale: seems like juju doesnt have access to the api
[02:11] <roaksoax> check whether you are using the correct api
[02:12] <roaksoax> or rm -rf ~/.juju/environments/
[02:13] <Azendale> ok, just checked, .juju/environments.yaml has the right API key. Removed the .juju/environments/ folder
[02:14] <Azendale> hm, same 409 CONFLICT error
[02:14] <Azendale> maybe I just rebuild the maas server (this is a testing setup after all)
[02:14] <roaksoax> uhmmm
[02:14] <roaksoax> i have no odea qhat might be wrong
[02:14] <roaksoax> sorry :-(
[02:15] <roaksoax> that ahould have fixed
[02:15] <Azendale> roaksoax: That's fine. Thanks for the help anyway. I appreciate it!
[02:15] <roaksoax> cause i experienced tbat this morning
[02:18] <roaksoax> Azendale: what version of maas are you using?
[02:19] <Azendale> roaksoax: I'm running it on 13.10
[02:19] <roaksoax> uhmm
[02:20] <roaksoax> im out of ideas
[02:20] <bigjools> Azendale: I know
[02:20] <bigjools> use maas-cli to list files and delete the provider file that juju left behind
[02:21] <Azendale> bigjools: ok, I'll give it a try
[02:22] <bigjools> let me know if that was the case
[02:22] <Azendale> bigjools: Ok, I will
[02:26] <bigjools> Azendale: what is the status of all your nodes?
[02:29] <Azendale> When I started having the problem with juju saying that the environment was already bootstrapped, I had 11 ready, and one allocated (by the old juju setup). I stopped that one (since I couldn't run juju destroy to get rid of it) and still had trouble
[02:29] <Azendale> so I deleted all the nodes and let them run through the discovery and then commissioning again
[02:29] <Azendale> bigjools: I see a 'provider-state' and 'bootstrap-verify' when I list the files. It lists them with relative URLs. I don't see any command to delete in the Maas API, do I just need to go to the right folder and rm them?
[02:30] <Azendale> bigjools: (I also see various tools files for various architectures and versions of ubunu)
[02:30] <bigjools> Azendale: maas-cli <profile> files delete filename=<name> IIRC
[02:31] <bigjools> tools are ok
[02:31] <bigjools> delete the other two
[02:31] <bigjools> Azendale: so were the nodes still commissioning when you did destroy-env?
[02:34] <Azendale> bigjools: I'm not quite sure how to answer. I only did destroy-env with a new juju config, not on the old one
[02:35] <bigjools> Azendale: ah - then that is definitely a known bug.  There's a fix waiting to get pushed out.
[02:35] <Azendale> bigjools: I think that is part of my problem, that I didn't "clean up" on the old config first
[02:35] <bigjools> you need t odelete those files
[02:35] <bigjools> well your original problem was deleting a node that was allocated
[02:36] <Azendale> bigjools: I tried the command syntax you suggested, but it still seems like the maas-cli command doesn't have it (gives an error, and only lists 'add', 'list', 'get-by-key', 'get')
[02:38] <bigjools> Azendale: my bad, it's
[02:38] <bigjools>  maas-cli <profile> file <filename> delete
[02:38] <bigjools> do help on file and it should say
[02:40] <Azendale> bigjools: ah, I see what I was missing. I was looking at the help for fileS
[02:40] <bigjools> yeah :)
[02:40] <bigjools> the cli is based around the api structure so it looks a bit odd sometimes
[02:42] <Azendale> bigjools: Ok, it looks like it worked to remove the files. I'll give juju a try now. Thanks! I feel like a learned a bit about under the hood so it's less of a black box for me
[02:42] <bigjools> cool
[02:47] <Azendale> bigjools: It appears to have worked. The bootstrap command returned sucessfully, and a machine has been allocated. Thanks again.
[02:47] <bigjools> np
[02:47] <bigjools> you at least found a new bug for us :)
[02:47] <Azendale> bigjools:  I've been working on this stuff for a few weeks (trying to get openstack going in a test environment), and have realized I need to learn to debug/troubleshoot instead of just starting over when I break something (which I seem to have a knack for doing)
[02:48] <bigjools> some things are a little fragile unfortunately but we're working on making debugging easier
[02:52] <Azendale> bigjools: I learned about juju debug hooks yesterday, and I have say that system is pretty nice combined with --retry. I had to ask to figure out that you had to run hooks/<name_of_hook> to get the hook to run in the terminal, but once I knew that that part was really nice actually
[04:04] <AskUbuntu> Reset MAAS after loosing Juju configuration? | http://askubuntu.com/q/364821