Ubuntu – Juju debug-hooks, how to run hook in debug terminal or get more information


I'm having trouble deploying the Havana Openstack charms on precise for cinder, nova-cloud-controller, and quantum-gateway. I'm using MaaS running Virsh managed KVM machines.

I'm getting errors with the install hooks.

I read that you can use juju debug-hooks to try to find the problem, but that you basically get given a terminal to the machine so you can do whatever the hook would have done by hand. I've seen a blog post that said you could run a command in the terminal to run the hook. I'd just like to get some more visibility on what is failing, so I am thinking that if I can run the hook in the terminal, I might see output that tells me what is happening.

How can I manually trigger a hook in a debug-hooks terminal? Or is there a better way to find what is causing a charm to fail to deploy?

Best Answer

You can find the answer to this in our debugging hooks section of the docs.

What you'll need to do is launch debug-hooks from the Juju client machine, then resolve the error with the --retry flag (or retry from the Juju Gui if you are using it). This will re-execute the hook and trap the event in the debug-hooks window. From there you will be in the right directory to run the hook file by typing hooks/<name-of-failed-hook> to get output. When you are done, simply press Ctrl D to exit the terminal and signal to Juju that the hook is finished executing.

Related Question