A video of this process is also below. Scroll Down to find it.

Turnkey Linux is a very convenient way to obtain a very large assortment of pre-made virtual appliances for many different virtualization platforms, including Openstack. However deploying the appliances to Openstack is a bit more involved then other platforms.  Here I will try to make the process as simple and as streamlined as possible. Scouring the internet there is very little on this process, so I hope this helps someone.

the website is https://www.turnkeylinux.org once there you can browse available appliances or search if you know exactly what you want. Once you find the appliance you will have the option of downloading it for your specific hypervisor or virtualization solution. Click on “openstack”. This will bring you to a page where you have the ability to get the “Direct Link” right click on where it says so and choose copy link address.

Next log into your openstack cloud, here we will have to use the command line tools, however the process is relatively straight forward.

Using your favorite ssh client (Putty in my case) log into your cloud using the api endpoint. Then you will likely want to create a file with your credentials and api endpoints so you don’t have to type them all in with every command. this is easily done. Simply login to the dashboard, click “Access and Security” there you will find a button to download “openstack rc file” once downloaded simply source it using the command:

source "filename"

the file name can be something like openrc or stackrc or similar

now we can download the appliance using the wget command

wget 'paste the address link you copied from the Turnkey Linux site'

this will download a compressed file in form turnkeylinux.nameofyourappliance.tar.gz

First we want to decompress this file with the following command:

tar -zxf nameofdownloadedfile.tar.gz

This will create a new folder with three files in it. To see the new folder simply list all the files in the current directory using the following command:

ls

You should see a new folder, so lets move into that folder with:

cd nameofnewfolder

now to see the three files simply type:

ls

These are the files that will be uploaded to openstack. One ends in-kernel one ends with -initrd and one .img

Next we simply upload the ramdisk and kernel to glance, first the ramdisk

glance image-create --container-format ari --disk-format ari --name "Enter a name for your applicance" < filename-initrd

this will return some information take note of the “id” as this is the “ramdisk-id and we will need this in a later step.

Next lets upload the kernel with this command:

glance image-create --container-format aki --disk-format aki --name "same name in previous step" < filename-kernel

This will again return a box of information and again take note of the “ID” here again as this will be the “kernel id” used next.

With this final step using the command line we bring everything together and upload the image and tie the image to the ramdisk and kernel we just uploaded.

glance image-create --container-format ami --disk-format ami --name "Same name in previous two steps" --property kernel_id=kernel id returned from previous step --property ramdisk-id=ramdisk id returned in previous step < filename.img

If all goes well you should get back another box with information and no errors. No need to save any info from this box.

Now lets switch out of the ssh client and login to the GUI dashboard as the admin user and in the admin tab click on images. Here you need to make the 3 files public if you want to give your tenants access, and optionally protected as well by clicking on edit and checking the appropriate boxes then saving.

Your tenants now have access to the appliance and are able to deploy their own using their own private key and upon spawning the instance the encrypted key will be injected into the instance for access.

From here on in you can set up the appliance as any other turnkey linux appliance. SSH into it and follow the on screen prompts. At the end I found that even though the appliance will say all the services are available they actually are not. You will have to reboot the appliance by simply ssh’ing into it again and give it the reboot command. Once it comes back up you have a working appliance.

Tomorrow I will also put together a video showing this process. and add it to this article. Till then Good night!

— Carmine Bufano

As promised Here is the video.

Leave a Reply