Using turnkeylinux for OpenStack

The images provided by turnkeylinux are mirrored on the OpenStack node running the glance image service. Each image of interest is uploaded into glance using turnkey2glance.sh. New flavors are created with nova flavor create to take advantage of their small memory footprint.

mirroring turnkeylinux

A single directory groups all the images dedicated to OpenStack. The older, Ubuntu based images numbered 11.3 are discarded to only download the 12.0 Debian Squeeze based versions.

rsync -av --exclude '*11.3*' rsync://turnkeylinux.mirrors.ovh.net/turnkeylinux/openstack/ ./

uploading an image

Each turnkey images is delivred in a format suitable for uploading in the glance image service of OpenStack. The turnkey2glance.sh script was written to simplify the three step import. Its usage is:

turnkey2glance.sh --help
Usage: ./turnkey2glance.sh turnkey-openstack.tar.gz

Upload a http://turnkeylinux.org/ image in the OpenStack image service.

A) download the image and its signature. For instance:

      wget http://downloads.sourceforge.net/project/turnkeylinux/openstack/turnkey-trac-12.0-squeeze-x86-openstack.tar.gz
      wget http://downloads.sourceforge.net/project/turnkeylinux/openstack/turnkey-trac-12.0-squeeze-x86-openstack.tar.gz.sig

B) export the OpenStack credentials in the environment. For instance:

      export OS_PASSWORD=mypassword
      export OS_AUTH_URL=http://os.the.re:5000/v2.0/
      export OS_USERNAME=myuser
      export OS_TENANT_NAME=openstack

C) upload the image. For instance:

      ./turnkey2glance.sh turnkey-trac-12.0-squeeze-x86-openstack.tar.gz

D) check that it shows in glance. For instance:

      glance index name=trac-12.0

The homepage for ./turnkey2glance.sh is

http://redmine.the.re/projects/turnkey/repository/revisions/master/entry/turnkey2glance.sh

The owncloud image was imported as follows:

# turnkey2glance.sh turnkey-owncloud-12.0-squeeze-x86-openstack.tar.gz
gpg: requesting key A16EB94D from hkp server keyserver.ubuntu.com
gpg: key A16EB94D: "Turnkey Linux Release Key " not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
gpg: Signature made Tue 21 Aug 2012 18:06:03 CEST using RSA key ID A16EB94D
gpg: Good signature from "Turnkey Linux Release Key "
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 694C FF26 795A 29BA E07B  4EB5 85C2 5E95 A16E B94D
tar -zxvf turnkey-owncloud-12.0-squeeze-x86-openstack.tar.gz
turnkey-owncloud-12.0-squeeze-x86/
turnkey-owncloud-12.0-squeeze-x86/turnkey-owncloud-12.0-squeeze-x86.img
turnkey-owncloud-12.0-squeeze-x86/turnkey-owncloud-12.0-squeeze-x86-initrd
turnkey-owncloud-12.0-squeeze-x86/turnkey-owncloud-12.0-squeeze-x86-kernel
Uploading image 'owncloud-12.0'

Added new image with ID: 08f4a517-fefb-4682-a4f3-6665ce9ab59e
ID                                   Name                           Disk Format          Container Format     Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
08f4a517-fefb-4682-a4f3-6665ce9ab59e owncloud-12.0                  ami                  ami                       889454592

adding flavors

The following flavors are created, with names that reflect their capabilities. The flavor id given to the –flavor option is calculated to not conflict with the flavors returned by the nova flavor-list command. Here is an example

nova-manage flavor create --name e.1-cpu.10GB-disk.128MB-ram --memory=128 --cpu=1 --root_gb=10 --ephemeral_gb=0 --flavor=9

The final flavor list is:

# nova flavor-list
+----+-----------------------------+-----------+------+-----------+------+-------+-------------+
| ID |             Name            | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor |
+----+-----------------------------+-----------+------+-----------+------+-------+-------------+
| 1  | m1.tiny                     | 512       | 0    | 0         |      | 1     | 1.0         |
| 2  | m1.small                    | 2048      | 10   | 20        |      | 1     | 1.0         |
| 3  | m1.medium                   | 4096      | 10   | 40        |      | 2     | 1.0         |
| 4  | m1.large                    | 8192      | 10   | 80        |      | 4     | 1.0         |
| 5  | m1.xlarge                   | 16384     | 10   | 160       |      | 8     | 1.0         |
| 6  | e.1-cpu.10GB-disk.1GB-ram   | 1024      | 10   | 0         |      | 1     | 1.0         |
| 7  | e.1-cpu.10GB-disk.512MB-ram | 512       | 10   | 0         |      | 1     | 1.0         |
| 8  | e.1-cpu.10GB-disk.256MB-ram | 256       | 10   | 0         |      | 1     | 1.0         |
| 9  | e.1-cpu.10GB-disk.128MB-ram | 128       | 10   | 0         |      | 1     | 1.0         |
+----+-----------------------------+-----------+------+-----------+------+-------+-------------+

The new flavors are used to take advantage of the low memory footprint of some instances.

This entry was posted in Essex, openstack. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>