Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
documentation.suse.com / SUSE Linux Enterprise Server Documentation / Virtualization Guide / Managing Virtual Machines with libvirt / Managing Virtual Machines with Vagrant
Applies to SUSE Linux Enterprise Server 15 SP2

15 Managing Virtual Machines with Vagrant

Vagrant is a tool that provides a unified workflow for the creation, deployment and management of virtual development environments. The following sections describe how to manage virtual machines by using Vagrant.

15.1 Introduction to Vagrant

Vagrant provides an abstraction layer for various virtualization providers via a simple configuration file that allows developers and operators to quickly spin up a virtual machine (VM) running Linux or any other operating system.

15.1.1 Vagrant Concepts

Vagrant uses providers, provisioners, boxes, and Vagrantfiles as building blocks of the virtual machines.

Vagrant Terminology
Provider

Services to set up and create virtual environments. Vagrant ships with support for VirtualBox and Microsoft Hyper-V virtualization. Other services such as libvirt, VMware or AWS are supported via plugins.

Provisioner

Tools to customize the configuration of virtual environments. Vagrant has built built-in providers for uploading files, syncing directories or executing shell commands, but also supports configuration management systems such as Ansible, CFEngine, Chef, Puppet, and Salt.

Vagrantfile

Configuration file and file name (Vagrantfile) for virtual environments. It contains machine and software requirements and all necessary steps in order to create a development-ready box.

Box

Format and an extension (*.box) for virtual environments. Boxes can be downloaded from the Vagrant Cloud and copied from one machine to another in order to to replicate an environment.

SUSE provides official Vagrant Boxes for SUSE Linux Enterprise using the VirtualBox and libvirt providers. SUSE Linux Enterprise Server boxes are available for the AMD64/Intel 64 and AArch64 architectures, SUSE Linux Enterprise Desktop only for AMD64/Intel 64.

15.1.2 Vagrant Example

A new VM can be launched with Vagrant via the following set of commands. This example uses the official Vagrant box for openSUSE Tumbleweed which is available from the Vagrant Cloud.

Procedure 15.1: Creating a Vagrant environment with openSUSE Tumbleweed
  1. Download the Vagrant box for openSUSE Tumbleweed:

    vagrant init opensuse/Tumbleweed.x86_64

    This also registers the box with Vagrant and creates the Vagrantfile.

  2. (Optional) Edit the Vagrantfile to customize the environment.

  3. Start the box:

    vagrant up
  4. Access the box through ssh:

    vagrant ssh

15.2 Vagrant Boxes for SUSE Linux Enterprise

Starting with SUSE Linux Enterprise 15 SP2, SUSE provides official Vagrant boxes for SUSE Linux Enterprise using the VirtualBox and libvirt providers. SUSE Linux Enterprise Server boxes are available for the AMD64/Intel 64 and AArch64 architectures, SUSE Linux Enterprise Desktop only for AMD64/Intel 64.

These boxes come with the bare minimum of packages to reduce their size and are not registered, thus users need to register the boxes prior to further provisioning.

The boxes are only available for direct download from https://download.suse.com. Therefore, a downloaded box must be manually registered with Vagrant as follows:

vagrant box add --name SLES-15-SP2 \
   /path/to/SLES15-SP2-Vagrant.x86_64-15.2-libvirt-*.vagrant.libvirt.box

The box is then available under the name SLES-15-SP2 and can be used like other Vagrant boxes:

vagrant init SLES-15-SP2
vagrant up
vagrant ssh

15.3 Further Reading

For more information about Vagrant and it's configuration, refer to the official documentation at https://docs.vagrantup.com/.