Showing posts with label VM. Show all posts
Showing posts with label VM. Show all posts

Jan 29, 2020

Instant Fresh openSUSE Tumbleweed with Docker and Vagrant Images

On my machines I run openSUSE Leap (download), a stable distribution that follows the SUSE Linux Enterprise service packs. But frequently my task is to reproduce or fix a bug in openSUSE Tumbleweed (download), the hottest rolling distribution.

In the past, I would take an ISO image of the installation DVD and install a virtual machine from scratch. (To say nothing about burning a CD, copying a boot floppy, and reinstalling a physical machine. I've been doing this for too long.)

Fortunately, things got easier with ready-made disk images for containers (Docker/Podman) and virtual machines (Vagrant).

With Docker

Get the latest Tumbleweed image from the Docker hub:

$ docker pull opensuse/tumbleweed

Run it:

$ docker run -it opensuse/tumbleweed bash
8484d09e2380:/ # grep VERSION_ID /etc/os-release
VERSION_ID="20200118"
8484d09e2380:/ # ...
...
8484d09e2380:/ # exit

Clean up, removing the container or even the Tumbleweed image:

$ docker ps -a
CONTAINER ID   IMAGE               COMMAND  CREATED          STATUS                     PORTS NAMES
8484d09e2380   opensuse/tumbleweed "bash"   58 minutes ago   Exited (127) 9 seconds ago       hungry_northcutt
$ docker rm 8484d09e2380
8484d09e2380
$ docker rmi opensuse/tumbleweed:latest 

With Vagrant

Vagrant virtual machines work with a context directory and a config file, so let's create them:

$ mkdir vagrant-tw-test; cd $_
$ vagrant init opensuse/Tumbleweed.x86_64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` [...]

The up step downloads the base image ("box") that we declared previously, and brings up our VM instance. The ssh step connects there.

$ vagrant up
[...]
$ vagrant ssh
> grep VERSION_ID /etc/os-release 
VERSION_ID="20200114"
> ...
...
> exit

Clean up:

$ vagrant halt     # stop the VM
$ vagrant destroy  # remove its disk image
$ vagrant prune    # remove the box (base image)

See details in Meike Chabowski's article Vagrant Boxes with openSUSE Tumbleweed.

Jun 30, 2010

kiwi2puppet

I have started working on kiwi2puppet, a tool to convert KIWI image descriptions to Puppet manifests.

The goal is to recycle the data that went into the building of an image and use it for managing a deployed appliance.

So far it is a prototype that can write these resources
  • package
  • yumrepo
  • user
  • group
It is written in Ruby, like Puppet.

Source at GitHub: http://github.com/mvidner/kiwi2puppet
RPMs: http://software.opensuse.org/search?q=kiwi2puppet&baseproject=ALL (currently it is a single Ruby script, so at the moment RPMs are not worth any trouble)
Novell Reference: FATE#309497

Get in touch if you're interested.

In case you didn't know:
"The openSUSE KIWI Image System provides a complete operating system image solution for Linux supported hardware platforms as well as for virtualisation systems like Xen Qemu or VMware."
"Puppet is an open source data center automation and configuration management framework. Puppet provides system administrators with a simplified platform that allows for consistent, transparent, and flexible systems management."