Browsed by
Category: Linux

Netboot.xyz Docker Service

Netboot.xyz Docker Service

netboot.xyz offers a feature rich zero configuration iPXE boot-up environment with all the linux and utility images you could ask for. This is great as we don’t have to maintain up-to-date bootable PXE images locally.

We are running netboot.xyz on docker swarm. We found the tftp server did not function correctly when utilizing the swarm network so instead bound this specific container’s networking to host.

docker service create --replicas 1 --name netbootxyz \
    --constraint node.hostname==specific_node_name \
    --network=host \
    --replicas=1 \
     rjocoleman/netboot.xyz

Finally you need to configure your DHCP server to return the IP for specific_node_name as the Next Server.

Initial Menu:

Linux Distributions:

Utilities:

N.B. the contraint does mean we lose resiliency, but given the low resources this container requires (it’s less than 5MB!) you could easily remove the constraint and replace –replicas=1 with –mode=global. How you expose multiple swarm nodes behind a single virtual IP is a topic for another post.

libvirt – adding storage pools manually

libvirt – adding storage pools manually

I use direct disk pass-through for several of my KVM guests. I usually use Virt-Manager to set these up, but a bug in the latest version (1.2.1) made that impossible.

Fortunately it’s pretty easy to add drives using virsh. First check the existing storage pools:

$ virsh pool-list --all
Name State Autostart
-------------------------------------------
Backup active yes
BigParity inactive yes
default active yes
Parity active yes

Create a storage pool xml file. Look at the existing pools in  /etc/libvirt/storage/ for reference. Create the file locally:

$ cat Parity5TB.xml
<pool type='disk'>
<name>Parity5TB</name>
<uuid>8a4550e0-3bcf-4351-ad36-496b51737c</uuid>
<capacity unit='bytes'>0</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>0</available>
<source>
<device path='/dev/disk/by-id/ata-TOSHIBA_MD04ACA500_55F'/>
<format type='unknown'/>
</source>
<target>
<path>/dev/disk/by-id</path>
<permissions>
<mode>0711</mode>
<owner>-1</owner>
<group>-1</group>
</permissions>
</target>
</pool>

 

Note that I use /dev/disk/by-id. You can use any /dev/disk/by-* reference, but NEVER use /dev/sd* (you’ll undestand why after the first time you add or remove a drive).

Assuming it’s already formatted (I find it easiest to format on the host with gparted and pass through the pre-formatted disk) you can quickly get the uuid with blkid. Then either use /dev/disk/by-uuid, or lookup the symbolic links in the /dev/disk/by-X directory.

Add the pool to your definitions:

$ virsh pool-define Parity5TB.xml
$ virsh pool-list --all
Name State Autostart
-------------------------------------------
Backup active yes
BigParity inactive yes
default active yes
Parity active yes
Parity5TB active no

That’s it. This does not autostart the drive, or attach it to any guests, but you can still do this through virt-manager.

Enable Built-in Wifi on Pogoplug v3/Oxnas Running Debian Squeeze

Enable Built-in Wifi on Pogoplug v3/Oxnas Running Debian Squeeze

I’ve not had much luck with the Pogoplug lottery. With archlinux EOL on the oxnas Pogoplugs, I’ve been Debian Squeeze with the latest archlinuxarm kernel: 2.6.31.6_SMP_820

Turns out my Pogoplug Biz had a built in wifi, but getting it to work wasn’t straightforward.

These are the steps I remember off the top of my head.

It’s worth installing:

[email protected]:$ sudo apt-get install pciutils iw wireless-tools

Make sure you do indeed have a PCIe wireless card:

[email protected]:$ lspci
00:00.0 Network controller: RaLink RT3090 Wireless 802.11n 1T/1R PCIe

In my case the card wasn’t loaded correctly (it didn’t show in the output of ifconfig).

Although the device didn’t show in ifconfig, it did show in iwconfig as ra1.

ifconfig ra1 up gave me a controls permission error.

I followed these instructions:

mount -t ubifs -o ro ubi0:rootfs /tmp/ce
sudo mount -t ubifs -o ro ubi0:rootfs /tmp/ce
sudo mkdir /etc/Wireless
/bin/cp -rfv /tmp/ce/etc/Wireless/RT2860STA /etc/Wireless
sudo /bin/cp -rfv /tmp/ce/etc/Wireless/RT2860STA /etc/Wireless
sudo nano /etc/udev/rules.d/70-persistent-net.rules

