Upload openSUSE or SLES Qcow2 image to OpenStack

SUSE and openSUSE are Linux distributions powered by the same SUSE Linux codebase. However, they attract different audiences and to some degree have distinct characteristics. In this article, we will download and upload both SLES and openSUSE Qcow2 images to OpenStack.

What is openSUSE?

openSUSE is a free to download, use and customize distribution. This makes openSUSe attractive to individuals, developers, and enthusiasts user base. It is focused on user-friendly experience and access to repositories with a huge number of packages suitable for daily use.

There are two major editions of openSUSE:

  • Leap: This is a more stable release with long-term support (similar to RHEL).
  • Tumbleweed: This is a rolling release with more frequent releases / updates (similar to Fedora).

What is SUSE Enterprise Linux (SLES)

SLES (SUSE Linux Enterprise Server) is developed for enterprises and mission-critical environments where it’s run on servers and mainframes. It’s designed to be more stable, robust, scalable, and secure for running serious workloads used by thousands to millions of users.

To get support and updates you require a paid subscription. It only offer stable releases with long-term support unlike frequent updates in openSUSE.

Upload openSUSE Qcow2 image to OpenStack

QCOW2 (QEMU Copy On Write version 2) is a standard image format for distributing Linux distributions templates run in private and public cloud environments. It is a pre-installed and pre-configured virtual machine (VM) disk image.

A prerequisites for this is a functional OpenStack command-line interface (CLI) – installed and configured on your machine.

Visit openSUSE Cloud Images page to download QCOW2 image to be used on OpenStack.

### openSUSE 15.2 ###
wget https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.2/images/openSUSE-Leap-15.2-OpenStack.x86_64.qcow2

### openSUSE 15.6 ###
wget https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.6/images/openSUSE-Leap-15.6.x86_64-NoCloud.qcow2

After downloading the image we upload it to OpenStack Glance.

# openSuSE 15.2
openstack image create \
    --container-format bare \
    --disk-format qcow2 \
    --file openSUSE-Leap-15.2-OpenStack.x86_64.qcow2 \
    openSUSE-Leap-15.2

# openSUSE 15.6
openstack image create \
    --container-format bare \
    --disk-format qcow2 \
    --file openSUSE-Leap-15.6.x86_64-NoCloud.qcow2 \
    openSUSE-Leap-15.6

Image upload command output.

+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field            | Value                                                                                                                                                  |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| container_format | bare                                                                                                                                                   |
| created_at       | 2024-07-05T23:02:00Z                                                                                                                                   |
| disk_format      | qcow2                                                                                                                                                  |
| file             | /v2/images/dbe4bb98-3093-4858-9e1e-d4fb64f1c216/file                                                                                                   |
| id               | dbe4bb98-3093-4858-9e1e-d4fb64f1c216                                                                                                                   |
| min_disk         | 0                                                                                                                                                      |
| min_ram          | 0                                                                                                                                                      |
| name             | openSUSE-Leap-15.6                                                                                                                                     |
| owner            | 3dfc8a0aec3d409696daa2c825b85a3f                                                                                                                       |
| properties       | os_hidden='False', owner_specified.openstack.md5='', owner_specified.openstack.object='images/openSUSE-Leap-15.6', owner_specified.openstack.sha256='' |
| protected        | False                                                                                                                                                  |
| schema           | /v2/schemas/image                                                                                                                                      |
| status           | queued                                                                                                                                                 |
| tags             |                                                                                                                                                        |
| updated_at       | 2024-07-05T23:02:00Z                                                                                                                                   |
| visibility       | shared                                                                                                                                                 |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+

List available images in your OpenStack.

$ openstack image list
+--------------------------------------+--------------------+--------+
| ID                                   | Name               | Status |
+--------------------------------------+--------------------+--------+
| 76f0ddfe-8800-42b5-9b2e-5e20fce37882 | CentOS-Stream-9    | active |
| 8082bf28-eb9c-48e9-af58-dcb97542f614 | Debian-12          | active |
| 10d19cb7-4dca-42f4-a624-606bc06527fe | Rocky-Linux-9      | active |
| 35ee8729-26b7-4e93-b045-71b13c574c73 | Ubuntu-24.04       | active |
| dbe4bb98-3093-4858-9e1e-d4fb64f1c216 | openSUSE-Leap-15.6 | active |
+--------------------------------------+--------------------+--------+

We can test by creating a VM instance from the image uploaded.

# List instance flavors
openstack flavor list

# List keypairs
openstack keypair list

# List Networks
openstack network list

# List Security groups
openstack security group list

The commands used to create a VM instance on OpenStack are as follows

openstack server create \
  --flavor <flavor> \
  --network <network> \
  --key-name <keypair> \
  --image <image> \
  --security-group <security_group> \
  <vm_name>

Here is the breakdown of used commands:

  • openstack server create: The base command for creating a new virtual machine instance in OpenStack cloud environment.
  • --flavor <flavor>: Specifies the flavor (or instance type) for the new virtual machine to be created.
  • --network <network>: Specifies the network connected to the new VM being created. It can be a name or ID of the network.
  • --key-name <keypair>: Specifies the key pair to be injected into the server for SSH access. It should be already uploaded to OpenStack.
  • --image <image>: Specifies the image used to create an instance. It is a pre-configured OS image we uploaded earlier. You can use the name or ID of the image.
  • --security-group <security_group>: Specifies the security group associated with the instance that we are creating.
  • vm_name: Specifies the name assigned to the virtual machine being created. Any name can be used provided it fits your naming conventions.

