Swappiness in Ubuntu 15.04

You can often get a performance boost from your Ubuntu system by swapping out physical memory to disk (swap partition) less.

Ubuntu seems to have a default “Swappiness” level of 60.

Try dropping this to 20 or even 10

sudo -s
vi /etc/sysctl.conf

Add to the very bottom of this file:

vm.swappiness=20
:wq
reboot

After reboot
cat /proc/sys/vm/swappiness to make sure the new value took effect.

There is an official page that covers this all in excruciating detail but the above is the gist of of it.

Gradle 2.5 — with WildFly 9.0.0.Final and IntelliJ 14

In my current project I’m using IntelliJ, Gradle and WildFly. I’m relatively new to each of these products only having used each of them for a couple of months. But, as the project is still Java EE 7 the learning curve is more with the tools and application server than with the standard.

Now that I’ve had a little cockpit time I’m quite comfortable with WildFly and getting more comfortable with Gradle all the time. I will admit it’s taken me a while but I’m finally starting to get used to the jump from Maven and (my beloved) Ant.

IntelliJ is quite good but I think NetBeans is still my first choice. I’ve done a lot of coding on NetBeans using GlassFish and they are a solid combination. While there are plugins I would very much like to see Gradle become more highly integrated into NetBeans.

So, in the hope of helping someone else get started I’m laying out 3 items in this post.

1. The directory structure for my project (pretty standard but maybe not obvious to new users)
2. My gradle.properties file just for the heck of it
3. Key parts of my build.gradle file

My development environment is Kubuntu Linux 15.04, Java 8, Git 2.1.4, Gradle 2.5, IntelliJ 14 & Wildfly-9.0.0.Final

I do not use a gradle wrapper. Though, I do see where a gradle wrapper would be a benefit. IntelliJ does an amazing job of importing and syncing with Gradle!! A big plus making the wrapper even less important.


(1)
The directory structure for my project is a pretty standard and is probably familiar to those of you that use Maven.

Gradle seems to be comfortable with the Maven standard layout:

