Cloud storage for photo backups

At home we have a 4-disk QNAP box as a file server which hosts photos dating back to the 1990s. Up to recently it was backed up over eSATA to external drives, but it was never a good solution. The QNAP box does offer cloud backup, but I don’t want to be dependent on somebody else’s proprietary way of copying data to the cloud. So, yesterday I finally got hacking on a Python script to back the whole thing up to a cloud provider.

After looking at Amazon S3, Google Cloud Platform and BLOB storage in Microsoft Azure (which I use frequently at work) I finally went with S3 as it has the option to automatically shift data to the ultra-low-cost Glacier service after a set time. There are good tutorials to get started for those who are interested here: http://boto.cloudhackers.com/en/latest/s3_tut.html

Amazon recommends splitting files larger than 100Mb prior to upload and Boto can be used with file splitting as well.

Prior to this it was necessary to encrypt all data to ensure it wasn’t easily accessible by any third party. Not that I expect anyone to have an interest in some family photos, but anyway. To make sure it would be possible even for my wife to decrypt the data I went with 7za since it simply creates zip files encrypted with AES. Encrypting is as easy as:

I may post the actual backup script here as well once it’s been through a few revisions, but it’s too rough for publication right now.

Nova live migration fails with “Migration pre-check error: CPU doesn’t have compatibility.”

This week I’m hosting a hands-on OpenStack training for some clients. The ability to perform Live migrations of running instances between hosts is one of the things they want to see and I had setup the environment to support this.

Live migrations had been working fine for over a week when it finally decided to throw errors this morning.

The error on the command line when trying to do a live migration:

Normally this would happen if the hosts running nova-compute had different CPU types, but in this case they are all identical (Dell C6320 nodes).

Checked the CPU map in /usr/share/libvirt/cpu_map.xml and the CPU is listed.

Since the CPU’s are the same on all nodes it’s obviously the lookup of that CPU type that fails. So, I tried to disable the check by editing /usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py. This resulted in the error disappearing but my instances staying put on whatever host they were originally running on. Not much better.

Finally I started modifying the /etc/nova/nova.conf files on both the controller node and the nova-compute nodes. The changes that fixed it were as follows:

Old setting:

New setting:

Old setting:

New setting:

I also have the following settings which may or may not matter in this case:

After restarting nova on both the controller and all three compute nodes, live migrations are working fine again. Not sure why they stopped in the first place, but at least this seems to have done the job.

Checking instances for each node:

Performing the migration:

Verifying that the instance has moved from node2 to node4:

The keystone CLI is deprecated in favor of python-openstackclient.

UPDATE: It turns out that installing the new client can cause issues with Keystone. I found this out the hard way yesterday when it failed during a demo, preventing authentication from the command line. After a few hours troubleshooting it turns out Apache (httpd.service) and Keystone (openstack-keystone.service) were clashing. I was unable to fix this regardless of updating each of these services config files to separate them out. Finally guessed it might be the last package I installed that was the cause. After removing python-openstackclient and rebooting the controller node the issue was fixed.

Original post
===============
In OpenStack Kilo the Depreciation message for the Keystone CLI will be displayed whenever using invoking the keystone command. “

To move to the new python-openstackclient, simply install it. On RHEL7.1:

After that it will be available as the command “openstack”. It can be invoked in interactive mode just by typing “openstack” or directly from the command line to get information. For example, to list users:
Old Keystone CLI: “


New Openstack CLI: “

To be more similar to the output of the old command issue “

” to get the extra fields.

You may also want to update the script “openstack-status” so it uses the new client. To do so, please:
1. Edit

with your favorite editor
2. Replace the old command with the new one (around line 227) like so:

The new CLI can do a lot more of course. For a full list of commands please refer to the below (executed with “openstack” + command):

RHEL / Red Hat – Package does not match intended download.

Currently installing a few C6320 servers with RHEL7.1 to create an OpenStack demo cluster. Since all servers need almost identical setups I wrote some Expect scripts but unfortunately didn’t put the script runtime timeout high enough. This resulted in the connection to one of the servers being interrupted in the middle of a “yum update -y”.

When trying to run the update again it failed with: “[Errno -1] Package does not match intended download. Suggestion: run yum –enablerepo=rhel-7-server-rpms clean metadata” “Trying other mirror.”

Unfortunately, running the suggested “clean metadata” didn’t fix the problem. Instead, the fix turned out to be a simple “yum clean all” 🙂