Tag Archives: problems

Painful update of Dell R710 BIOS

As mentioned in the previous post, I recently acquired an R710 as part of a homelab buildout. I’ve now spent the best part of a day trying to figure out why the Lifecycle Controller stopped working, after it updated the BIOS. I don’t particularily need it, but I know if I ignore it something will come back to bite me when I least expect it.

The one clue (after trying multiple Repair images) was that when the BIOS was booting it had a blank rev. e.g. under the Dell logo there was “BIOS Rev. ” and a blank space. Much google-fu later and it turns out that this generally happens if you try and jump too many BIOS revisions at once.

Since the upgrade was done by the Lifecycle Controller, and was from 6.0.4 -> 6.4.0 I didn’t expect this to be an issue, but there you go. The process to recover is actually fairly straightforward when you know how, and in fairness to Dell they have a huge amount of great information in their forums.

This is just the short and quick version of how to fix.

  1. Create a DOS USB disk using the instructions here: https://www.dell.com/support/article/ie/en/iebsdt1/SLN143196/how-to-create-a-bootable-usb-flash-drive-using-dell-diagnostic-deployment-package–dddp-?lang=EN
  2. Download as many revisions of the BIOS between the original release and the target and copy them to the USB drive too from here – you want the non-packaged version.
    14/03/2017  22:24         1,631,701 R710-060007C.exe
    14/03/2017  22:23         1,633,695 R710-060100C.exe
    14/03/2017  22:23         1,650,371 R710-060203C.exe
    14/03/2017  22:24         1,650,583 R710-060300C.exe
    14/03/2017  22:22         1,653,153 R710-060400C.exe

    NOTE: You might want to rename them to fit in DOS’ 8.3 filename limitation unless you like to try and guess what the ~ are hiding

  3. Reboot the server and hit F2 to access the boot options, then choose to boot from the USB stick
  4. When it has loaded, start with the older of the BIOS versions – in my case 6.0.7. If you get a warning about the platform not being recognised add the /forcetype flag after the executable name
  5. Repeat until you are on the BIOS version you were aiming for

At this point the Lifecycle Controller should come up and you can use it for the remainder of your platform/firmware updates

Handling bad RAM in Linux

After some recent hardware upgrades, I was getting some strange crashes (different to the freeze that accompanies the intermittently-failing HDD that I’m trying to hunt down), specifically referring to Bad swap offsets and Bad page maps.

Given that I fired up memtest86+ and let it do it’s thing… and  it turns out that I have a few chunks of dodgy RAM. RMA time – though be sure to try swapping the RAM around and make sure the problem follows the stick and not the slot.!

Memtest86But to keep everything up and running in the meantime I decided to use memmap to block off that chunk of memory while linux is booting. To do this modify /etc/default/grub:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet memmap=1440M\\\$2048M"
GRUB_CMDLINE_LINUX=""

Basically what we are doing here is telling linux to block off 1440M of RAM, starting at 2048M. Then run sudo update-grub, reload and you will see your ‘free -m’ memory drop to about 6.5G.

This should tide you over, and prevent some random crashes until replacement RAM arrives

ZFS One Year On – First Repair

Having moved to ZFS after my little RAID/XFS problem last year, with weekly scrubs of the array, I’ve just had my first read error and repair. From the system log;

[1691578.161114] ata7.00: exception Emask 0x0 SAct 0x3 SErr 0x0 action 0x0
[1691578.161121] ata7.00: irq_stat 0x40000008
[1691578.161128] ata7.00: failed command: READ FPDMA QUEUED
[1691578.161138] ata7.00: cmd 60/b0:00:d8:c8:1b/00:00:66:00:00/40 tag 0 ncq 90112 in
[1691578.161140]          res 41/40:b0:e0:c8:1b/00:00:66:00:00/00 Emask 0x409 (media error) <F>
[1691578.161146] ata7.00: status: { DRDY ERR }
[1691578.161150] ata7.00: error: { UNC }
[1691578.162924] ata7.00: configured for UDMA/133
[1691578.162945] sd 6:0:0:0: [sdf] Unhandled sense code
[1691578.162949] sd 6:0:0:0: [sdf]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[1691578.162955] sd 6:0:0:0: [sdf]  Sense Key : Medium Error [current] [descriptor]
[1691578.162963] Descriptor sense data with sense descriptors (in hex):
[1691578.162967]         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
[1691578.162982]         66 1b c8 e0
[1691578.162989] sd 6:0:0:0: [sdf]  Add. Sense: Unrecovered read error - auto reallocate failed
[1691578.162998] sd 6:0:0:0: [sdf] CDB: Read(10): 28 00 66 1b c8 d8 00 00 b0 00
[1691578.163013] end_request: I/O error, dev sdf, sector 1713096928
[1691578.163040] ata7: EH complete