Create Instance from openSUSE image template

Here is an example of commands run to create the virtual machine.

openstack server create \
  --flavor linux-basic-vps \
  --network public \
  --key-name cloudspinx \
  --image openSUSE-Leap-15.2 \
  --security-group allow_all \
  opensuse01

Wait for the server build process to complete and your instance will come online

+--------------------------------------+-----------------------------------------------------------+
| Field                                | Value                                                     |
+--------------------------------------+-----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                    |
| OS-EXT-AZ:availability_zone          |                                                           |
| OS-EXT-SRV-ATTR:host                 | None                                                      |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | None                                                      |
| OS-EXT-SRV-ATTR:instance_name        |                                                           |
| OS-EXT-STS:power_state               | NOSTATE                                                   |
| OS-EXT-STS:task_state                | scheduling                                                |
| OS-EXT-STS:vm_state                  | building                                                  |
| OS-SRV-USG:launched_at               | None                                                      |
| OS-SRV-USG:terminated_at             | None                                                      |
| accessIPv4                           |                                                           |
| accessIPv6                           |                                                           |
| addresses                            |                                                           |
| adminPass                            | 9REypiY6owVj                                              |
| config_drive                         |                                                           |
| created                              | 2024-07-05T23:09:10Z                                      |
| flavor                               | linux-basic-vps (10)                                      |
| hostId                               |                                                           |
| id                                   | f5882347-bd28-453c-8c80-983b869e4b1d                      |
| image                                | openSUSE-Leap-15.6 (dbe4bb98-3093-4858-9e1e-d4fb64f1c216) |
| key_name                             | jkmutai                                                   |
| name                                 | myserve01                                                 |
| os-extended-volumes:volumes_attached | []                                                        |
| progress                             | 0                                                         |
| project_id                           | 3dfc8a0aec3d409696daa2c825b85a3f                          |
| properties                           |                                                           |
| security_groups                      | name='7abe316b-ad8b-4dc0-9b18-d4bbe6781a96'               |
| status                               | BUILD                                                     |
| updated                              | 2024-07-05T23:09:10Z                                      |
| user_id                              | a381926a111e43d288f927baf92e78c8                          |
+--------------------------------------+-----------------------------------------------------------+

To list running instances in OpenStack run:

openstack server list

The default username is opensuse. SSH into the instance as opensuse user.

$ ssh [email protected]
openSUSE Leap 15.2 x86-64

As "root" use the:
  - zypper command for package management
  - yast command for configuration management

Have a lot of fun...
opensuse@myserve01:~>

We can switch to root user.

opensuse@myserve01:~> sudo su -
myserve01:~ #

Run upgrade of the OS

# zypper up
# zypper dist-upgrade -y

The OS can be rebooted after the upgrade.

sudo reboot

Upload SLES Qcow2 image to OpenStack

There are two ways to download:

Select Cloud or KVM Qcow2 image and download it. Below is the file alread downloaded.

$ ls SLES15-SP5-Minimal-VM.x86_64-Cloud-GM.qcow2
SLES15-SP5-Minimal-VM.x86_64-Cloud-GM.qcow2

Upload it to OpenStack Glance image service.

openstack image create \
    --container-format bare \
    --disk-format qcow2 \
    --file SLES15-SP5-Minimal-VM.x86_64-Cloud-GM.qcow2 \
    SLES15-SP5
wget https://download.opensuse.org/repositories/SUSE:/Templates:/Images:/SLE-15/images/SLES15-JeOS.x86_64-15.0-OpenStack-Cloud-Build3.59.qcow2

Upload the image to OpenStack once it’s downloaded.

openstack image create \
    --container-format bare \
    --disk-format qcow2 \
    --file SLES15-JeOS.x86_64-15.0-OpenStack-Cloud-Build3.59.qcow2 \
    SLES15-JeOS

On both options the default username is sles.

Create Instance from SLES image template

Confirm uploaded images list.

openstack image list

Next we create a VM instance from SLES Qcow2 image uploaded to OpenStack.

# Example 1 - using SLES15-SP5 image
openstack server create \
  --flavor linux-basic-vps \
  --network public \
  --key-name cloudspinx \
  --image SLES15-SP5 \
  --security-group allow_all \
  suseserver01

# Example 2 - using SLES15-JeOS image
openstack server create \
  --flavor linux-basic-vps \
  --network public \
  --key-name cloudspinx \
  --image SLES15-JeOS \
  --security-group allow_all \
suseserver02

Get a list of active instances on OpenStack

openstack server list

Login with the user sles

$ ssh sles@ServerIP
sles@suseserver01:~>

You can then connect to your SUSE account. Check the official website on:

And now you have SLES and openSUSE Cloud Qcow2 images uploaded to OpenStack. We also demonstrated how an instance can be created from the templates.

CloudSpinx is the best rated company offering various IT based consultancy services – from Linux, OpenStack, Infra Automations to Microservices and DevOps. Don’t hesitate to contact us and we will be happy to engage.

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

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

Related Post

Let’s clarify the differences between merge requests (commonly called pull requests in GitHub), releases, release candidates (RCs), tags, and branches […]

Kind (which in full means “Kubernetes IN Docker”), is a command line tool that enables you to run Kubernetes clusters […]

Are you looking for an easy way to migrate packages from one cPanel server to a new cPanel server? In […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.