<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ubuntu on Chris J Arges</title><link>https://chrisarges.net/tags/ubuntu/</link><description>Recent content in Ubuntu on Chris J Arges</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 25 Feb 2016 10:05:51 -0500</lastBuildDate><atom:link href="https://chrisarges.net/tags/ubuntu/index.xml" rel="self" type="application/rss+xml"/><item><title>grub-reboot with submenus</title><link>https://chrisarges.net/posts/2016-02-25-grub-reboot-with-submenus/</link><pubDate>Thu, 25 Feb 2016 10:05:51 -0500</pubDate><guid>https://chrisarges.net/posts/2016-02-25-grub-reboot-with-submenus/</guid><description>&lt;p&gt;Occasionally it is useful to be able to reboot a machine into an earlier kernel&#10;and watching and waiting for the grub menu isn&amp;rsquo;t always feasible or convenient.&lt;/p&gt;&#10;&lt;p&gt;The command &lt;code&gt;grub-reboot&lt;/code&gt; allows you to set a temporary entry to use for the&#10;next reboot; however you need to know the correct input in order for it to work.&lt;/p&gt;&#10;&lt;p&gt;First, look at &lt;code&gt;/boot/grub/grub.cfg&lt;/code&gt; and determine which kernel you want to&#10;reboot into. Note the menu and submenus to construct a string of the form&#10;&lt;code&gt;menu&amp;gt;submenu&lt;/code&gt;. For example if you want to reboot into an older kernel you can&#10;do:&lt;/p&gt;</description></item><item><title>building ubuntu kernels with debug symbols</title><link>https://chrisarges.net/posts/2015-10-02-building-ubuntu-kernels-with-debug-symbols/</link><pubDate>Fri, 02 Oct 2015 08:53:52 -0500</pubDate><guid>https://chrisarges.net/posts/2015-10-02-building-ubuntu-kernels-with-debug-symbols/</guid><description>&lt;p&gt;Occasionally it is useful to be able to build a kernel the Ubuntu way with&#10;debug symbols. The following is how to install dependencies, clone the tree,&#10;and finally build in such a way that ddeb packages get generated.&lt;/p&gt;&#10;&lt;p&gt;Here&amp;rsquo;s how:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get build-dep linux-image-&lt;span style="color:#66d9ef"&gt;$(&lt;/span&gt;uname -r&lt;span style="color:#66d9ef"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install fakeroot pkg-config-dbgsym git&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/wily &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd wily&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fakeroot debian/rules clean&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;debian/rules build-generic&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fakeroot debian/rules binary-generic binary-headers skipdbg&lt;span style="color:#f92672"&gt;=&lt;/span&gt;false&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Wait a bit and you should see a -dbgsym package get generated.&lt;/p&gt;</description></item><item><title>using linux livepatch on ubuntu</title><link>https://chrisarges.net/posts/2015-09-21-livepatch-on-ubuntu/</link><pubDate>Mon, 21 Sep 2015 13:03:26 -0500</pubDate><guid>https://chrisarges.net/posts/2015-09-21-livepatch-on-ubuntu/</guid><description>&lt;p&gt;Livepatching was &lt;a href="https://lkml.org/lkml/2014/11/6/387"&gt;introduced&lt;/a&gt; in the v4.0 kernel, and now Ubuntu 15.10 has&#10;a kernel capable of using this new and exciting feature. This works by using&#10;ftrace to redirect kernel function calls to the newly patched functions. In&#10;addition mechanisms for hooking into module insertion and removal are used for&#10;patching loadable modules. This feature also has sysfs directories for tracking&#10;which patches are applied and which functions they modify. With the basics&#10;aside, this blog post will show some simple examples of how to livepatch your&#10;kernel.&lt;/p&gt;</description></item><item><title>linux make deb-pkg speedup</title><link>https://chrisarges.net/posts/2015-07-30-linux-make-deb-pkg-speedup/</link><pubDate>Thu, 30 Jul 2015 15:20:31 -0500</pubDate><guid>https://chrisarges.net/posts/2015-07-30-linux-make-deb-pkg-speedup/</guid><description>&lt;p&gt;Because I&amp;rsquo;ve run &lt;code&gt;make deb-pkg&lt;/code&gt; so many times, I&amp;rsquo;ve started to see exactly where&#10;it starts to slow down even with really large machines. Observing cpu usage, I&#10;noticed that many parts of the build were serialized on a single core. Upon&#10;further investigation I found the following.&lt;/p&gt;&#10;&lt;h3 id="upstream-packaging"&gt;Upstream Packaging&lt;/h3&gt;&#10;&lt;p&gt;Module installation takes a really long time, and when building with&#10;&lt;code&gt;make deb-pkg -jN&lt;/code&gt;, you&amp;rsquo;ll see output like the following:&lt;/p&gt;</description></item><item><title>accessing maas database directly</title><link>https://chrisarges.net/posts/2015-05-27-accessing-maas-db-directly/</link><pubDate>Wed, 27 May 2015 13:02:46 -0500</pubDate><guid>https://chrisarges.net/posts/2015-05-27-accessing-maas-db-directly/</guid><description>&lt;p&gt;Let&amp;rsquo;s say you&amp;rsquo;ve messed up your MAAS installation and have no idea how to&#10;recover data about your nodes. Have no fear, you can access the django managed&#10;database directly.&lt;/p&gt;&#10;&lt;p&gt;Just use the following as root:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;maas-region-admin dbshell --installed&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you have access to an SQL command line interface.&lt;/p&gt;&#10;&lt;p&gt;For example if I want to see all hostnames and power_parameters for my servers,&#10;I can do the following:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;select hostname,power_parameters from maasserver_node;&#10;&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>qemu/kvm guest debugging</title><link>https://chrisarges.net/posts/2015-04-13-qemu-kvm-guest-debugging/</link><pubDate>Mon, 13 Apr 2015 12:24:22 -0500</pubDate><guid>https://chrisarges.net/posts/2015-04-13-qemu-kvm-guest-debugging/</guid><description>&lt;p&gt;Occasionally it is useful to debug a running guest VM&amp;rsquo;s kernel. Setup your host&#10;machine for virtual machine hosting with QEMU/KVM, and add ddebs to your host&#10;system using this &lt;a href="https://wiki.ubuntu.com/DebuggingProgramCrash"&gt;wiki&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Next, compile your own qemu with &lt;code&gt;--enable-debug&lt;/code&gt;. Setup your environment to&#10;use this binary (if using libvirt), or call it directly using qemu.&lt;/p&gt;&#10;&lt;p&gt;Ensure you have &lt;code&gt;vmlinux&lt;/code&gt; of the L1 guest somewhere in your L0 machine.&lt;/p&gt;&#10;&lt;p&gt;First, setup your L1 guest. If running with qemu add the &lt;code&gt;-s&lt;/code&gt; flag. With&#10;libvirt you can add the following entry to your machine description:&lt;/p&gt;</description></item><item><title>getting kernel crashdumps for hung machines</title><link>https://chrisarges.net/posts/2014-10-31-getting-kernel-crashdumps-for-hung/</link><pubDate>Fri, 31 Oct 2014 13:53:00 -0700</pubDate><guid>https://chrisarges.net/posts/2014-10-31-getting-kernel-crashdumps-for-hung/</guid><description>&lt;p&gt;Debugging hung machines can be a bit tricky. Here I&amp;rsquo;ll document methods to&#10;trigger a crashdump when these hangs occur. What exactly does it mean when a&#10;machine &amp;lsquo;hangs&amp;rsquo; or &amp;lsquo;freezes-up&amp;rsquo;? More information can be found in the kernel&#10;&lt;a href="https://www.kernel.org/doc/Documentation/lockup-watchdogs.txt"&gt;documentation&lt;/a&gt;, but overall there are really a few types of hangs.&lt;/p&gt;&#10;&lt;p&gt;A &amp;ldquo;Soft Lock-Up&amp;rdquo; is when the kernel loops in kernel mode for a duration without&#10;giving tasks a chance to run. A &amp;ldquo;Hard Lock-Up&amp;rdquo; is when the kernel loops in kernel&#10;mode for a duration without letting other interrupts run. In addition a&#10;&amp;ldquo;Hung Task&amp;rdquo; is when a userspace task has been blocking for a duration.&lt;/p&gt;</description></item><item><title>using ktest.pl with ubuntu</title><link>https://chrisarges.net/posts/2014-07-01-using-ktestpl-with-ubuntu/</link><pubDate>Tue, 01 Jul 2014 13:10:00 -0700</pubDate><guid>https://chrisarges.net/posts/2014-07-01-using-ktestpl-with-ubuntu/</guid><description>&lt;p&gt;Bisecting the kernel is one of those tasks that&amp;rsquo;s time-consuming and error prone.&#10;Ktest.pl is a script that lives in the linux kernel source &lt;a href="http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/tools/testing/ktest?id=HEAD"&gt;tree&lt;/a&gt; that helps&#10;to automate this process. The script is extremely extensible and as&#10;such takes time to understand which variables need to be set and where. In this&#10;post, I&amp;rsquo;ll go over how to perform a kernel bisection using a VM as the target&#10;machine. In this example I&amp;rsquo;m using &amp;lsquo;ubuntu&amp;rsquo; as the VM name.&lt;/p&gt;</description></item><item><title>using CRIU to checkpoint a kernel build</title><link>https://chrisarges.net/posts/2014-06-25-using-criu-to-checkpoint-kernel-build/</link><pubDate>Wed, 25 Jun 2014 13:46:00 -0700</pubDate><guid>https://chrisarges.net/posts/2014-06-25-using-criu-to-checkpoint-kernel-build/</guid><description>&lt;p&gt;&lt;a href="http://criu.org/Main_Page"&gt;CRIU&lt;/a&gt; stands for Checkpoint/Restart in Userspace. As the criu package should&#10;be landing in Utopic soon, and I wanted to test drive it to see how it handles.&lt;/p&gt;&#10;&lt;p&gt;I thought of an interesting example of being in the middle of a linux kernel&#10;build and a security update needing to be installed and the machine rebooted.&#10;While most of us could probably just reboot and rebuild, why not checkpoint it&#10;and save the progress; then restore after the system update? I admit its not&#10;the most useful example; but it is pretty cool nonetheless.&lt;/p&gt;</description></item><item><title>manually deploying openstack with a virtual maas on ubuntu trusty (part 2)</title><link>https://chrisarges.net/posts/2014-06-16-manually-deploying-openstack-with_16/</link><pubDate>Mon, 16 Jun 2014 10:16:00 -0700</pubDate><guid>https://chrisarges.net/posts/2014-06-16-manually-deploying-openstack-with_16/</guid><description>In the previous post, I went over how to setup a virtual MAAS environment using KVM [&lt;a href="http://dinosaursareforever.blogspot.com/2014/06/manually-deploying-openstack-with.html"&gt;1&lt;/a&gt;]. Here I will explain how to setup Juju for use with this environment.&#10;&#10;&lt;br /&gt;&lt;br /&gt;For this setup, we’ll use the maas-server as the juju client to interact with the cluster.&lt;br /&gt;&lt;br /&gt;This guide was very useful:&lt;br /&gt;&lt;a href="https://maas.ubuntu.com/docs/juju-quick-start.html"&gt;https://maas.ubuntu.com/docs/juju-quick-start.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Update to the latest stable tools:&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo apt-add-repository ppa:juju/stable&lt;br /&gt;sudo apt-get update&lt;br /&gt;&lt;/pre&gt;Next we want to setup juju on the host machine.&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo apt-get install juju-core&lt;/pre&gt;Create juju environment file.&lt;br /&gt;&lt;pre class="prettyprint"&gt;juju init&lt;/pre&gt;Generate a specific MAAS API key by using the following link:&lt;br /&gt;&lt;a href="http://192.168.100.10/MAAS/account/prefs/"&gt;http://192.168.100.10/MAAS/account/prefs/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;write the following to ~/.juju/environments.yaml replacing ‘maas api key’ with what was generated above:&lt;br /&gt;&lt;pre class="prettyprint"&gt;default: vmaas&lt;br /&gt;environments:&lt;br /&gt;&amp;nbsp; vmaas:&lt;br /&gt;&amp;nbsp; &amp;nbsp; type: maas&lt;br /&gt;&amp;nbsp; &amp;nbsp; maas-server: 'http://192.168.100.10/MAAS'&lt;br /&gt;&amp;nbsp; &amp;nbsp; maas-oauth: '&amp;lt;maas api key&amp;gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; admin-secret: ubuntu # or something generated with uuid&lt;br /&gt;&amp;nbsp; &amp;nbsp; default-series: trusty&lt;br /&gt;&lt;/pre&gt;Now let’s sync tools and bootstrap a node. Note, if you have multiple juju environments then you may need to specify ‘-e vmaas’ if it isn’t your default environment.&lt;br /&gt;&lt;pre class="prettyprint"&gt;juju sync-tools&lt;br /&gt;juju bootstrap # add --show-log --debug &amp;nbsp;for more output&lt;br /&gt;&lt;/pre&gt;See if it works by using the following command:&lt;br /&gt;&lt;pre class="prettyprint"&gt;juju status&lt;/pre&gt;You should see something similar to the following:&lt;br /&gt;&lt;pre class="prettyprint"&gt;~$ juju status&lt;br /&gt;environment: vmaas&lt;br /&gt;machines:&lt;br /&gt;&amp;nbsp; "0":&lt;br /&gt;&amp;nbsp; &amp;nbsp; agent-state: down&lt;br /&gt;&amp;nbsp; &amp;nbsp; agent-state-info: (started)&lt;br /&gt;&amp;nbsp; &amp;nbsp; agent-version: 1.18.4&lt;br /&gt;&amp;nbsp; &amp;nbsp; dns-name: maas-node-0.maas&lt;br /&gt;&amp;nbsp; &amp;nbsp; instance-id: /MAAS/api/1.0/nodes/node-e41b0c34-e1cb-11e3-98c6-5254001aae69/&lt;br /&gt;&amp;nbsp; &amp;nbsp; series: trusty&lt;br /&gt;services: {}&lt;br /&gt;&lt;/pre&gt;Now we can do a test deployment with the juju-gui to our bootstrap node.&lt;br /&gt;&lt;pre class="prettyprint"&gt;juju deploy juju-gui&lt;/pre&gt;While it is deploying you can type the following to get a log.&lt;br /&gt;&lt;pre class="prettyprint"&gt;juju debug-log&lt;/pre&gt;I wanted to be able to access the juju-gui from an ‘external’ address, so I edited /etc/networking/interfaces on that machine to have a static address:&lt;br /&gt;&lt;pre class="prettyprint"&gt;juju ssh 0&lt;/pre&gt;&lt;pre class="prettyprint"&gt;sudo vim /etc/networking/interfaces&lt;br /&gt;&lt;/pre&gt;Add the following to the file:&lt;br /&gt;&lt;pre class="prettyprint"&gt;auto eth0&lt;br /&gt;iface eth0 inet static&lt;br /&gt;&amp;nbsp; address 192.168.100.11&lt;br /&gt;&amp;nbsp; netmask 255.255.255.0&lt;br /&gt;&lt;/pre&gt;Bring that interface up.&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo ifup eth0&lt;/pre&gt;The password can be found here on the host machine:&lt;br /&gt;&lt;pre class="prettyprint"&gt;grep pass .juju/environments/vmaas.jenv&lt;/pre&gt;If you used the above configurations it should be ‘ubuntu’.&lt;br /&gt;&lt;br /&gt;Log into the service so you can monitor the status graphically during the deployment.&lt;br /&gt;&lt;br /&gt;If you get errors saying that servers couldn’t be reached you may have DNS configuration or proxy issues. You’ll have to first resolve these before using Juju. I’ve had is intermittent network issues in my lab. In order to workaround those physical issues you may have to retry the bootstrap, or increase the timeout values in ~/.juju/environments.yaml to use the following:&lt;br /&gt;&lt;pre class="prettyprint"&gt;&amp;nbsp; bootstrap-retry-delay: 5&lt;br /&gt;&amp;nbsp; bootstrap-timeout: 1200&lt;br /&gt;&lt;/pre&gt;Now you’re cooking with juju.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://dinosaursareforever.blogspot.com/2014/06/manually-deploying-openstack-with.html"&gt;http://dinosaursareforever.blogspot.com/2014/06/manually-deploying-openstack-with.html&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;</description></item><item><title>manually deploying openstack with a virtual maas on ubuntu trusty (part 1)</title><link>https://chrisarges.net/posts/2014-06-13-manually-deploying-openstack-with/</link><pubDate>Fri, 13 Jun 2014 15:05:00 -0700</pubDate><guid>https://chrisarges.net/posts/2014-06-13-manually-deploying-openstack-with/</guid><description>The goal of this new few series of posts is to be able to setup virtual machines to simulate a real-world openstack deployment using maas and juju. This goes through setting up a maas-server in a VM as well as setting up maas-nodes in VMs and getting them enlisted/commissioned into the maas-server. Next juju is configured to use the maas cluster. Finally, openstack is deployed using juju.&#10;&#10;&lt;br /&gt;&lt;div&gt;&lt;h2&gt;Overview&lt;/h2&gt;&lt;div&gt;&lt;h3&gt;Requirements&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;Ideally, a large server with 16 cores, 32G memory, 500G disk. Obviously you can tweak this setup to work with less; but be prepared to lock up lesser machines. In addition your host machine needs to be able to support nested virtualization.&lt;br /&gt;&lt;h3&gt;&lt;span style="font-family: inherit;"&gt;Topology&lt;/span&gt;&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;Here is the basics of what will be setup for our virtual maas cluster. Each red box is a virtual machine with two interfaces. The eth0 interface in the VM connects to the NATed maas-internet network, while the VM’s eth1 interface connects to the isolated maas-management network. The number of maas-nodes should match what is required for the deployment; however it is simple enough to enlist more nodes later. I choose to use a public/private network in order to be more flexible later in how openstack networking is set up.&lt;br /&gt;&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://4.bp.blogspot.com/-AYzkHv8R9o8/U58a3XQcwsI/AAAAAAAAElk/ce9RZTfDSnE/s1600/Manually+Deploying+Openstack+on+A+Virtual+MaaS+with+Ubuntu+Trusty.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://4.bp.blogspot.com/-AYzkHv8R9o8/U58a3XQcwsI/AAAAAAAAElk/ce9RZTfDSnE/s1600/Manually+Deploying+Openstack+on+A+Virtual+MaaS+with+Ubuntu+Trusty.png" height="299" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2&gt;Setup Host Machine&lt;/h2&gt;&lt;h3&gt;Install Requirements&lt;/h3&gt;&lt;div&gt;First install all required programs on the host machine.&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;sudo apt-get install libvirt-bin qemu-kvm cpu-checker virtinst uvtool&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next, check if kvm is working correctly.&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;kvm-ok&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ensure nested KVM is enabled. (replace intel with amd if necessary)&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;cat /sys/module/kvm_intel/parameters/nested&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This should output Y, if it doesn’t do the following:&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;sudo modprobe -r kvm_intel&lt;br /&gt;sudo modprobe kvm_intel nested=1&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ensure $USER is added to libvirtd group.&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;groups | grep libvirtd&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ensure host machine has SSH keys generated and setup. (Be careful, don’t overwrite your existing keys)&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;[ -d ~/.ssh ] || ssh-keygen -t rsa&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;h3&gt;Virtual Network Setup&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;This step can be done via virt-manager, but also done via command line using virsh.&lt;/div&gt;&lt;div&gt;Setup a virtual network which uses NAT to communicate with the host machine with the following parameters:&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;Network Name: maas_internet&lt;br /&gt;Network: 192.168.100.0/24&lt;br /&gt;Do _not_ Enable DHCP.&lt;br /&gt;Forwarding to physical network; Any physical device; NAT&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;And setup an isolated virtual network the following parameters: &lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;Network Name: maas_management&lt;br /&gt;Network: 10.10.10.0/24&lt;br /&gt;Do _not_ Enable DHCP.&lt;br /&gt;Isolated network;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Install the MAAS Server&lt;/h2&gt;&lt;h3&gt;Download and Start the Install&lt;/h3&gt;Ensure you have virt-manager connected to the hypervisor.&lt;br /&gt;While there are many ways we can create virtual machines, I chose the tool uvtool because it works well in Trusty and quickly creates VM based on the Ubuntu cloud image.&lt;br /&gt;&lt;br /&gt;Sync the latest cloud trusty cloud image:&lt;br /&gt;&lt;pre class="prettyprint"&gt;uvt-simplestreams-libvirt sync release=trusty arch=amd64&lt;/pre&gt;&lt;br /&gt;Create a maas-server VM:&lt;br /&gt;&lt;pre class="prettyprint"&gt;uvt-kvm create maas-server release=trusty arch=amd64 --disk 20 --memory 2048 --password ubuntu&lt;/pre&gt;&lt;br /&gt;After it boots, shut it down and &amp;nbsp;edit the VM’s machine configuration.&lt;br /&gt;Make the two network interfaces connect to maas_internet and maas_management respectively.&lt;br /&gt;&lt;br /&gt;Now edit /etc/network/interfaces to have the following:&lt;br /&gt;&lt;pre class="prettyprint"&gt;auto eth0&lt;br /&gt;iface eth0 inet static&lt;br /&gt;&amp;nbsp; address 192.168.100.10&lt;br /&gt;&amp;nbsp; netmask 255.255.255.0&lt;br /&gt;&amp;nbsp; gateway 192.168.100.1&lt;br /&gt;&amp;nbsp; dns-nameservers 10.10.10.10 192.168.100.1&lt;br /&gt;&lt;br /&gt;auto eth1&lt;br /&gt;iface eth1 inet static&lt;br /&gt;&amp;nbsp; address 10.10.10.10&lt;br /&gt;&amp;nbsp; netmask 255.255.255.0&lt;br /&gt;&amp;nbsp; dns-nameservers 10.10.10.10 192.168.100.1&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;And follow the instructions here:&lt;br /&gt;&lt;a href="http://maas.ubuntu.com/docs/install.html#pkg-install"&gt;http://maas.ubuntu.com/docs/install.html#pkg-install&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Which is essentially:&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo apt-get install maas maas-dhcp maas-dns&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;h3&gt;MAAS Server Post Install Tasks&lt;/h3&gt;&lt;a href="http://maas.ubuntu.com/docs/install.html#post-install"&gt;http://maas.ubuntu.com/docs/install.html#post-install&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First let’s check if the webpage is working correctly. Depending on your installation, you may need to proxy into a remote host hypervisor before accessing the webpage. If you’re working locally you should be able to access this address directly (as the libvirt maas_internet network is already connected to your local machine).&lt;br /&gt;&lt;br /&gt;If you need to access it indirectly (and 192.168.100.0 is a non-conflicting subnet):&lt;br /&gt;&lt;pre class="prettyprint"&gt;sshuttle -D -r &amp;lt;hypervisor IP&amp;gt; 192.168.100.0/24&lt;/pre&gt;&lt;br /&gt;Access the following:&lt;br /&gt;&lt;a href="http://192.168.100.10/MAAS"&gt;http://192.168.100.10/MAAS&lt;/a&gt;&lt;br /&gt;It should remind you that post installation tasks need to be completed.&lt;br /&gt;&lt;br /&gt;Let’s create the admin user from the hypervisor machine:&lt;br /&gt;ssh ubuntu@192.168.100.10&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo maas-region-admin createadmin --username=root --email="user@host.com" --password=ubuntu&lt;/pre&gt;&lt;br /&gt;If you want to limit the types of boot images that can be created you need to edit&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo vim /etc/maas/bootresources.yaml&lt;/pre&gt;&lt;br /&gt;Import boot images, using the new root user you created to log in:&lt;br /&gt;&lt;a href="http://192.168.100.10/MAAS/clusters/"&gt;http://192.168.100.10/MAAS/clusters/&lt;/a&gt;&lt;br /&gt;Now click 'import boot images' and be patient as it will take some time before these images are imported.&lt;br /&gt;&lt;br /&gt;Add a key for the host machine here:&lt;br /&gt;&lt;a href="http://192.168.100.10/MAAS/account/prefs/sshkey/add/"&gt;http://192.168.100.10/MAAS/account/prefs/sshkey/add/&lt;/a&gt;&lt;br /&gt;&lt;h3&gt;Configure the MAAS Cluster&lt;/h3&gt;Follow instructions here to setup cluster:&lt;br /&gt;&lt;a href="http://maas.ubuntu.com/docs/cluster-configuration.html"&gt;http://maas.ubuntu.com/docs/cluster-configuration.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://192.168.100.10/MAAS/clusters/"&gt;http://192.168.100.10/MAAS/clusters/&lt;/a&gt;&lt;br /&gt;Click on ‘Cluster master’&lt;br /&gt;Click on edit interface eth1.&lt;br /&gt;&lt;pre class="prettyprint"&gt;Interface: eth1&lt;br /&gt;Management: DHCP and DNS&lt;br /&gt;IP: 10.10.10.10&lt;br /&gt;Subnet mask: 255.255.255.0&lt;br /&gt;Broadcast IP: 10.10.10.255&lt;br /&gt;Router IP: 10.10.10.10&lt;br /&gt;IP Range Low: 10.10.10.100&lt;br /&gt;IP Range High: 10.10.10.200&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Click Save Interface&lt;br /&gt;Ensure Nodes Auto-Enlist&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create a MAAS key and use that to log in:&lt;br /&gt;&lt;a href="http://192.168.100.10/MAAS/account/prefs/"&gt;http://192.168.100.10/MAAS/account/prefs/&lt;/a&gt;&lt;br /&gt;Click on ‘+ Generate MAAS key’ and copy that down.&lt;br /&gt;&lt;br /&gt;Log into the maas-server, and then log into maas using the MAAS key:&lt;br /&gt;maas login maas-server http://192.168.100.10/MAAS&lt;br /&gt;&lt;br /&gt;Now set all nodes to auto accept:&lt;br /&gt;&lt;pre class="prettyprint"&gt;maas maas-server nodes accept-all&lt;/pre&gt;&lt;br /&gt;Setup keys on the maas-server so it can access the virtual machine host&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo mkdir -p ~maas&lt;br /&gt;sudo chown maas:maas ~maas&lt;br /&gt;sudo -u maas ssh-keygen&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Add the pubkey in ~maas/.ssh/id_rsa.pub to the virsh servers authorized_keys and to the maas SSH keys (&lt;a href="http://192.168.100.10/MAAS/account/prefs/sshkey/add/"&gt;http://192.168.100.10/MAAS/account/prefs/sshkey/add/&lt;/a&gt;)&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo cat /home/maas/.ssh/id_rsa.pub&lt;/pre&gt;&lt;br /&gt;Now install virsh to test a connection and allow the maas-server to control maas-nodes.&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo apt-get install libvirt-bin&lt;/pre&gt;&lt;br /&gt;Test the connection to the hypervisor (replace ubuntu with hypervisor host user)&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo -u maas virsh -c qemu+ssh://ubuntu@192.168.100.1/system list --all&lt;/pre&gt;&lt;h3&gt;Confirm Maas-Server Networking&lt;/h3&gt;Ensure we can reach important address via maas-server:&lt;br /&gt;&lt;pre class="prettyprint"&gt;host streams.canonical.com&lt;br /&gt;host store.juju.ubuntu.com&lt;br /&gt;host archive.ubuntu.com&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And that we can download charms if needed:&lt;br /&gt;&lt;pre class="prettyprint"&gt;wget https://store.juju.ubuntu.com/charm-info&lt;/pre&gt;&lt;h3&gt;Setup Traffic Forwarding&lt;/h3&gt;Setup maas-server to forward traffic from eth1 to eth0:&lt;br /&gt;&lt;br /&gt;You can type the following out manually or add it as an upstart script to ensure forwarding is setup properly each time add this file to &lt;b&gt;/etc/init/ovs-routing.conf &lt;/b&gt;(thanks to Juan Negron):&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;description "Setup NAT rules for ovs bridge"&lt;br /&gt;&lt;br /&gt;start on runlevel [2345]&lt;br /&gt;&lt;br /&gt;env EXTIF="eth0"&lt;br /&gt;env BRIDGE="eth1"&lt;br /&gt;&lt;br /&gt;task&lt;br /&gt;&lt;br /&gt;script&lt;br /&gt; echo "Configuring modules"&lt;br /&gt; modprobe ip_tables || :&lt;br /&gt; modprobe nf_conntrack || :&lt;br /&gt; modprobe nf_conntrack_ftp || :&lt;br /&gt; modprobe nf_conntrack_irc || :&lt;br /&gt; modprobe iptable_nat || :&lt;br /&gt; modprobe nf_nat_ftp || :&lt;br /&gt;&lt;br /&gt; echo "Configuring forwarding and dynaddr"&lt;br /&gt; echo "1" &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt; echo "1" &amp;gt; /proc/sys/net/ipv4/ip_dynaddr&lt;br /&gt;&lt;br /&gt; echo "Configuring iptables rules"&lt;br /&gt; iptables-restore &amp;lt;&amp;lt;-EOM&lt;br /&gt;*nat&lt;br /&gt;-A POSTROUTING -o ${EXTIF} -j MASQUERADE&lt;br /&gt;COMMIT&lt;br /&gt;*filter&lt;br /&gt;:INPUT ACCEPT [0:0]&lt;br /&gt;:FORWARD ACCEPT [0:0]&lt;br /&gt;:OUTPUT ACCEPT [0:0]&lt;br /&gt;-A FORWARD -i ${BRIDGE} -o ${EXTIF} -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;-A FORWARD -i ${EXTIF} -o ${BRIDGE} -j ACCEPT&lt;br /&gt;-A FORWARD -j LOG&lt;br /&gt;COMMIT&lt;br /&gt;EOM&lt;br /&gt;&lt;br /&gt;end script&lt;br /&gt;&lt;/pre&gt;Then start the service:&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo service ovs-routing start&lt;/pre&gt;&lt;h3&gt;Setup Squid Proxy&lt;/h3&gt;Ensure squid proxy can access cloud images:&lt;br /&gt;&lt;pre class="prettyprint"&gt;echo "cloud-images.ubuntu.com" | sudo tee /etc/squid-deb-proxy/mirror-dstdomain.acl.d/98-cloud-images&lt;/pre&gt;&lt;pre class="prettyprint"&gt;sudo service squid-deb-proxy restart&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Install MAAS Nodes&lt;/h2&gt;Now we can virt-install each maas-node on the hypervisor such that it automatically pxe boots and auto-enlists into MAAS. You can adjust the script below to create as many nodes as required. I’ve also simplified things by creating everything with dual nics and ample memory and hard drive space, but of course you could use custom machines per service. Compute-nodes need more compute power, ceph nodes will need more storage, and quantum-gateway will need dual nics. In addition you could specify raw disks instead of qcow2, or use storage pools; but in this case I wanted something simple that didn’t automatically use all the space it needed.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;for i in {0..19}; do&lt;br /&gt; virt-install \&lt;br /&gt; --name=maas-node-${i} \&lt;br /&gt; --connect=qemu:///system --ram=4096 --vcpus=1 --hvm --virt-type=kvm \&lt;br /&gt; --pxe --boot network,hd \&lt;br /&gt; --os-variant=ubuntutrusty --graphics vnc --noautoconsole --os-type=linux --accelerate \&lt;br /&gt;--disk=/var/lib/libvirt/images/maas-node-${i}.qcow2,bus=virtio,format=qcow2,cache=none,sparse=true,size=32 \&lt;br /&gt; --network=network=maas_internet,model=virtio \&lt;br /&gt; --network=network=maas_management,model=virtio &lt;br /&gt;done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now each node needs to be manually enlisted with the proper power configuration.&lt;br /&gt;&lt;a href="http://maas.ubuntu.com/docs/nodes.html#virtual-machine-nodes"&gt;http://maas.ubuntu.com/docs/nodes.html#virtual-machine-nodes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;Host Name: maas-node-${i}.vmaas&lt;br /&gt;Power Type: virsh&lt;br /&gt;Power Address: qemu+ssh://ubuntu@192.168.100.1/system&lt;br /&gt;Power ID: maas-node-${i}&lt;br /&gt;&lt;/pre&gt;Here we need to match the machines to the mac address and update the power requirements. &amp;nbsp;You can get the mac addresses of each node by using the following on the hypervisor:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;virsh dumpxml maas-node-${i} | grep "mac addr"&lt;/pre&gt;&lt;br /&gt;Here is a script that helps automate some of this process, it can be run from the maas-server (replace USER ubuntu with the appropriate value) this matches mac address from virsh to the ones in maas and then sets up the power accordingly:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;#!/usr/bin/python&lt;br /&gt;&lt;br /&gt;import sys, os, libvirt&lt;br /&gt;from xml.dom.minidom import parseString&lt;br /&gt;os.environ['DJANGO_SETTINGS_MODULE'] = 'maas.settings'&lt;br /&gt;sys.path.append("/usr/share/maas")&lt;br /&gt;from maasserver.models import Node, Tag&lt;br /&gt;&lt;br /&gt;hhost = 'qemu+ssh://ubuntu@192.168.100.1/system'&lt;br /&gt;&lt;br /&gt;conn = libvirt.open(hhost)&lt;br /&gt;nodes_dict = {}&lt;br /&gt;domains = conn.listDefinedDomains()&lt;br /&gt;for node_name in domains:&lt;br /&gt; node = conn.lookupByName(node_name)&lt;br /&gt; node_xml = parseString(node.XMLDesc(0))&lt;br /&gt; node_mac1 = node_xml.getElementsByTagName('interface')[0].getElementsByTagName('mac')[0].getAttribute('address')&lt;br /&gt; nodes_dict[node_mac1] = node_name&lt;br /&gt;&lt;br /&gt;maas_nodes = Node.objects.all()&lt;br /&gt;for node in maas_nodes:&lt;br /&gt; try:&lt;br /&gt; system_id = node.system_id&lt;br /&gt; mac = node.get_primary_mac()&lt;br /&gt; node_name = nodes_dict[str(mac)]&lt;br /&gt; node.hostname = node_name&lt;br /&gt; node.power_type = 'virsh'&lt;br /&gt; node.power_parameters = { 'power_address':hhost, 'power_id':node_name }&lt;br /&gt; node.save()&lt;br /&gt; except: pass&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note you will need python-libvirt and run the above command with something like the following:&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo -u maas ./setup-nodes.py&lt;/pre&gt;&lt;h3&gt;Setup Fastpath and Commission Nodes&lt;/h3&gt;You most likely want to use fast-path installer on nodes to speed up installation times. Set all nodes to use fastpath installer using another bulk action on the nodes.&lt;br /&gt;&lt;br /&gt;After you have all this done, click bulk action commission.&lt;br /&gt;You should see all your machines starting up if you set things up properly, give this some time. You should have all the nodes in the 'Ready' state in maas now!&lt;br /&gt;&lt;a href="http://192.168.100.10/MAAS/nodes/"&gt;http://192.168.100.10/MAAS/nodes/&lt;/a&gt;&lt;br /&gt;&lt;h3&gt;Confirm DNS setup&lt;/h3&gt;One point of trouble can be ensuring DNS is setup correctly. We can test this by starting a maas node and inside of that trying the following:&lt;br /&gt;&lt;pre class="prettyprint"&gt;dig streams.canonical.com&lt;br /&gt;dig store.juju.ubuntu.com&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If we can’t hit those, we’ll need to ensure the maas server is setup correctly.&lt;br /&gt;Go to: &lt;a href="http://192.168.100.10/MAAS/settings/"&gt;http://192.168.100.10/MAAS/settings/&lt;/a&gt;&lt;br /&gt;Enter the host machines upstream DNS if necessary here, it should setup the bind configuration file and restart that service. After this re-test.&lt;br /&gt;&lt;br /&gt;In addition I had to disable dnssec-validation for bind. Edit the following file:&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo vim /etc/bind/named.conf.options&lt;/pre&gt;&lt;br /&gt;And change the following value:&lt;br /&gt;&lt;pre class="prettyprint"&gt;dnssec-validation no;&lt;/pre&gt;&lt;br /&gt;And restart the service:&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo service bind9 restart&lt;/pre&gt;&lt;br /&gt;Now you have a working virtual maas setup using the latest Ubuntu LTS!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://3.bp.blogspot.com/-nAwPK-nWeaA/U58a_Kf7v4I/AAAAAAAAEls/8JACkxWF4xU/s1600/Screenshot+from+2014-06-10+13:57:30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://3.bp.blogspot.com/-nAwPK-nWeaA/U58a_Kf7v4I/AAAAAAAAEls/8JACkxWF4xU/s1600/Screenshot+from+2014-06-10+13:57:30.png" height="544" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description></item><item><title>using kgraft with ubuntu</title><link>https://chrisarges.net/posts/2014-06-06-using-kgraft-with-ubuntu/</link><pubDate>Fri, 06 Jun 2014 11:50:00 -0700</pubDate><guid>https://chrisarges.net/posts/2014-06-06-using-kgraft-with-ubuntu/</guid><description>&lt;p&gt;New live kernel patching projects have hit LKML recently &lt;a href="https://lkml.org/lkml/2014/4/30/477"&gt;here&lt;/a&gt; and&#10;&lt;a href="https://lkml.org/lkml/2014/5/1/273"&gt;here&lt;/a&gt;, and I&amp;rsquo;ve taken the opportunity to test drive kGraft with the Ubuntu&#10;kernel. This post documents how to get a sample patch working.&lt;/p&gt;&#10;&lt;p&gt;First, I had to take the &lt;a href="https://git.kernel.org/cgit/linux/kernel/git/jirislaby/kgraft.git/"&gt;patches&lt;/a&gt; and apply them against the&#10;ubuntu-utopic kernel, which is based on 3.15-rc8 as of this post. They&#10;cherry-picked cleanly and the branch I&amp;rsquo;m using is stored &lt;a href="http://zinc.ubuntu.com/git?p=arges/ubuntu-utopic.git;a=shortlog;h=refs/heads/kgraft-utopic"&gt;here&lt;/a&gt;. In addition&#10;to applying the patches I had to also enable CONFIG_KGRAFT. A pre-built test&#10;kernel can be downloaded &lt;a href="http://people.canonical.com/~arges/kgraft-utopic/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>creating a local vm easily and automatically</title><link>https://chrisarges.net/posts/2014-03-05-creating-local-vm-easily-and/</link><pubDate>Wed, 05 Mar 2014 14:22:00 -0800</pubDate><guid>https://chrisarges.net/posts/2014-03-05-creating-local-vm-easily-and/</guid><description>&lt;p&gt;This is the nifty little snippet I use to create a quick and dirty VM for&#10;testing. Just &lt;code&gt;apt-get install vmbuilder&lt;/code&gt; and run the following:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;ubuntu&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vmbuilder kvm ubuntu --arch &lt;span style="color:#e6db74"&gt;&amp;#39;amd64&amp;#39;&lt;/span&gt; --suite &lt;span style="color:#e6db74"&gt;&amp;#39;precise&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--rootsize &lt;span style="color:#e6db74"&gt;&amp;#39;8096&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--mem &lt;span style="color:#e6db74"&gt;&amp;#39;1024&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--components &lt;span style="color:#e6db74"&gt;&amp;#39;main,universe&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--addpkg vim &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--addpkg openssh-server &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--addpkg bash-completion &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--user &lt;span style="color:#e6db74"&gt;&amp;#39;ubuntu&amp;#39;&lt;/span&gt; --pass &lt;span style="color:#e6db74"&gt;&amp;#39;ubuntu&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-d /var/lib/libvirt/images/&lt;span style="color:#e6db74"&gt;${&lt;/span&gt;NAME&lt;span style="color:#e6db74"&gt;}&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--libvirt qemu:///system &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-o &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-v --debug &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--hostname &lt;span style="color:#e6db74"&gt;${&lt;/span&gt;NAME&lt;span style="color:#e6db74"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you need additional help consult the&#10;&lt;a href="https://help.ubuntu.com/12.04/serverguide/jeos-and-vmbuilder.html"&gt;serverguide&lt;/a&gt;&lt;/p&gt;</description></item><item><title>using LTS HWE kernels with MAAS nodes</title><link>https://chrisarges.net/posts/2014-03-05-using-lts-hwe-kernels-with-maas-nodes/</link><pubDate>Wed, 05 Mar 2014 14:21:00 -0800</pubDate><guid>https://chrisarges.net/posts/2014-03-05-using-lts-hwe-kernels-with-maas-nodes/</guid><description>&lt;p&gt;Once you get machines setup using &lt;a href="http://maas.ubuntu.com/"&gt;MAAS&lt;/a&gt;, you may want to be able to install&#10;an alternative kernel when starting a machine. Here&amp;rsquo;s how to do it.&lt;/p&gt;&#10;&lt;p&gt;This is assuming we have already commissioned a node, but have not started it.&lt;/p&gt;&#10;&lt;p&gt;If we are using the &lt;em&gt;normal&lt;/em&gt; installer with MAAS do the following: Edit&#10;&lt;code&gt;/etc/maas/preseeds/preseed_master&lt;/code&gt; on your maas-server&lt;/p&gt;&#10;&lt;p&gt;Add the second line as shown:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;d-i base-installer/kernel/image string linux-server d-i&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;base-installer/kernel/override-image string linux-generic-lts-saucy&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Start the node, Now when you boot you should be using the 3.11 series kernel.&lt;/p&gt;</description></item><item><title>creating a local vm domain from an ubuntu cloud image</title><link>https://chrisarges.net/posts/2014-02-17-creating-local-vm-domain-from-ubuntu/</link><pubDate>Mon, 17 Feb 2014 11:43:00 -0800</pubDate><guid>https://chrisarges.net/posts/2014-02-17-creating-local-vm-domain-from-ubuntu/</guid><description>&lt;p&gt;It is very convenient to be able to quickly spin up a local VM in order to do&#10;some sort of bug verification or testing. Generally I can use a cloud provider&#10;to spin up an instance, but occasionally you need the flexibility of a local VM&#10;in order to setup more complex networking or other specific environments.&lt;/p&gt;&#10;&lt;p&gt;This &lt;a href="http://ubuntu-smoser.blogspot.com/2013/02/using-ubuntu-cloud-images-without-cloud.html"&gt;link&lt;/a&gt; was extremely helpful in figuring our how to setup a ready to boot&#10;image, but I noticed a few issues. First, on Precise I didn&amp;rsquo;t have the&#10;cloud-localds tool, and second there wasn&amp;rsquo;t a very simple way to import the&#10;image into libvirt.&lt;/p&gt;</description></item><item><title>automatic bisection of qemu with console and monitor interaction</title><link>https://chrisarges.net/posts/2013-12-16-automatic-bisection-of-qemu-with/</link><pubDate>Mon, 16 Dec 2013 14:39:00 -0800</pubDate><guid>https://chrisarges.net/posts/2013-12-16-automatic-bisection-of-qemu-with/</guid><description>&lt;p&gt;I had some fun debugging a performance &lt;a href="http://pad.lv/1100843"&gt;issue&lt;/a&gt; after VM migration on v1.0.&#10;Because this was fixed in newer versions, a bisect was in order. Doing this&#10;manually becomes very tedious so writing some scripts to use &lt;code&gt;git bisect run&lt;/code&gt;&#10;really helps. Here I&amp;rsquo;ll document how I did this in case others find it useful&#10;when trying to bisect issues in qemu.&lt;/p&gt;&#10;&lt;p&gt;First step is getting the problem reproducible using the command line. In&#10;addition you will also need to output anything that be used to determine if the&#10;test case passes or fails using standard console output. This makes it easy to&#10;run the test case with expect. You will need to &lt;a href="https://help.ubuntu.com/community/SerialConsoleHowto"&gt;follow&lt;/a&gt; on how to setup your&#10;VM to use serial output.&lt;/p&gt;</description></item><item><title>setup an external drives as raid1</title><link>https://chrisarges.net/posts/2013-12-16-setup-external-drives-as-raid1/</link><pubDate>Mon, 16 Dec 2013 14:37:00 -0800</pubDate><guid>https://chrisarges.net/posts/2013-12-16-setup-external-drives-as-raid1/</guid><description>&lt;p&gt;I purchased a cheap two drive USB enclosure in order to setup an external drive&#10;that had RAID-1 so I could backup photos and recordings.&lt;/p&gt;&#10;&lt;p&gt;First, I formatted both drives. Then I ran extended smart self-tests to ensure&#10;I had decent drives. With RAID-1 and two drives I can only tolerate 1 drive&#10;failure.&lt;/p&gt;&#10;&lt;p&gt;Next ensure mdadm is installed: &lt;code&gt;sudo apt-get install mdadm&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;Determine which dev devices the disks show up as. Next, create the raid device&#10;pointing at the correct dev directory.&lt;/p&gt;</description></item><item><title>use default gpg key for debuild</title><link>https://chrisarges.net/posts/2013-09-10-use-default-gpg-key-for-debuild/</link><pubDate>Tue, 10 Sep 2013 09:30:00 -0700</pubDate><guid>https://chrisarges.net/posts/2013-09-10-use-default-gpg-key-for-debuild/</guid><description>&lt;p&gt;When using &lt;code&gt;debuild -S&lt;/code&gt; to build a package on new machines, I need to go&#10;through the process of ensuring that my gpg is set up properly. If set up&#10;incorrectly, I get the following message with &lt;code&gt;debuild -S&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gpg: skipped &lt;span style="color:#e6db74"&gt;&amp;#34;User &amp;lt;user@host.com&amp;gt;&amp;#34;&lt;/span&gt;: secret key not available&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To fix this, I go through the following steps:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Ensure I have proper gpg keys set up. You can check if yours is installed&#10;properly using: &lt;code&gt;gpg --list-keys&lt;/code&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Add &lt;code&gt;DEBEMAIL&lt;/code&gt; and &lt;code&gt;DEBFULLNAME&lt;/code&gt; to &lt;code&gt;~/.bashrc&lt;/code&gt;. Ensure&#10;&lt;code&gt;DEBEMAIL&lt;/code&gt; matches the email in the matching gpg key, and ensure&#10;DEBFULLNAME matches the name in same key. Put these into your &lt;code&gt; ~/.bashrc&lt;/code&gt;&#10;file or wherever they will be sourced into your environment.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Make sure your key is the default key: Edit &lt;code&gt;~/.gnupg/gpg.conf&lt;/code&gt; such&#10;that default-key is set to the proper key. This should match the 8 character&#10;fingerprint that you verified in (1).&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Make sure the same key is the default for debuilder: Edit&#10;/etc/devscripts.conf with the folllowing: &lt;code&gt;DEBSIGN_KEYID=XXXXXX&lt;/code&gt; where&#10;&lt;code&gt;XXXXXX&lt;/code&gt; is your key.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Now next time you use &lt;code&gt;debuild -S&lt;/code&gt; it should use the proper gpg key,&#10;name and email address!&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;</description></item><item><title>building a proper debian source package with dkms</title><link>https://chrisarges.net/posts/2013-09-05-building-proper-debian-source-package/</link><pubDate>Thu, 05 Sep 2013 07:10:00 -0700</pubDate><guid>https://chrisarges.net/posts/2013-09-05-building-proper-debian-source-package/</guid><description>&lt;p&gt;How can one use DKMS to build a proper debian source package? The &lt;code&gt;mkdsc&lt;/code&gt;&#10;command will actually generate one automatically, but there are a few more&#10;steps to simplify it, and bring it up to date.&lt;/p&gt;&#10;&lt;p&gt;First follow the steps &lt;a href="https://wiki.ubuntu.com/Kernel/Dev/DKMSPackaging"&gt;here&lt;/a&gt; for setting up a DKMS package. Make sure you&#10;can build it using dkms. Then do the following:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;#First pull in some dependencies as necessary&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install devscripts debhelper&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Create the debian source package&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo dkms mkdsc -m hello -v 0.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Create a directory to work in, and let’s copy those files into it&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir ~/dsc &lt;span style="color:#f92672"&gt;&amp;amp;&amp;amp;&lt;/span&gt; cd ~/dsc&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cp /var/lib/dkms/hello/0.1/dsc/* .&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Extract the .dsc to be able to edit the directory&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dpkg-source -x hello-dkms_0.1.dsc &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd hello-dkms-0.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If we run debuild -uc -us, we see a few lintian errors and warnings:&lt;/p&gt;</description></item><item><title>building a binary debian kernel module package with dkms</title><link>https://chrisarges.net/posts/2013-07-23-building-binary-debian-kernel-module/</link><pubDate>Tue, 23 Jul 2013 14:40:00 -0700</pubDate><guid>https://chrisarges.net/posts/2013-07-23-building-binary-debian-kernel-module/</guid><description>&lt;p&gt;DKMS packaging works great for building out of tree kernel modules. However,&#10;what do you do when you need to install to a machine without a compiler? You&#10;can accompish this by using DKMS&amp;rsquo;s &lt;code&gt;mkdriverdisk&lt;/code&gt; functionality.&lt;/p&gt;&#10;&lt;p&gt;First follow the steps &lt;a href="https://wiki.ubuntu.com/Kernel/Dev/DKMSPackaging"&gt;here&lt;/a&gt; for setting up a proper DKMS package.&lt;/p&gt;&#10;&lt;p&gt;After you&amp;rsquo;ve built the module successfully, you can use the following bash&#10;script to extract the .deb installer from the driverdisk. This way you can copy&#10;the deb file to the target machine and install. You must ensure that &lt;code&gt;$(uname -rm)&lt;/code&gt;&#10;on the target machine matches the build machine.&lt;/p&gt;</description></item></channel></rss>