And looking at ZFS;

sudo zpool status
[sudo] password for :
pool: storage
state: ONLINE
scan: scrub repaired 88K in 11h7m with 0 errors on Sun May  1 12:37:48 2016
config:

NAME        STATE     READ WRITE CKSUM
storage     ONLINE       0     0     0
raidz1-0  ONLINE       0     0     0
sdf     ONLINE       0     0     0
sdc     ONLINE       0     0     0
sdh     ONLINE       0     0     0
sdj     ONLINE       0     0     0
raidz1-1  ONLINE       0     0     0
sdb     ONLINE       0     0     0
sdd     ONLINE       0     0     0
sdi     ONLINE       0     0     0
sdk     ONLINE       0     0     0

errors: No known data errors

Kind of wondering how much life that drive has left – should I replace now??

RAID-5 Horror Story – A tale of woe and notes on how to avoid a similar fate

As a starting point, since someone is sure to mention it, I KNOW THAT RAID IS NOT A BACKUP!!. On the other hand I’ve yet to meet someone who can tell me an affordable way to back up a 12TB array short of buying enough disks to clone it.

I’ve had a home-build linux md server for quite some time now. Brought the array online ~2011 and have grown it multiple times since then. It was at 7 x 2TB (apparently a bad idea all by itself, not that the software would warn you when you add the disk to the pool) disks and over the years had survived disk failures, power cuts while being grown, and 2 house moves.

Basic Setup

  • Linux MD disk array
  • 7 x 2TB 3.5″ SATA Disks
  • Whole disk (or array in this case) encryption (cryptsetup)
  • XFS Filesystem on top

Where it started to go wrong

It started, as these things usually do with an e-mail from my server, cheerfully informing me that one of the disks had died and that the raid array was degraded. Not really a problem as this had happened before without major drama.

  • Order a new disk
  • Figure out which one is /dev/sdf
    • hwinfo --disks helps a lot for this since it can get serial numbers
  • Shut the server down
  • Swap in the new disk
  • Add it to the array, and take things easy while it rebuilds (approx time required ~10 hours when disks are not being used)

And that was when I hit the dreaded Unrecoverable Read Error 🙁 Much has been written about this, but it was my first experience of it (and won’t forget it in a hurry).

[  772.229943] md: bind<sdh>
[  772.793789] RAID conf printout:
[  772.793794]  --- level:5 rd:7 wd:6
[  772.793798]  disk 0, o:1, dev:sdg
[  772.793802]  disk 1, o:1, dev:sdh
[  772.793805]  disk 2, o:1, dev:sdi
[  772.793809]  disk 3, o:1, dev:sdf
[  772.793812]  disk 4, o:1, dev:sdd
[  772.793816]  disk 5, o:1, dev:sdb
[  772.793819]  disk 6, o:1, dev:sda
[  772.794310] md: recovery of RAID array md0
[  772.794316] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
[  772.794368] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for recovery.
[  772.794378] md: using 128k window, over a total of 1953514496k.
...
[35295.808096] ata9.00: exception Emask 0x0 SAct 0x7fffffff SErr 0x0 action 0x6 frozen
[35295.808105] ata9.00: failed command: READ FPDMA QUEUED
[35295.808116] ata9.00: cmd 60/08:00:20:01:ce/00:00:ab:00:00/40 tag 0 ncq 4096 in
[35295.808118]          res 40/00:01:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
[35295.808124] ata9.00: status: { DRDY }
[35397.139031] sd 8:0:0:0: [sdf]  Add. Sense: Unrecovered read error - auto reallocate failed
[35397.139041] sd 8:0:0:0: [sdf] CDB: Read(10): 28 00 ab cd f8 58 00 03 08 00
[35397.139057] end_request: I/O error, dev sdf, sector 2882403160
[35397.139066] md/raid:md0: read error not correctable (sector 2882403160 on sdf).
[35397.139073] md/raid:md0: Disk failure on sdf, disabling device.
[35397.139075] md/raid:md0: Operation continuing on 5 devices.
[35397.139116] ata9: EH complete
[35397.708320] md: md0: recovery done.
[35397.822385] RAID conf printout:
[35397.822391]  --- level:5 rd:7 wd:5
[35397.822397]  disk 0, o:1, dev:sdg
[35397.822401]  disk 1, o:1, dev:sdh
[35397.822405]  disk 2, o:1, dev:sdi
[35397.822409]  disk 3, o:0, dev:sdf
[35397.822412]  disk 4, o:1, dev:sdd
[35397.822416]  disk 5, o:1, dev:sdb
[35397.822419]  disk 6, o:1, dev:sda
[35397.824183] RAID conf printout:
[35397.824188]  --- level:5 rd:7 wd:5
[35397.824191]  disk 0, o:1, dev:sdg
[35397.824195]  disk 2, o:1, dev:sdi
[35397.824198]  disk 3, o:0, dev:sdf
[35397.824201]  disk 4, o:1, dev:sdd
[35397.824205]  disk 5, o:1, dev:sdb
[35397.824208]  disk 6, o:1, dev:sda
[35397.824218] RAID conf printout:
[35397.824221]  --- level:5 rd:7 wd:5
[35397.824224]  disk 0, o:1, dev:sdg
[35397.824228]  disk 2, o:1, dev:sdi
[35397.824231]  disk 3, o:0, dev:sdf
[35397.824234]  disk 4, o:1, dev:sdd
[35397.824237]  disk 5, o:1, dev:sdb
[35397.824240]  disk 6, o:1, dev:sda
[35397.824380] RAID conf printout:
[35397.824386]  --- level:5 rd:7 wd:5
[35397.824390]  disk 0, o:1, dev:sdg
[35397.824394]  disk 2, o:1, dev:sdi
[35397.824398]  disk 4, o:1, dev:sdd
[35397.824401]  disk 5, o:1, dev:sdb
[35397.824404]  disk 6, o:1, dev:sda

