Friday, October 5, 2012

Importing images into SUSE Cloud / OpenStack

We introduced Studio's new SUSE Cloud and OpenStack support in the last blog post, but skimmed on the details. So we'll spend some time here to explain what OpenStack and SUSE Cloud are, as well as how to import images from Studio to SUSE Cloud.

What is OpenStack?


OpenStack was founded by Rackspace and NASA and has since grown to be a global software community of developers collaborating on a standard and massively scalable open source cloud platform. The project's mission is to provide organizations the ability to create and offer cloud computing services running on standard hardware.
If you are familar with today's popular virtualization platforms, you can think of OpenStack as an open-source implementation of VMware's vDirector. In essence, both provide an easy to use user interface to launch and manage virtual machines plus other resources across your datacenter. OpenStack is currently not as feature rich as vDirector, but that's set to change and it does already have a number of advantages:
  • Open-source with a large and active community, backed by many big industry leaders including HP, IBM, Cisco, Rackspace, NetApp, and SUSE.
  • Hypervisor agnostic - supports Xen, KVM, QEMU, LXC, ESX(i) and Hyper-V.
  • Free of charge, with several companies offering premium support options.
  • Massively scalable.


There are three main subsystems in OpenStack: Compute, Networking, and Storage. These run on top of a shared services layer that manages identities and images. All these and more can be controlled via the web interface called Dashboard.

What is SUSE Cloud?



SUSE Cloud is a pre-packaged and supported version of OpenStack that has been tested to work with the SUSE family of products. It is designed for oranizations to setup and manage their own private clouds. It is much easier to install and setup than the vanilla OpenStack.

Importing images from SUSE Studio to SUSE Cloud


So let's get our Studio built images into SUSE Cloud! The steps here are for SUSE Cloud, but it should also work with vanilla OpenStack. There's no graphical user interface to import images into SUSE Cloud/OpenStack at the moment, so you'll have to import it using the command line tool. First, login to your SUSE Cloud instance:

And then download the openrc.sh credentials file from "Settings" => "OpenStack Credentials" => "Download RC File":

Assuming you're using a SLE11 SP2 system, run the following commands to add the Cloud:OpenStack:Grizzly repository and install the the python-glanceclient package. If you're using openSUSE, just change the repository URL accordingly. These packages will eventually make their way into the standard repositories. For example:
  sudo su -
  zypper addrepo \
    http://download.opensuse.org/repositories/Cloud:/OpenStack:/Grizzly/SLE_11_SP2/ \
    Cloud:OpenStack:Grizzly
  zypper refresh Cloud:OpenStack:Grizzly
  zypper install python-glanceclient

Now you can import your image directly from susestudio.com (or your SUSE Studio Onsite >=1.3 instance) to your SUSE Cloud instance. For example:
  . openrc.sh
  glance image-create --name="Studio built VM" --is-public=True \
    --disk-format=qcow2 --container-format=bare \
    --copy-from http://bit.ly/UHn5C7

You should get output in the command line that looks like the following:

The image will now also show up in the "Images & Snapshots" section in your SUSE Cloud instance:

We can now easily launch instances of this image:

You'll notice in the screenshot that we've chosen the keypair "jamestyj" when launching the instance. This is important as password based authentication is automatically disabled for the root account for security reasons. Without a matching keypair, you won't be able to login to the instance via SSH. Keypairs can be created in the "Access & Security" section of SUSE Cloud. During keypair creation, you'll be offered to save the private key locally. Keep this in a safe and secure place as you'll need to generate a new keypair if it is misplaced. Run the following command on the downloaded private key to ensure the correct file permissions, eg:
  chmod 600 jamestyj.pem

You can then connect securely to the instance via SSH. The IP address can be obtained from the "Overview" tab of the running instance in SUSE Cloud. For example:
  ssh -i jamestyj.pem root@10.122.160.81

There's also the VNC viewer in the instance's "VNC" tab, though you won't be able to login there since password based logins are disabled. It's useful for debugging if something goes wrong:

As you can see here, it's easy to import images from Studio into SUSE Cloud once you have the initial setup. In the next post of this series, we'll show how to use Studio's WebHooks to automatically import images into SUSE Cloud.

[8 Oct 2012] Update: The third and last blog post in this series, "Automatic image imports with WebHooks" is out now.

[26 Jun 2013] Update: The package is now available from Cloud:OpenStack:Grizzly project.

2 comments:

  1. SuSE Studio is a great service to build virtual apps. SuSE & OpenNebula users can get a fully integrated SUSE Studio service within their OpenNebula clouds. More details:

    http://blog.opennebula.org/?p=1931

    https://support.opennebula.pro/entries/20466331-using-suse-studio-with-opennebula

    ReplyDelete
  2. Please note that with SUSE Cloud 1.0 you must use the older Essex version of python-glanceclient e.g. from http://download.opensuse.org/repositories/Cloud:/OpenStack:/Essex/SLE_11_SP2/
    because the newer client tries to use chunked transfers, which the server side can not handle.

    ReplyDelete

 
© 2013 SUSE