<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 18, 2013 at 1:39 PM, Scott Moser <span dir="ltr"><<a href="mailto:smoser@ubuntu.com" target="_blank">smoser@ubuntu.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Fri, 18 Jan 2013, Diogo Matsubara wrote:<br>
<br>
> I added these instructions to the wiki:<br>
> <a href="https://wiki.canonical.com/Launchpad/MAASTesting" target="_blank">https://wiki.canonical.com/Launchpad/MAASTesting</a><br>
<br>
</div>As this is a public list, is there a publicly available document like<br>
this?<br></blockquote><div><br></div><div style>Good point! The MAASTesting doc contains information about our internal QA lab, so it won't be useful for the general public. I agree the debugging info is more generally useful for any MAAS user, so I'll talk to Nick to have this added to the official documentation on <a href="http://maas.ubuntu.com/docs/troubleshooting.html">http://maas.ubuntu.com/docs/troubleshooting.html</a></div>
<div style><br></div><div style>Cheers,</div><div style><br></div><div style>Diogo</div><div style> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">><br>
> Thanks Scott!<br>
><br>
><br>
> On Thu, Jan 17, 2013 at 12:08 PM, Diogo Matsubara<br>
> <<a href="mailto:matsubara@canonical.com">matsubara@canonical.com</a>>wrote:<br>
><br>
> > Hi Scott,<br>
> ><br>
> > thanks for these instructions, they're very useful.<br>
> > There are two small corrections to the script you sent below:<br>
> ><br>
> > On Thu, Dec 13, 2012 at 12:35 PM, Scott Moser <<a href="mailto:smoser@ubuntu.com">smoser@ubuntu.com</a>> wrote:<br>
> ><br>
> >> Hey all,<br>
> >><br>
> >> Whenever people have problems with enlistment or commissioning, often<br>
> >> times debugging from within the ephemeral image is needed to see whats<br>
> >> going on.<br>
> >><br>
> >> Below is a general "how to get around" guide.<br>
> >><br>
> >> ### backdoor (add a login) to ephemeral images ###<br>
> >> # If you cannot login to an instance, you might have to "backdoor it"<br>
> >> # in order to see what is going wrong. I wrote a simple utility<br>
> >> # that injects a user and password into an image. Heres how to<br>
> >> # add a 'backdoor' user with a password to your images.<br>
> >> bzr branch lp:~smoser/+junk/backdoor-image<br>
> >> imgs=$(echo var/lib/maas/ephemeral/*/*/*/*/*.img)<br>
> >> for img in $imgs; do<br>
> >> [ -f "$img.dist" ] || cp -a --sparse=always $img.dist<br>
> >> done<br>
> >><br>
> ><br>
> > I assume you wanted to make a backup copy of the original image files. The<br>
> > cp command is missing an argument though:<br>
> ><br>
> > [ -f "$img.dist" ] || cp -a --sparse=always $img $img.dist<br>
> ><br>
> > Is that the original intention?<br>
> ><br>
> ><br>
> > for img in $imgs; do<br>
> >> sudo ./backdoor-image -v --user=backdoor --password-auth<br>
> >> --password=ubuntu<br>
> >> done<br>
> >><br>
> ><br>
> > Likewise here:<br>
> > sudo ./backdoor-image -v --user=backdoor --password-auth<br>
> > --password=ubuntu $img<br>
> ><br>
> ><br>
> ><br>
> >><br>
> >> ### Inside the ephemeral image ###<br>
> >><br>
> >> ## Important files for debugging:<br>
> >> # Someone is likely to ask you for these things to help debug<br>
> >> /var/log/cloud-init.log<br>
> >> /var/log/boot.log<br>
> >> /var/log/cloud-init-output.log<br>
> >><br>
> >> # After enlistment or commissioning, the user-data from maas instructs<br>
> >> # the system to poweroff. To stop that from happening, you can just<br>
> >> # touch a file in /tmp.<br>
> >> touch /tmp/block-poweroff<br>
> >><br>
> >> ## maas credentials:<br>
> >> # maas credentials can be found in 2 places:<br>
> >> # * from the cmdline you'll see a 'url=' or 'cloud-config-url=' parameter<br>
> >> # You can get the cloud-config from that url, which will have<br>
> >> # credentials.<br>
> >> # example:<br>
> >> # $ sed -n 's,.*url=\([^ ]*\).*,\1,p' /proc/cmdline<br>
> >> #<br>
> >> <a href="http://10.55.60.194/MAAS/metadata/latest/enlist-preseed/?op=get_enlist_preseed" target="_blank">http://10.55.60.194/MAAS/metadata/latest/enlist-preseed/?op=get_enlist_preseed</a><br>
> >> # * from /etc/cloud/cloud.cfg.d/91_kernel_cmdline_url<br>
> >> # The file was pulled from url= parameter by cloud-init<br>
> >> # $ sudo cat /etc/cloud/cloud.cfg.d/91_kernel_cmdline<br>
> >><br>
> >> ### maas datasource ###<br>
> >> # the cloud-init datasource for MAAS can be invoked as a 'main' for<br>
> >> # debugging purposes. To do so, you need to know the url for the maas<br>
> >> # datasource and a config file that contains credentials.<br>
> >> #<br>
> >> $ cfg=$(echo /etc/cloud/cloud.cfg.d/*_cmdline_url.cfg)<br>
> >> $ echo $cfg<br>
> >> /etc/cloud/cloud.cfg.d/91_kernel_cmdline_url.cfg<br>
> >><br>
> >> # now get the metadata_url from there.<br>
> >> $ url=$(sudo awk '$1 == "metadata_url:" { print $2 }' $cfg)<br>
> >> $ echo $url<br>
> >> <a href="http://10.55.60.194/MAAS/metadata/enlist" target="_blank">http://10.55.60.194/MAAS/metadata/enlist</a><br>
> >><br>
> >> # invoke the client<br>
> >> # /usr/share/pyshared/cloudinit/sources/DataSourceMAAS.py<br>
> >> # the client has --help Usage also, but here is an example on how<br>
> >> # to use it.<br>
> >> $ maasds="/usr/share/pyshared/cloudinit/sources/DataSourceMAAS.py"<br>
> >> $ sudo python $maasds --config=$cfg get $url<br>
> >> == <a href="http://10.55.60.194/MAAS/metadata/enlist" target="_blank">http://10.55.60.194/MAAS/metadata/enlist</a> ==<br>
> >> 2012-03-01<br>
> >> latest<br>
> >><br>
> >> $ sudo python $maasds --config=$cfg get<br>
> >> $url/latest/meta-data/local-hostname<br>
> >> maas-enlisting-node<br>
> >><br>
> >> --<br>
> >> Mailing list: <a href="https://launchpad.net/~maas-devel" target="_blank">https://launchpad.net/~maas-devel</a><br>
> >> Post to : <a href="mailto:maas-devel@lists.launchpad.net">maas-devel@lists.launchpad.net</a><br>
> >> Unsubscribe : <a href="https://launchpad.net/~maas-devel" target="_blank">https://launchpad.net/~maas-devel</a><br>
> >> More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
> >><br>
> ><br>
> > Cheers,<br>
> > --<br>
> > Diogo M. Matsubara<br>
> ><br>
><br>
><br>
><br>
> --<br>
> Diogo M. Matsubara<br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Diogo M. Matsubara
</div></div>