At which point the array is basically dead. Which seems a bit insane – read error in one sector makes 12TB of data unavailable but there you go. We apparently can’t mount, rebuild or do anything – bear in mind that at this point all our data is still intact, except for that one dodgy sector. Looking at the raid array in more detail (it is a mess):

[~]=> sudo mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Mon May 16 22:34:59 2011
     Raid Level : raid5
  Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)
   Raid Devices : 7
  Total Devices : 5
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Wed Apr 29 12:28:08 2015
          State : active, FAILED, Not Started 
 Active Devices : 4
Working Devices : 5
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : 4a3bba9b:8299bd9b:3cb2199d:f2060f75
         Events : 0.1434672

    Number   Major   Minor   RaidDevice State
       0       8       96        0      active sync   /dev/sdg
       1       0        0        1      removed
       2       8      128        2      active sync   /dev/sdi
       3       0        0        3      removed
       4       8       48        4      active sync   /dev/sdd
       5       8       16        5      active sync   /dev/sdb
       6       0        0        6      removed

       7       8      112        -      spare   /dev/sdh

Pay close attention to the metadata version – this is where I went horribly wrong (more on that later). From the list of disks we have /dev/sdf removed automatically due to the read error and /dev/sdh in as a spare since it was in the process of being synced when everything went pear shaped.

Steps to recovery

At this point I was quite annoyed and a bit desperate so I concocted a plan that would have worked, but for one mistake. My plan was simple

  1. Remove /dev/sdh from the md0 set – it’s basically useless now anyway
  2. Get /dev/sdf back in by recreating the array
  3. Run XFS checks on the file system to be sure that is ok
  4. Use gddrescue to clone the slightly dodgy /dev/sdf to /dev/sdh – with multiple retries to try and get the problem sector
  5. Reassemble the array using /dev/sdh rather then /dev/sdf
  6. Buy another new disk and slot it in and hope the rebuild works this time
  7. Low level format /dev/sdf to get the sector marked as bad. If that fails, bin it.
  8. Convert to RAID-6 so this can’t happen again

Step 1 went as expected:

[~]=> sudo mdadm --remove /dev/md0 /dev/sdh
mdadm: hot removed /dev/sdh from /dev/md0
[~]=> sudo mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Mon May 16 22:34:59 2011
     Raid Level : raid5
  Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)
   Raid Devices : 7
  Total Devices : 5
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Wed Apr 29 12:41:58 2015
          State : active, FAILED, Not Started 
 Active Devices : 5
Working Devices : 5
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : 4a3bba9b:8299bd9b:3cb2199d:f2060f75
         Events : 0.1434673

    Number   Major   Minor   RaidDevice State
       0       8       96        0      active sync   /dev/sdg
       1       0        0        1      removed
       2       8      128        2      active sync   /dev/sdi
       3       8       80        3      removed
       4       8       48        4      active sync   /dev/sdd
       5       8       16        5      active sync   /dev/sdb
       6       8        0        6      active sync   /dev/sda