myProject
    build.gradle
    gradle.properties
    --src
        --java
            --com.whatever
            --com.whatever.constant
            --com.whatever.converter
            --com.whatever.jpa
            --com.whatever.ejb
            --com.whatever.rest
            --com.whatever.security
            --com.whatever.ui
            --com.whatever.validator
            --com.whatever.webapp (Backing Beans for JSF and stuff)
        --resources
            touch.txt (just an empty file so git doesn't delete my empty folder)
        --sql
        --webapp
            --folder1 (JSF)
            --folder2 (More JSF)
            --WEB-INF
                beans.xml
                ejb-jar.xml
                faces-config.xml
                jboss-web.xml
                web.xml
                --classes
                    --META-INF
                        persistence.xml
                --facelets
                        faceletsTemplate1.xhtml
                        faceletsTemplate2.xhtml
                --lib
                    touch.txt
        --notes (I keep my notes and snippets of code here)
        --test
            --java
                --com.whatever
            --resources
                touch.txt (just an empty file so git doesn't delete my empty folder)


(2)
I don't use any of Gradle's advanced features. If my dev machine was a bit slower I probably would. Even without the 'daemon' and 'parallel' features it's pretty darn fast. Just set those two options to 'true' if you want to try them out.

My gradle.properties file:
# For more details on how to configure your build environment visit
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=false
org.gradle.parallel=false


(3)
My gradle.build file:

// Add some plugins

// I use cargo to deploy to my local install of WildFly
plugins {
id "com.bmuschko.cargo" version "2.0.3"
id "com.bmuschko.cargo-base" version "2.0.3"
}

// Gotta have these two as this is a Java EE Web Archive project
apply plugin: 'java'
apply plugin: 'war'

// I setup all the versions for my libraries I'm going to use
// LibraryVersions
project.ext.wildflyVersion = "9.0.0.Final"
project.ext.primefacesVersion = "5.2"
project.ext.primefacesThemeVersion = "1.0.10"
project.ext.apachePoiVersion = "3.11"
project.ext.romeVersion = "1.0"
project.ext.apacheCommonsFileUploadVersion = "1.3.1"
project.ext.apacheCommonsIoVersion = "2.4"
project.ext.atmosphereVersion = "2.3.0-RC6"
project.ext.itextVersion = "2.1.7"
project.ext.qrgenVersion = "1.4"
project.ext.barcode4jLightVersion = "2.0"
project.ext.fontAwesomeVersion = "4.3.0-1"
project.ext.junitVersion = "4.12"
project.ext.arquillianVersion = "1.1.8.Final"
project.ext.wildflyArquillianContainerRemoteVersion = "1.0.0.Final"
project.ext.shrinkWrapResolverGradleVersion = "2.2.0-beta-1"

// What I want gradle to do by default when I issue the 'gradle' command with no options
defaultTasks 'clean', 'test', 'build', 'deployToTestServer'

// Some info about the project
// Might use as vars later
description = 'Web Project'
version = '1.0'
String appName = 'myProject'
String vendor = 'My Company, Inc.'

// Let Gradle know I'm using JDK 8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

// It's good to have several repositories

repositories {

jcenter()
mavenCentral()

maven {
name "Gradle Repository"
url "https://plugins.gradle.org/m2/"
}

maven {
name "JBoss Public Maven Repository Group"
url "https://repository.jboss.org/nexus/content/groups/public-jboss/"
}

maven {
name "Unofficial PrimeFaces Maven Repository"
url "http://primefaces.github.io/repository"
}

maven {
name "Unofficial PrimeFaces Maven Repository"
url "http://unofaces.github.io/repository"
}

maven {
name "PrimeFaces Repository"
url "http://repository.primefaces.org"
}
}

// Setup Project dependencies
// Notice that my org.wildfly dependencies are 'providedCompile' as I use the Full version of
// Wildfly-9.0.0.Final which seems to include everything plus the kitchen sink
// There is lot's of good stuff in wildfly-feature-pack
dependencies {

// Commons
compile findProject(':aui-common')

// Cargo Plugin Dependencies
cargo "org.codehaus.cargo:cargo-ant:${cargoVersion}"
cargo "org.codehaus.cargo:cargo-core-uberjar:${cargoVersion}"
cargo "org.codehaus.cargo:cargo-core-container-wildfly:${cargoVersion}"
cargo 'org.wildfly:wildfly-controller-client:8.2.0.Final'

// WildFly Components
providedCompile "org.wildfly:wildfly-spec-api:${wildflyVersion}"
providedCompile "org.wildfly:wildfly-feature-pack:${wildflyVersion}"

// PrimeFaces Core and Themes
compile "org.primefaces:primefaces:${primefacesVersion}"
compile "org.primefaces.themes:home:${primefacesThemeVersion}"
// PrimeFaces Dependencies -- Apache POI
compile "org.apache.poi:poi:${apachePoiVersion}"
// PrimeFaces Dependencies -- Other
compile "rome:rome:${romeVersion}"
compile "commons-fileupload:commons-fileupload:${apacheCommonsFileUploadVersion}"
compile "commons-io:commons-io:${apacheCommonsIoVersion}"
compile "org.atmosphere:atmosphere-runtime:${atmosphereVersion}"
compile "com.lowagie:itext-rups:${itextVersion}"
compile "net.glxn:qrgen:${qrgenVersion}"
compile "net.sf.barcode4j:barcode4j-light:${barcode4jLightVersion}"
compile "org.webjars:font-awesome:${fontAwesomeVersion}"

// Unit Testing
testCompile "junit:junit:${junitVersion}"
// Unit Testing Arquillian
//testCompile "org.jboss.arquillian.junit:arquillian-junit-container:${arquillianVersion}"
//testCompile "org.jboss.arquillian.protocol:arquillian-protocol-servlet:${arquillianVersion}"
//testCompile "org.wildfly.arquillian:wildfly-arquillian-container-remote:${wildflyArquillianContainerRemoteVersion}"
//testCompile "org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-gradle-depchain:${shrinkWrapResolverGradleVersion}"

}

//#####################################################################################################################
//################################# Package Web App ##################################################################
//#####################################################################################################################
war {

archiveName = project.name + ".war"

manifest {
attributes("Manifest-Version": version,
"Created-By": vendor,
"Specification-Title": appName,
"Specification-Version": version,
"Specification-Vendor": vendor,
"Implementation-Title": appName,
"Implementation-Version": version,
"Implementation-Vendor": vendor
//"Main-Class" : "com.whatever.HelloWorld",
//"Class-Path" : configurations.compile.collect { it.getName() }.join(' ')
)
}
}

//#####################################################################################################################
//################################# Determine Environment #############################################################
//#####################################################################################################################
String myWorkstation = 'actualNameOfDevelopmentMyWorkstation'
def String buildHostname
def String buildUser
task determineEnv << {
println("The name of myWorkstation' host is " + myWorkstation)
buildHostname = InetAddress.getLocalHost().getHostName().toLowerCase().trim()
println('The name of this build host is ' + buildHostname)
buildUser = System.getProperty("user.name").toLowerCase().trim()
println('The name of this build user is ' + buildUser)
}

//#####################################################################################################################
//################################# Deploy WAR to WildFly #############################################################
//#####################################################################################################################
// http://cargo.codehaus.org/Home

cargo {
containerId = 'wildfly8x' // I know I'm using 9 but haven't seen this updated yet by cargo project
port = 9990

remote {
hostname = 'localhost'
username = 'wildfly' // Use your WildFly admin username
password = 'wildfly' // Use your Wildfly admin password
}
}

task deployToTestServer(type: com.bmuschko.gradle.cargo.tasks.remote.CargoRedeployRemote, dependsOn: ['determineEnv', 'war']) {
println('deployToTestServer')
containerId = 'wildfly8x' // I know I'm using 9 but haven't seen this updated yet by cargo project
port = 9990
hostname = 'localhost'
username = 'wildfly' // Use your WildFly admin username
password = 'wildfly' // Use your WildFly admin password
}
deployToTestServer.onlyIf { buildHostname.equals(myWorkstation) } //I don't want it to deploy when I'm doing development on a different workstation

Quark Mining on Ubuntu Linux 15.04

A little discussion….
 
This isn’t an endorsement of QuarkCoin. Just one of the many crypto-currencies (kind of like BitCoin) out there that I’m playing with. There doesn’t yet seem to be a Qt or Graphical Wallet for QuarkCoin yet. The Windows and Mac versions of the Quark Wallet seem to have mining built in. Hopefully a Linux version is in the works.
Assumptions:
I’ll make the assumption you are running Ubuntu, are an sudo’er on your system, are familiar with git and github and have a QuarkCoin wallet address on another system (Windows/Mac/Andrioid) where you can send your mined QuarkCoins.
Get your wallet:
Ensure/setup a QuarkCoin Wallet and address (for either Windows/Android/Mac) by installing a from http://www.qrk.cc
 
Join a mining pool:
For this walk through you’ll need to join a mining pool. A mining pool is just a server where folks work together to mine crypto-currencies. You can find a list of QuarkCoin pools here:
 
For now we’re going to use coinmine (they charge a small fee but seem reliable):
 
You’ll need to enter a wallet address
You’ll need to create at least 1 worker (and a worker password)
 
 
Install any prerequisites:
sudo apt-get install git build-essential automake libjansson-dev libcurl4-openssl-dev
 
Clone and build:
cd Cp3u
./autogen.sh
./configure CFLAGS=”-O3″
make
 
Create a local bin directory (which should already be in your path making life simple.):
mkdir ~/bin
Copy minerd to this directory:
cp minerd ~/bin
 
Start up the miner!
~/bin/minerd -a quark –url stratum+tcp://mine1.coinmine.pl:6010 -u YourUserName.worker1 -p YourWorker1Password
 
You’re all set!
 
 
 
Things to play with (maybe)…
 
1. Add to your crontab so it start when the machine starts
2. Write a service script to start/stop the miner
3. Setup a local pool so you don’t have to pay participation fees and payout fees from a public pool.
4. Send me a QuarkCoin if you want 🙂
QRVmvm9Ab4HubRsm5JyHRsXCwNUbjVBMQX

PostgreSQL Datasource and XADatasource on WildFly 8.2.0

These are my notes for installing PostgreSql datasources (both regular and XA) into WildFly 8.2.0.

*See a very short note about XA transactions below

My notes below presume you followed my directions for installation found here or have already successfully installed WildFly on your system.

These instructions also presume you have successfully installed and setup a PostgreSQL 9.4 server and have a valid username, password and database setup in PostgreSQL. My instructions are here if you need help getting started with PostgreSQL.

Two important things to know before you begin is the base or home directory for WildFly (formally called JBoss) and that you know the user/group under which the WildFly server is running.

On my system (Ubuntu Linux) I’ve installed WildFly (JBOSS_HOME) at

/opt/wildfly

On my system the server runs under group/user wildfly.wildfly (Yes, I know, zero points for originality)

So, here we go…

Get the latest and greatest PostgreSQL JDBC driver.
https://jdbc.postgresql.org/download.html
BTW, thank you to the PostgreSQL folks for a VERY FINE database and jdbc driver!
As of this writing the current version was postgresql-9.4-1201.jdbc41.jar

 

Add the JDBC driver as a module to WildFly
Elevate to root
sudo -s
cd /opt/wildfly/modules
mkdir org
cd org
mkdir postgresql
cd postgresql
mkdir main
cd main
pwd

 

You should now be in
/opt/wildfly/modules/org/postgresql/main

Copy the JDBC driver ( postgresql-9.4-1201.jdbc41.jar ) that you downloaded above into this directory.

 

Create a new file in this directory named: module.xml
Paste this content into this new file

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.postgresql">
    <resources>
        <resource-root path="postgresql-9.4-1201.jdbc41.jar"/>
        <!-- Make sure this matches the name of the JAR you are installing -->
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
        <module name="javax.servlet.api" optional="true"/>
    </dependencies>
</module>

Notice that the “path” value exactly matches the name of the JDBC driver jar file.
postgresql-9.4-1201.jdbc41.jar

Save the file (of course.)

 

Make sure the new postgresql-9.4-1201.jdbc41.jar, module.xml files AND the directory structure we just added/created have the same user and group ownership as the WildFly server

chown -R wildfly.wildfly /opt/wildfly/modules/org

 

Change directory to where your WildFly configuration is located.

cd /opt/wildfly/standalone/configuration

 

Stop WildFly
service wildfly stop (You should get an OK)

 

BACKUP YOUR CONFIGURATION FILE (Always backup!!!)

cp standalone-full.xml standalone-full.xml.beforeAddingPostgresql
(I’m assuming you are using standalone-full.xml instead of standalone.xml. Edit the one that is appropriate for your needs just backup!)

 

Open standalone-full.xml and find the section of the file that begins

<datasources>
   ...
   <drivers>

Just inside/after this XML start tag add this XML snippet which will make WildFly fully aware of the driver.

<driver name="postgresql" module="org.postgresql">
    <datasource-class>org.postgresql.Driver</datasource-class>
    <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>

Save and close the file. Now ANY datasource we add later can then use the driver. At this point it wouldn’t be a bad idea to try and start WildFly just to make sure we didn’t mangle the configuration file.

service wildfly start (You should get an OK) — If not restore the backup file and try again.
service wildfly stop (You should get an OK)

 

 

Add a regular datasource
Open standalone-full.xml and find the section of the file that begins

<datasources>

Just inside/after this XML start tag add this XML snippet (edit as needed of course) to make WildFly configured for your datasource.

<datasource jndi-name="java:jboss/datasources/PgDsAui" pool-name="PgDsAui" enabled="true" use-java-context="true">
    <connection-url>jdbc:postgresql://localhost:5432/aui?ApplicationName=AUI</connection-url>
    <driver>postgresql</driver>
    <pool>
        <min-pool-size>5</min-pool-size>
        <initial-pool-size>5</initial-pool-size>
        <max-pool-size>100</max-pool-size>
        <prefill>true</prefill>
    </pool>
    <validation>
        <valid-connection-checker
                class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"></valid-connection-checker>
        <exception-sorter
                class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"></exception-sorter>
    </validation>
    <security>
        <user-name>wildfly</user-name>
        <password>wildfly</password>
    </security>
</datasource>

 

 

Add a XA datasource
Open standalone-full.xml and find the section of the file that begins

<datasources>

Just inside/after this XML start tag add this XML snippet (edit as needed of course) to make WildFly configured for your XA datasource.

<xa-datasource jndi-name="java:jboss/datasources/PgDsXaAui" pool-name="PgDsXaAui" enabled="true"
               use-java-context="true">
    <driver>postgresql</driver>

    <!-- <xa-datasource-property name="URL">jdbc:postgresql://localhost:5432/aui?ApplicationName=AUI</xa-datasource-property> -->
    <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
    <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
    <xa-datasource-property name="DatabaseName">aui</xa-datasource-property>

    <xa-pool>
        <min-pool-size>5</min-pool-size>
        <initial-pool-size>5</initial-pool-size>
        <max-pool-size>100</max-pool-size>
        <prefill>true</prefill>
    </xa-pool>
    <validation>
        <valid-connection-checker
                class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker">
        </valid-connection-checker>
        <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter">
        </exception-sorter>
    </validation>
    <security>
        <user-name>wildfly</user-name>
        <password>wildfly</password>
    </security>
</xa-datasource>

 

 

Note: You can read all about the differences between a regular datasource (which is fine for most applications) and an XA datasource in great detail in the JDBC specification here. The short of it is that when you need to ensure a completed transaction across two or more datasources you need XA capabilities. You’ll see this referred to as a two phase commit. In practice I’ve used XA drivers (datasources) in my Java EE projects to pull data from one database product (e.g. MS-SQL) and insert into another database product (e.g PostgreSQL). XA helps you ensure that all went well on BOTH sides of the action.

WildFly 8.2.0 on Ubuntu 14.04

These are my notes for installing JBoss WildFly 8.2 on Ubuntu 14.04. These notes make the presumption you already have the Java JDK install on your system.

Elevate to root
sudo -s (or sudo -i)
cd /opt

Create a user acount on the system for wildfly
adduser --no-create-home --disabled-password --disabled-login wildfly

Download WildFly
wget http://download.jboss.org/wildfly/8.2.0.Final/wildfly-8.2.0.Final.tar.gz

Extract WildFly
tar -xzvf wildfly-8.2.0.Final.tar.gz

Make a symbolic link to new folder
ln -s wildfly-8.2.0.Final wildfly

change ownership of directory and symbolic link to wildfly
chown -R wildfly.wildfly wildfly
chown -R wildfly.wildfly wildfly-8.2.0.Final

Now, while WildFly 8 doesn’t ship as a .deb (which would be awesome!) it does provide a scripts to get you setup on Debian like/based systems of which Ubuntu is one. So, let’s edit and make use of those scripts:
cd /opt/wildfly/bin/init.d

Edit the file that contains the settings/options for the setup script:
wildfly.conf

Uncomment and Edit the following lines:
# JBOSS_HOME="/opt/wildfly"
JBOSS_HOME="/opt/wildfly"

# JBOSS_USER=wildfly
JBOSS_USER=wildfly

# JBOSS_MODE=standalone
JBOSS_MODE=standalone

# JBOSS_CONFIG=standalone.xml
JBOSS_CONFIG=standalone-full.xml
— Change configuration file name in order to run full Java EE 7 Stack

# STARTUP_WAIT=60
STARTUP_WAIT=120
–Probably overkill wait time

# SHUTDOWN_WAIT=60
SHUTDOWN_WAIT=120
–Probably overkill wait time

# JBOSS_CONSOLE_LOG="/var/log/wildfly/console.log"
JBOSS_CONSOLE_LOG="/var/log/wildfly/console.log"

OK now let’s link to these files from the approprate place in /etc
cd /etc/default
ln -s /opt/wildfly/bin/init.d/wildfly.conf wildfly

cd /etc/init.d
ln -s /opt/wildfly/bin/init.d/wildfly-init-debian.sh wildfly

Try to start WildFly as a service
service wildfly start

Which should give you output similar to…
* Starting WildFly Application Server wildfly [OK]

Run update-rc.d to ensure wildfly starts on reboot
cd /etc/init.d
update-rc.d wildfly defaults

By default WildFly seems to only listen on 127.0.0.1. To make it listen on all interfaces we have to edit the standalone-full.xml (recall we changed the configuration file form standalone.xml to standalone-full.xml above) file and change each instance of “127.0.0.1” to “0.0.0.0” in the file. Just use find and replace in your editor to do this. I use vim so…

cd /opt/wildfly/standalone/configuration
vi standalone-full.xml
:%s/127.0.0.1/0.0.0.0/g
:wq

Start or restart Wildfly
service wildfly stop
service wildfly start

With WildFly running add a “Management User”
cd /opt/wildfly/bin
./add-user.sh

That’s it. You now have a basic WildFly 8 install and can reach it and configure further with any browser using the “Management User” credentials you setup above.

PostgreSql 9.4 on Ubuntu 14.04 (trusty)

Quick and dirty install notes to get PostgreSql 9.4 on Ubuntu 14.04 (trusty)

I’m pretty sure PostgreSql 9.4 is already in Ubuntu 14.10 (utopic) but I’m sticking with “trusty” for now but would like the latest and greatest PostgreSQL.

This post will be similar to an earlier post on PostgreSql and Ubuntu which can be found here. The difference is that I want to pull PostgreSql directly from the repository at PostgreSql.org

Become root
sudo -s

Make sure “trusty” is up to date. Reboot if you have to or if you get a new kernel
aptitude update
aptitude dist-upgrade

Add the postgresql.org repository to your apt configuration
echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list

Get the postgresql.org signature key
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Run aptitude update again so it pulls info from postgresql.org
aptitude update

Install PostgreSql-9.4
aptitude install --with-recommends postgresql-9.4 postgresql-contrib-9.4

If you are running the desktop version of Ubuntu and want the GUI grap pgadmin3, too.
aptitude install --with-recommends pgadmin3

Now you have PostgreSql 9.4 on the Long Term Stable (LTS) version of Ubuntu!

Citrix XenServer 6.2 — Applying Public HotFixes

My XenServer 6.2 systems were pretty far out of date with regard to updates and hotfixes. So, yesterday I decided to apply the hot fixes available from XenServer.org.

We just use the software available from the XenServer.org site. We anticipated that we’d be able to apply these hot fixes using the XenCenter GUI but it seems that this isn’t an option if one doesn’t have a support license from Citrix.

I use and license some other products from Citrix but I don’t currently pay for support for XenServer. I might going forward as this was kind of a bear. But, we may also look at some other options, too. And, even with the ability to upgrade via the XenCenter GUI it still seems kind of a throw back in the current days where one can just apt-get update and apt-get dist-upgrade to keep a Linux (Debian based/derived anyway) fully patched.

It turns out that one can still apply these hot fixes but it requires getting the packages to the server and using some command line tools. In my case I have a pool — several XenServer hosts grouped together — so I wanted to update all the servers in my pool.

I downloaded the following service packs and hotfixes from XenServer.org

XS62ESP1
XS62ESP1001 (New Version of XenCenter)
XS62ESP1002
XS62ESP1003
XS62ESP1004
XS62ESP1005
XS62ESP1008
XS62ESP1009
XS62ESP1011

XS62ESP1013 and XS62ESP1013 were also listed on the site at the time but we’re advisories not actual packages.

I unzipped all of the above hotfixes and copied the contents of each into a single folder called HotFixes.

Before I get into the details I ran into a few of obstacles before I even started…

  1. I couldn’t upgrade XenCenter on my Windows 8.1 workstations as the installer complained about not having dotNet3.5 installed. I used the Windows control panel to add this feature but
    still no joy. I’m not sure if this is a problem on the XenCenter side or the Windows side. Turns out I already had the current version: 6.2 (build 1377) so bascially a lot of clicking around for no reason.
  2. I used WinSCP to upload my HotFixes to the /root directory on the server but my first attempt to apply the first service pack failed because there was not enough room on / partition to complete the install. So, I moved my HotFixes folder to a share on one of my regular Windows servers and then just used the mount command to reach the package files. The commands issued on the XenServer we along the lines of:

mkdir /mnt/shareOnWindowsServer
mount -t cifs //NameOfWindowsServer/NameOfShareOnWindowsServer -o username=UserName,password=myPassword /share/shareOnWindowsServer
cd /share/shareOnWindowsServer/HotFixes

  1. I learned that High Availability needed to be turned off for these steps to work. From within XenCenter click on the pool you are trying to upgrade. Click on the HA tab and disable High Availability.

I now had High Availability OFF and access to all the HotFixes without using any space on my local / partition on the XenServer pool master.

So, now the fun begins…

  1. Get a list of all the UUIDs for each of the servers in your pool

xe host-list

As an example two of the UUIDs in my pool look like:

6c5fc1d8-d0be-46b9-abb8-912701ca41ef and e44fc0df-d147-4a2e-be62-6a1d51620f00

Copy and paste yours into a text doc as you will need the UUID for each host in the next few steps.

  1. Upload each patch to the pool. Very important!: After uploading each patch make a note (copy and paste to a txt document) the UUID issued directly after you issue the upload command. You will need these UUIDs later as well as the UUIDs you collected about the servers in your pool above.

xe patch-upload file-name=XXS62ESP1.xsupdate
xe patch-upload file-name=XXS62ESP1002.xsupdate
xe patch-upload file-name=XXS62ESP1003.xsupdate
xe patch-upload file-name=XXS62ESP1004.xsupdate
xe patch-upload file-name=XXS62ESP1005.xsupdate
xe patch-upload file-name=XXS62ESP1008.xsupdate
xe patch-upload file-name=XXS62ESP1009.xsupdate
xe patch-upload file-name=XXS62ESP1011.xsupdate

For the above I got the following UUIDs. I’m not sure if they are randomly generated or not. But, use the ones issued to you if they are indeed different from mine.

0850b186-4d47-11e3-a720-001b2151a503
297f2f77-5603-4aaf-9e56-db49512d4592
c208dc56-36c2-4e91-b8d7-0246575b1828
996dd2e7-ad95-49cc-a0be-2c9adc4dfb0b
1c952800-c030-481c-a0c1-d1b45aa19fcc
59a75271-12f9-4e6a-8ba2-325c2f5b0b47
a24d94e1-326b-4eaa-8611-548a1b5f8bd5
7d670435-547c-419a-ab7e-296705a752b8

  1. Apply the patches to EACH server in your pool. So for the following commands I’ll use the UUIDs for two of my servers above and the UUIDs that were issued to me by the patch-upload command. These are just examples. Use the actual UUIDs from the output of your own xe host-list and xe patch-upload commands.

On my pool master I issued the following commands to upgrade that specific server:

xe patch-apply uuid= host-uuid=


xe patch-apply uuid=0850b186-4d47-11e3-a720-001b2151a503 host-uuid=6c5fc1d8-d0be-46b9-abb8-912701ca41ef
xe patch-apply uuid=297f2f77-5603-4aaf-9e56-db49512d4592 host-uuid=6c5fc1d8-d0be-46b9-abb8-912701ca41ef
xe patch-apply uuid=c208dc56-36c2-4e91-b8d7-0246575b1828 host-uuid=6c5fc1d8-d0be-46b9-abb8-912701ca41ef
xe patch-apply uuid=996dd2e7-ad95-49cc-a0be-2c9adc4dfb0b host-uuid=6c5fc1d8-d0be-46b9-abb8-912701ca41ef
xe patch-apply uuid=1c952800-c030-481c-a0c1-d1b45aa19fcc host-uuid=6c5fc1d8-d0be-46b9-abb8-912701ca41ef
xe patch-apply uuid=59a75271-12f9-4e6a-8ba2-325c2f5b0b47 host-uuid=6c5fc1d8-d0be-46b9-abb8-912701ca41ef
xe patch-apply uuid=a24d94e1-326b-4eaa-8611-548a1b5f8bd5 host-uuid=6c5fc1d8-d0be-46b9-abb8-912701ca41ef
xe patch-apply uuid=7d670435-547c-419a-ab7e-296705a752b8 host-uuid=6c5fc1d8-d0be-46b9-abb8-912701ca41ef

Again, while still on the command line of my pool master I issued the following command to upgrade another member of my pool.

xe patch-apply uuid=0850b186-4d47-11e3-a720-001b2151a503 host-uuid=e44fc0df-d147-4a2e-be62-6a1d51620f00
xe patch-apply uuid=297f2f77-5603-4aaf-9e56-db49512d4592 host-uuid=e44fc0df-d147-4a2e-be62-6a1d51620f00
xe patch-apply uuid=c208dc56-36c2-4e91-b8d7-0246575b1828 host-uuid=e44fc0df-d147-4a2e-be62-6a1d51620f00
xe patch-apply uuid=996dd2e7-ad95-49cc-a0be-2c9adc4dfb0b host-uuid=e44fc0df-d147-4a2e-be62-6a1d51620f00
xe patch-apply uuid=1c952800-c030-481c-a0c1-d1b45aa19fcc host-uuid=e44fc0df-d147-4a2e-be62-6a1d51620f00
xe patch-apply uuid=59a75271-12f9-4e6a-8ba2-325c2f5b0b47 host-uuid=e44fc0df-d147-4a2e-be62-6a1d51620f00
xe patch-apply uuid=a24d94e1-326b-4eaa-8611-548a1b5f8bd5 host-uuid=e44fc0df-d147-4a2e-be62-6a1d51620f00
xe patch-apply uuid=7d670435-547c-419a-ab7e-296705a752b8 host-uuid=e44fc0df-d147-4a2e-be62-6a1d51620f00

The above needs to be repeated changing the host-uuid for each member of your pool.

  1. I shutdown each of the servers.
  2. I powered on the pool master first. Once it was fully booted I powered on the other members of the pool.

Everything came back up. XenCenter could see that the patches had been applied. But all was not well!!!

I was able to start each of my Windows virtual machines. But, I was not able to start ANY of my Ubuntu/Linux based virtual machines. Uggh!

I got the following error:

Error: The bootloader for this VM returned an error -- did the VM installation succeed? Unable to find the partition containing the kernel

Each of my Linux VMs are Ubuntu 14.04 server instances. These use grub2 which seems to be an issue for XenServer 6.2. In the past to get around this I made an edit to the /usr/lib/python2.4/site-packages/grub/GrubConf.py file as outlined here. But, this edit threw syntax errors when I tried the start the Linux VM.

When I made the edit outlined above I just got a new and different error complaining about the script syntax.

Oct 16, 2014 7:14:08 PM Error: Starting VM 'Gray' - Internal error: xenopsd internal error: VM = ffe05941-b5cf-38a0-f826-05658bdfe848; domid = 9; Bootloader.Bad_error Traceback (most recent call last):
File "/usr/bin/pygrub", line 26, in ?
import grub.GrubConf
File "/usr/lib/python2.4/site-packages/grub/GrubConf.py", line 428
if arg.strip() == "${saved_entry}" or if arg.strip() == "${next_entry}":
^
SyntaxError: invalid syntax

I’m not a Python programmer and my little fix wasn’t getting the job done. So, I took a shot in the dark and changed line 428 of /usr/lib/python2.4/site-packages/grub/GrubConf.py
from the original:
if arg.strip() == "${saved_entry}":

to:
if arg.strip() == "${next_entry}":

That did the trick and all my Linux VMs started with no problem. I of course had to edit /usr/lib/python2.4/site-packages/grub/GrubConf.py on each of my XenServers.

Generally, I have very few problems with XenServer 6.2 (the grub2 thing is the biggest annoyance). That being said when I look into alternatives I may just look at running Xen on Ubuntu. Like I wrote earlier being able to stay up to date just issuing apt-get update; apt-get dist-upgrade commands really spoiles you against procedures like those above. If anyone out there has thoughts/ideas/suggestions or opinions they’d like to share on virtualized environments/options my ears are open.

All of the above was quite a chore. I do hope these notes help someone else out.

Disable SSLv3 in Apache 2.4 (Ubuntu)

The POODLE SSLv3 has made big news this week. If you are running and an Apache web server and don’t have to support a lot of old browsers you might as well just stop using it.

On an Ubuntu system..

cd /etc/apache2/mods-enabled

Edit the file:
ssl.conf

Change the entry (around line 77) from:
SSLProtocol all
to
#SSLProtocol all (Just adding the # to comment out the line)

Add the line/entry:
SSLProtocol TLSv1.2

Restart Apache:
service apache2 restart

TLS supplanted SSL and I understand TLS1.2 to be the most current version of TLS.

This will prevent Apache from falling back to old versions of SSL/TLS. I know there are a lot of old browsers out there but TLS 1.2 has been support in most of the majors for some time. Google gave up this list of browsers/versions that support TLS 1.2…

Chrome – v30
Firefox – v27 enables TLS 1.1 and 1.2 by default. OR
Internet Explorer – v11 supports TLS 1.2 from Feb 2013.
Opera – v17 has added support for TLS 1.2. …
Safari – v5 on iOS and v7 on OS X have added support for up to TLS 1.2.

DisplayLink Attached Display Adapter and Ubuntu/Linux

Had this great little adapter:

DisplayLink Plug and Play Universal docking Station
DELL Model: D3000
MFG: ACP075US

Worked pretty well under Windows.

    Can’t get it going under Linux.

Getting a bug report into the folks at Ubuntu is pretty straight forward. But, boy, can getting help from the main kernel.org mailing lists be a chore.

After posting in the correct format to several kernel.org lists finally the linux-fbdev list indicated:

“That Dell dock is using the newer DL-3×00 chips. There’s no way to get the graphics portion working for Linux on that.”

So if you are working on the same issue you can read all the gory details of my bug post at:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1376771

If you are a developer trying to get Linux/Ubuntu/DisplayLink (newer chipset) working I would be happy to help you test your product.

Being able to drive a couple/few monitors off a USB 3.0 port seems to be something that Linux should be able to do. Again, I’m not a systems developer but I would be happy to help any developer/vendor efforts along these lines.

MySQL 5.6 on Windows 8.1 — Load Time Zone Tables

Ran into a pinch with my MySQL install on Windows 8.1. It seems the timezone data isn’t installed/loaded into the mysql timezone tables by default.

Here is the quick fix…

  1. Stop the MySQL Service
  2. Download the POSIX standard Time zone description tables from http://dev.mysql.com/downloads/timezones.html
  3. Unzip the downloaded file
  4. Copy its contents to C:\ProgramData\MySQL\MySQL Server 5.6\data\mysql
  5. Start the MySQL Service

There are more details here including directions for populating these tables on Linux.