Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
ContentsContents
Virtualization Guide
  1. Preface
  2. I Introduction
    1. 1 Virtualization technology
    2. 2 Virtualization scenarios
    3. 3 Introduction to Xen virtualization
    4. 4 Introduction to KVM virtualization
    5. 5 Virtualization tools
    6. 6 Installation of virtualization components
    7. 7 Virtualization limits and support
  3. II Managing virtual machines with libvirt
    1. 8 Starting and stopping libvirtd
    2. 9 Preparing the VM Host Server
    3. 10 Guest installation
    4. 11 Basic VM Guest management
    5. 12 Connecting and authorizing
    6. 13 Advanced storage topics
    7. 14 Configuring virtual machines with Virtual Machine Manager
    8. 15 Configuring virtual machines with virsh
    9. 16 Managing virtual machines with Vagrant
    10. 17 Xen to KVM migration guide
  4. III Hypervisor-independent features
    1. 18 Disk cache modes
    2. 19 VM Guest clock settings
    3. 20 libguestfs
    4. 21 QEMU guest agent
    5. 22 Software TPM emulator
  5. IV Managing virtual machines with Xen
    1. 23 Setting up a virtual machine host
    2. 24 Virtual networking
    3. 25 Managing a virtualization environment
    4. 26 Block devices in Xen
    5. 27 Virtualization: configuration options and settings
    6. 28 Administrative tasks
    7. 29 XenStore: configuration database shared between domains
    8. 30 Xen as a high-availability virtualization host
    9. 31 Xen: converting a paravirtual (PV) guest into a fully virtual (FV/HVM) guest
  6. V Managing virtual machines with QEMU
    1. 32 QEMU overview
    2. 33 Setting up a KVM VM Host Server
    3. 34 Guest installation
    4. 35 Running virtual machines with qemu-system-ARCH
    5. 36 Virtual machine administration using QEMU monitor
  7. Glossary
  8. A Virtual machine drivers
  9. B Configuring GPU Pass-Through for NVIDIA cards
  10. C XM, XL toolstacks, and the libvirt framework
  11. D GNU licenses
Navigation
Applies to SUSE Linux Enterprise Server 15 SP3

16 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.

16.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.

16.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 plug-ins.

Provisioner

Tools to customize the configuration of virtual environments. Vagrant has built built-in providers for uploading files, synchronizing 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 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.

16.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 16.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

16.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-SP3 \
   /path/to/SLES15-SP3-Vagrant.x86_64-15.3-libvirt-*.vagrant.libvirt.box

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

vagrant init SLES-15-SP3
vagrant up
vagrant ssh

16.3 Further reading

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

Print this page