So I decided to re-create the array rather then re-assemble (with assume-clean), and here I went very wrong. I didn’t specify the metadata version.

MD RAID Metadata Versions

It used to be the default format of raid superblock during array creation on most distributions until 2009, the older version-0.90 superblock format had several limitations that limited its applicability for use on large arrays or arrays with many component devices.

The version-0.90 superblock limits the number of component devices within an array to 28, and limits each component device to a maximum size of 2TB on kernel version <3.1 and 4TB on kernel version >=3.1.

The superblock is 4K long and is written into a 64K aligned block that starts at least 64K and less than 128K from the end of the device (i.e. to get the address of the superblock round the size of the device down to a multiple of 64K and then subtract 64K). The available size of each device is the amount of space before the super block, so between 64K and 128K is lost when a device in incorporated into an MD array.

Also, and this is important – it is stored at the end of the device. If you want mdadm to use this you have to specify –metadata=0.9

The shiny new (and now the default) is version 1.2 which grabs 4K from the beginning of the device, and while doing so torches the XFS superblock.

XFS Gone

When I realised my mistake, got the drives into a sort of working order, and mounted, I was presented with

[~]=> sudo mount /dev/mapper/storage /mnt/storage
mount: /dev/mapper/storage: can't read superblock

From our message log

[ 1337.665651] SGI XFS with ACLs, security attributes, realtime, large block/inode numbers, no debug enabled
[ 1337.666154] SGI XFS Quota Management subsystem
[ 1337.666931] XFS (dm-3): Mounting Filesystem
[ 1339.452417] XFS (dm-3): Log inconsistent (didn't find previous header)
[ 1339.452441] XFS (dm-3): failed to find log head
[ 1339.452447] XFS (dm-3): log mount/recovery failed: error 5
[ 1339.452524] XFS (dm-3): log mount failed

xfs_repair, after throwing around many dots seemed to be completely unhappy with any of the secondary superblocks, and UFS Recover could only re-assemble some bits and pieces.

And that was the end of that.

Lessons learned

  • Never more the 4 devices in RAID-5
  • Always make a backup
  • Be very very careful when trying to repair
  • For tools that have been in service for longer then a few months, be very very careful. Some idiot developer has probably changed the defaults in a way that will screw you

The Day My Nexus 5 Died

Today was not a good day. Woke up with my Nexus 5 stuck on the ‘Google’ boot screen. I had been seeing some stability issues lately (apps freezing, occasional reboot) but was planning on re-installing in order to go to 5.0.1 anyway when disaster struck.

Troubleshooting

After a great deal of rebooting and playing I got to the loading screen (spinning coloured dots). And there it stayed. Concluding that something had gone seriously wrong I decided to do an re-install of the factory image.

flashboot flash boot boot.img
sending 'bootloader' (2579 KB)...
OKAY [  0.294s]
writing 'bootloader'...
FAILED (remote: flash write failure)

Somewhat concerned at this point I tried different machines, cables, etc. but it seemed that flashboot was unable to write anything to any of the partitions:

Colin:hammerhead-lrx22c colinmacgiollaeain$ sudo fastboot flash bootloader bootloader-hammerhead-hhz12d.img
target reported max download size of 1073741824 bytes
sending 'bootloader' (2579 KB)...
OKAY [  0.296s]
writing 'bootloader'...
FAILED (remote: flash write failure)
finished. total time: 0.476s
Colin:hammerhead-lrx22c colinmacgiollaeain$ fastboot erase boot
erasing 'boot'...
FAILED (remote: failed to erase partition)
finished. total time: 0.218s
Colin:hammerhead-lrx22c colinmacgiollaeain$ fastboot erase cache
******** Did you mean to fastboot format this partition?
erasing 'cache'...
FAILED (remote: failed to erase partition)
finished. total time: 0.217s
Colin:hammerhead-lrx22c colinmacgiollaeain$ fastboot erase recovery
erasing 'recovery'...
FAILED (remote: failed to erase partition)
finished. total time: 0.215s
Colin:hammerhead-lrx22c colinmacgiollaeain$ fastboot erase system
******** Did you mean to fastboot format this partition?
erasing 'system'...
FAILED (remote: failed to erase partition)
finished. total time: 0.212s
...
target reported max download size of 1073741824 bytes
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
archive does not contain 'vendor.img'
Creating filesystem with parameters:
Size: 29236371456
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 7137786
Block groups: 218
Reserved block group size: 1024
Created filesystem with 11/1785856 inodes and 156120/7137786 block
Cannot read image.

At this point I was going with the working assumption that the NAND was dead or at least not writable any more. To confirm I did an OEM lock (it was unlocked) and rebooted. The little padlock icon remained unlocked.

Google Support

At this point I dug out my receipts and was relieved to see that the device (purchased through Google Play) was under 1 year old, so a warranty replacement is still an option. Going to the appropriate place in Play Support raised a second issue – I have no other phone, and they want a call back number. Something of a gap there I think…

Eventually I found a list of actual phone numbers for Google Play Support, that let you talk to an actual human being! There I hit problem #2.

For Ireland there is a 1800 freephone number (and no other number listed). This is a big problem as all office phones are routed through the US and Skype doesn’t support Irish freephone numbers. Why can’t I dial freephone numbers internationally e.g. +353 1800 ### ###? Because of an idiotic decision, the freephone numbers start with ‘1’, as does Dublin when dialing internationally (01-### #### -> +353 1 ### ###) and the B-number analysis will attempt to connect you to a random number in Dublin.

Fortunately, Skype does allow you to dial freephone numbers in the UK, so that’s what I did. Note: you will need either the IMEI (printed on a sticker on the back of the phone) or the original order number (very long number) for support to find your phone. The serial number won’t work. After describing my issue (and I’m sure blowing the support script out of the water) it was agreed that my issue sounded like a hardware fault, and so an advanced replacement would be in order.

The advanced replacement works like this:

  • You receive a time limited (24 hours) link to the Google Play store
  • On clicking the link, it is like buying a device – you fill in the credit card information (just an authorisation), shipping information, etc. and the order is processed
  • Once you receive the refurbished (no new phones anymore, you get a refurbished “like-new” device) you have 7 days to return the defective phone (free shipping).
  • When it reaches the depot the authorisation on the credit card will be removed (assuming the phone actually had a hardware fault)

/etc/hosts and Signalware – DFdaemon issues

While doing an install of Signalware’s SIGTRAN stack (SignalWare 9.0 SP6) I had big problems getting it to actually work. The menu install process ran as expected, but the node wasn’t commissioned and therefore the go.omni process wouldn’t start, as the DFconvert step was failing.

It turns out the root cause was a problem with DFdaemon (this is a service that has something to do with maintaining the file system used by Ulticom). The service was running, but when I tried DFdaemon_status it was timing out.

Eventually killed off the service (init kept restarting it) by commenting out the contents of the init file and kill -15 1 a few times, and ran it manually in debug mode:

root@server init]# DFdaemon -d
16:49:11  0 DFdaemon::main           : using port 10600
16:49:11  0 Platform                 : ************* CE_c *************
Name:   server
mCeIndex:       0
mLanCount:      0
Current LAN index:      0
Current status: DOWN
Synchronization status: SYNC_REQD
Pending status request list:
EMPTY