Nothing was working so I restarted out of frustration.

[email protected]:$ lsmod
cfg80211 85932 1 rt3390sta

Looks good. Issued:
modprobe cfg80211

Now for the first time I think I could bring the interface up without errors:
sudo ifconfig ra1 up

And I could scan for networks:

iwlist ra1 scanning

Now the most painful part, actually getting it to connect to your wireless network!

ifconfig ra1 up
sleep 3
iwpriv ra1 set WpaSupport=0
iwpriv ra1 set WirelessMode=Managed
iwpriv ra1 set WirelessMode=7
iwpriv ra1 set AuthMode=WPA2PSK
iwpriv ra1 set EncrypType=AES
iwpriv ra1 set SSID="MySSID"
iwpriv ra1 set WPAPSK="MyPassword"

sleep 1
dhcpcd ra1

Here the most important line was the WpaSupport=0. Before that the interface would come up but not connect to the access point. Note, the SSID and Password are in quotes – I saw many places saying they should be unquoted but this worked for me.

Finally, the WirelessMode=7 refers to a mixed n/g network. I’m not sure this line is even needed.

Drive Performance Under KVM Using Virtio

Drive Performance Under KVM Using Virtio

Using KVM I was experiencing erratic performance from disk I/O on my OpenMediaVault guest. Aside from the OS volume (8GB on a Vertex Plus SSD) I had 4*3TB drives:

4 * Seagate ST3000DM001
2 * Toshiba DT01ACA300

I added all disks using virt-manager:

Add Storage-Pool->disk: Physical Disk Device->Source Path:/dev/disk/by-id/[DISK_ID]

The only subtle variation in adding the drives was that the 2 * Toshibas were blank, added with Format = auto and Build Pool: Unchecked.

The Seagates had existing, but unwanted partitions. An apparent bug in virt-manager meant I could not delete the pre-existing partitions so I had to add them with Format = gpt and Build Pool: Checked.

I was under the impression that in both cases the raw drive would be presented to the guest…. so let’s take a look at the resulting performance.

Read benchmark:
hdparm -t --direct
Write Benchmark:
dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync

On Host
[table]
Model, OCZ Vertex Plus[/dev/sda], TOSHIBA DT01ACA300[/dev/sdc], Seagate ST3000DM001[/dev/sde]
Read, 221.93MB/s, 186.89MB/s, 169.22MB/s, 179.48MB/s
Write, 158.67MB/s, N/A, N/A
[/table]

On Guest
[table]
Model, OCZ Vertex Plus[/dev/vda], TOSHIBA DT01ACA300[/dev/sdc], Seagate ST3000DM001[/dev/sde]
Read, 126.23MB/s, 185.86MB/s, 98.87MB/s
Write, 122MB/s, 117.67MB/s, 88.83MB/s
[/table]

That’s a huge difference in performance between the Toshiba and the Seagate. Not only that, but the read/write performance on the Seagates was extremely unstable.

Let’s take a look at the Storage Volume configurations for these drives.

Slow Drive

<pool type='disk'>
  <name>Media1</name>
  <uuid>2c5a4e7b-6d61-9644-4162-c97cf11185e4</uuid>
  <capacity unit='bytes'>0</capacity>
  <allocation unit='bytes'>0</allocation>
  <available unit='bytes'>0</available>
  <source>
    <device path='/dev/disk/by-id/ata-ST3000DM001-9YN166_S1F0T0Q6'/>
    <format type='gpt'/>
  </source>
  <target>
    <path>/dev/disk/by-id</path>
    <permissions>
      <mode>0711</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>

Fast Drive

<pool type='disk'>
  <name>Backup</name>
  <uuid>b445343e-39e7-ff85-2c31-ba331ae10311</uuid>
  <capacity unit='bytes'>0</capacity>
  <allocation unit='bytes'>0</allocation>
  <available unit='bytes'>0</available>
  <source>
    <device path='/dev/disk/by-id/ata-TOSHIBA_DT01ACA300_Y3DBDBMGS'/>
    <format type='unknown'/>
  </source>
  <target>
    <path>/dev/disk/by-id</path>
    <permissions>
      <mode>0711</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>

Due to the quirky behaviour of virt-manager, It had seemingly recreated a nested GPT volume inside my pre-existing partition, and this abstraction was causing the performance issues.