oluCEList:      8
OluCe 0:
OluCe 0:
OluCe 0:
OluCe 0:
OluCe 0:
OluCe 0:
OluCe 0:
OluCe 0:
-------------

16:49:11  0 MessageQueue::MessageQue :
16:49:11  0 MessageQueue::MessageQue :
16:49:11  0 UDPmsgQueue_c::UDPmsgQue : Recv buffer : 524288
16:49:11  0 UDPmsgQueue_c::UDPmsgQue : Send buffer : 524288
16:49:11  0 UDPmsgQueue_c::UDPmsgQue : Send buffer : 524288
16:49:11  0 DFfileList_c::initEntrie : reach the end of /opt/apps/ulcm/sls0479/dffile

16:49:11  0 UDPmsgQueue_c::startComm :
16:49:11  0 UDPmsgQueue_c::MessageQu : begin thread
16:49:11  0 global                   : DFdaemon started
16:49:11  0 DFtaskQueue_c::main      : begin thread
16:49:11  0 UDPmsgQueue_c::MessageQu : begin thread
16:49:11  0 SDFS::main               : begin thread
16:49:11  0 DFfileList_c::main       : begin thread
16:49:11  0 HealthCheck::main        : begin thread
16:49:11  0 HealthCheck::main        : wakeup before sleep
16:49:11  0 SDFS::main               : wakeup before sleep(1000)
16:49:11  0 HealthCheck::main        : wakeup after sleep
16:49:11  0 HealthCheck::main        : wakeup before sleep
16:49:12  0 SDFS::main               : wakeup after sleep
16:49:12  0 HealthCheck::main        : wakeup after sleep
16:49:12  0 HealthCheck::main        : wakeup before sleep
16:49:12  0 SDFS::main               : wakeup before sleep(1000)
16:49:12  0 HealthCheck::main        : wakeup after sleep
16:49:12  0 HealthCheck::main        : wakeup before sleep
16:49:13  0 HealthCheck::main        : wakeup after sleep
16:49:13  0 HealthCheck::main        : wakeup before sleep
16:49:13  0 SDFS::main               : wakeup after sleep
16:49:13  0 SDFS::main               : wakeup before sleep(1000)
16:49:13  0 HealthCheck::main        : wakeup after sleep
...
16:49:40  0 HealthCheck::main        : wakeup after sleep
16:49:40  0 HealthCheck::main        : wakeup before sleep
16:49:40  0 SDFS::main               : wakeup after sleep
16:49:40  0 SDFS::main               : wakeup before sleep(1000)
16:49:40  0 UDPmsgQueue_c::MessageQu : Received message from unknown sender, IP address: ::ffff:127.0.0.1    <<---- DFdaemon_status
16:49:40  0 HealthCheck::main        : wakeup after sleep
16:49:40  0 HealthCheck::main        : wakeup before sleep
16:49:41  0 HealthCheck::main        : wakeup after sleep
16:49:41  0 HealthCheck::main        : wakeup before sleep
16:49:41  0 SDFS::main               : wakeup after sleep
16:49:41  0 SDFS::main               : wakeup before sleep(1000)
16:49:41  0 HealthCheck::main        : wakeup after sleep
16:49:41  0 HealthCheck::main        : wakeup before sleep

It seems that for some reason the localhost entry for IPv6 was causing a problem. The entry that was part of the server build looked like this:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost

It should be like this:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

With that DFconvert ran and the rest of the process was fine.

Internet Access in Awkward Places

Finally got around to putting up a description of a project I’ve been poking along for a while to put Internet access and a remotely accessible security camera in the parents holiday home (ld building, thick walls and no wireline connectivity) – all the hardware used and details on the build are available here.

Contrail Setup – vRouter Provisioning Failure on new install

The importance of basic system configuration

As there is a tendency to happen, my contrail lab got completely hosed by someone (shared accounts are going to be disabled going forward!) and I decided to take advantage and rebuild it using separate admin and control/traffic interfaces – closer to production type environment. This also had the benefit that I could connect to the lab MX router and therefore have ‘public’ routable addresses.

Imagine my surprise when a completely clean install failed 🙁 This was especially surprising since the procedure hand worked before. Having spend a day pounding my head against the wall and blaming everything from VMware, to typos in the testbed.py file, to Gremlins, I found the problem.

Target Setup

The desired setup is as follows:
Controller node – running config management, analytics, control, etc.
Admin IP: a.b.c.230
Control/Dataplane: x.y.z.230

2 x Compute Hosts – running nova-compute and vRouter
Admin IP: a.b.c.231 – 232
Control/Dataplane: x.y.z.231 – 232

Problem – vRouter Provisioning Stalls/Fails

During the fab setup_all the setup process was stalling at the point when it was adding the vRouter (compute host). Even left overnight, this failed to progress.

[[email protected]] out: [localhost] local: ifconfig p2p2p0 | grep mtu | awk '{ print $NF }'
[[email protected]] out: [localhost] local: ifconfig p2p2p0 | grep MTU | sed 's/.*MTU.\([0-9]\+\).*/\1/g'
[[email protected]] out: [localhost] local: sudo mv /tmp/tmpG4fUw3/ifcfg-vhost0 /etc/sysconfig/network-scripts/ifcfg-vhost0
[[email protected]] out: [localhost] local: sudo cp /etc/sysconfig/network-scripts/ifcfg-p2p2p0 /etc/sysconfig/network-scripts/ifcfg-p2p2p0.rpmsave
[[email protected]] out: [localhost] local: sudo mv /tmp/tmpG4fUw3/ifcfg-p2p2p0 /etc/contrail/
[[email protected]] out: [localhost] local: sudo chkconfig network on
[[email protected]] out: [localhost] local: sudo chkconfig supervisor-vrouter on
[[email protected]] out: [[email protected]] run: source /opt/contrail/api-venv/bin/activate && python /opt/contrail/utils/provision_vrouter.py --host_name compute-1.lab.flat-planet.net --host_ip x.y.z.231 --api_server_ip x.y.z.230 --oper add --admin_user admin --admin_password secret123 --admin_tenant_name admin
[[email protected]] out: [[email protected]] out:
[[email protected]] out: [[email protected]] out:
[[email protected]] out: [[email protected]] out:

Looking through the contents of /var/log/contrail/ I saw that the Query Engine was reporting issues:

[root@contrail-controller contrail]# cat /var/log/contrail/qe.log
Pre exec cmd:/usr/bin/contrail_qe_pre
log4cplus:ERROR No appenders could be found for logger (root).
log4cplus:ERROR Please initialize the log4cplus system properly.
2014-03-13 Thu 16:55:22:109.910 GMT contrail-controller.lab.flat-planet.net [Thread 47816409982496, Pid 9400]: http-server-port 8091
2014-03-13 Thu 16:55:22:110.018 GMT contrail-controller.lab.flat-planet.net [Thread 47816409982496, Pid 9400]: Endpoint 0.0.0.0:0
2014-03-13 Thu 16:55:22:110.034 GMT contrail-controller.lab.flat-planet.net [Thread 47816409982496, Pid 9400]: Collectors 1
2014-03-13 Thu 16:55:22:110.051 GMT contrail-controller.lab.flat-planet.net [Thread 47816409982496, Pid 9400]: SANDESH: ROLE   : Generator
2014-03-13 Thu 16:55:22:110.063 GMT contrail-controller.lab.flat-planet.net [Thread 47816409982496, Pid 9400]: SANDESH: MODULE : QueryEngine
...
2014-03-13 Thu 16:55:22:113.246 GMT contrail-controller.lab.flat-planet.net [Thread 47816409982496, Pid 9400]: Db_Init: TTransportException what: connect() failed: Connection refused
Thrift: Thu Mar 13 16:55:22 2014 TSocket::open() connect() <Host: x.y.z.230 Port: 9160>Connection refused
2014-03-13 Thu 16:55:22:113.353 GMT contrail-controller.lab.flat-planet.net [Thread 47816409982496, Pid 9400]: Sandesh: Send: FAILED: 2014-Mar-13 16:55:22.113282 QeInit [SYS_WARN]: QELog: initialization of database failed. retrying 0 time src/query_engine/query.cc 1048
2014-03-13 Thu 16:55:27:113.648 GMT contrail-controller.lab.flat-planet.net [Thread 47816409982496, Pid 9400]: Db_Init: TTransportException what: connect() failed: Connection refused
Thrift: Thu Mar 13 16:55:27 2014 TSocket::open() connect() <Host: x.y.z.230 Port: 9160>Connection refused

Port 9160 is where our contrail-database (cassandra) lives – so the problem is that the provisioning script cannot connect to the system database in order to complete the provisioning.

[root@contrail-controller utils]# service contrail-database status
contrail-database                FATAL      Exited too quickly (process log may have details)
[root@contrail-controller utils]# service contrail-database start
contrail-database: ERROR (abnormal termination)
[root@contrail-controller utils]#

The problem here is that the process dies before logging any errors so at this point I have no clue as to why this is happening. Fortunately there was an already running system elsewhere (can also be found if you retained your console logs for the install) so I could get the exact command used to fire up the DB and see where it is going wrong.

[root@contrail-controller cassandra]# java -ea -javaagent:/usr/share/cassandra/lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms8192M -Xmx8192M -Xmn2048M -XX:+HeapDumpOnOutOfMemoryError -Xss180k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:+PrintPromotionFailure -XX:PrintFLSStatistics=1 -Xloggc:/var/log/cassandra/gc-1393935278.log -Djava.net.preferIPv4Stack=true -Dcom.sun.management.jmxremote.port=7199 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dlog4j.configuration=log4j-server.properties -Dlog4j.defaultInitOverride=true -Dcassandra-foreground=yes -cp /etc/cassandra/conf:/usr/share/java/jna.jar:/usr/share/cassandra/lib/antlr-3.2.jar:/usr/share/cassandra/lib/apache-cassandra-1.2.11.jar:/usr/share/cassandra/lib/apache-cassandra-clientutil-1.2.11.jar:/usr/share/cassandra/lib/apache-cassandra-thrift-1.2.11.jar:/usr/share/cassandra/lib/avro-1.4.0-fixes.jar:/usr/share/cassandra/lib/avro-1.4.0-sources-fixes.jar:/usr/share/cassandra/lib/commons-cli-1.1.jar:/usr/share/cassandra/lib/commons-codec-1.2.jar:/usr/share/cassandra/lib/commons-lang-2.6.jar:/usr/share/cassandra/lib/compress-lzf-0.8.4.jar:/usr/share/cassandra/lib/concurrentlinkedhashmap-lru-1.3.jar:/usr/share/cassandra/lib/guava-13.0.1.jar:/usr/share/cassandra/lib/high-scale-lib-1.1.2.jar:/usr/share/cassandra/lib/jackson-core-asl-1.9.2.jar:/usr/share/cassandra/lib/jackson-mapper-asl-1.9.2.jar:/usr/share/cassandra/lib/jamm-0.2.5.jar:/usr/share/cassandra/lib/jbcrypt-0.3m.jar:/usr/share/cassandra/lib/jline-1.0.jar:/usr/share/cassandra/lib/json-simple-1.1.jar:/usr/share/cassandra/lib/libthrift-0.7.0.jar:/usr/share/cassandra/lib/log4j-1.2.16.jar:/usr/share/cassandra/lib/lz4-1.1.0.jar:/usr/share/cassandra/lib/metrics-core-2.2.0.jar:/usr/share/cassandra/lib/netty-3.6.6.Final.jar:/usr/share/cassandra/lib/servlet-api-2.5-20081211.jar:/usr/share/cassandra/lib/slf4j-api-1.7.2.jar:/usr/share/cassandra/lib/slf4j-log4j12-1.7.2.jar:/usr/share/cassandra/lib/snakeyaml-1.6.jar:/usr/share/cassandra/lib/snappy-java-1.0.5.jar:/usr/share/cassandra/lib/snaptree-0.1.jar:/usr/share/cassandra/lib/stress.jar org.apache.cassandra.service.CassandraDaemon
Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: contrail-controller.lab.flat-planet.net: contrail-controller.lab.flat-planet.net

Turns out that when cassandra is being fired up, it uses the FQDN rather then an IP address when binding to the network socket, and of course I didn’t have the FQDN in /etc/hosts or in the nameserver. Quick edit later:

[root@contrail-controller cassandra]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
x.y.z.230 contrail-controller.lab.flat-planet.net

And we are in business

[root@contrail-controller cassandra]# service contrail-database start
contrail-database: started

[root@contrail-controller cassandra]# contrail-status
vRouter is NOT PRESENT
vRouter agent is NOT PRESENT
== Contrail Control ==
supervisor-control:           active
contrail-control              active
contrail-control-nodemgr      active
supervisor-dns:               active
contrail-dns                  active
contrail-named                active
== Contrail Analytics ==
supervisor-analytics:         active
contrail-analytics-nodemgr    active
contrail-collector            active
contrail-opserver             active
contrail-qe                   active
redis-query                   active
redis-sentinel                active
redis-uve                     active
== Contrail Config ==
supervisor-config:            active
contrail-api:0                active
contrail-config-nodemgr       active
contrail-discovery:0          active
contrail-schema               active
contrail-svc-monitor          active
contrail-zookeeper            active
ifmap                         active
redis-config                  active
== Contrail Web UI ==
supervisor-webui:             active
contrail-webui                active
contrail-webui-middleware     active
redis-webui                   active
== Contrail Database ==
supervisord-contrail-database:active
contrail-database             active

Run the fab setup_all command again and everything provisions as it should and we have a working contrail cluster. My testbed.py file is available here as a reference.

Multiple interfaces in CentOS

I had an issue with CentOS6.4 – two network interfaces were configured eth0 - 10.x.y.z and eth1 - 192.168.x.y. eth0 is being used for SSH access, but as soon as eth1 was brought up the node became unreachable from anything except the local subnet.

Source was 10.x.y.230 and they are on the same switch:

[root@controller etc]# ping 10.x.y.234
PING 10.3.8.234 (10.x.y.234) 56(84) bytes of data.
64 bytes from 10.x.y.234: icmp_seq=1 ttl=64 time=1.33 ms
64 bytes from 10.x.y.234: icmp_seq=2 ttl=64 time=0.298 ms
64 bytes from 10.x.y.234: icmp_seq=3 ttl=64 time=0.277 ms
64 bytes from 10.x.y.234: icmp_seq=4 ttl=64 time=0.270 ms

But ping from any other subnet and nothing… Turns out that you have to be very specific when configuring the default gateway in /etc/sysconfig/network. It seems that both the default gateway and the gateway interface are required, to get the route added properly.

[root@node-2 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=node-2.fqdn.net
GATEWAY=10.x.y.1
GATEWAYDEV=eth0

And now our route is correctly added

[root@node-2 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.x.y.0        *               255.255.255.0   U     0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
link-local      *               255.255.0.0     U     1002   0        0 eth0
link-local      *               255.255.0.0     U     1003   0        0 eth1
default         10.x.y.1        0.0.0.0         UG    0      0        0 eth0