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
  3. II Managing virtual machines with libvirt
    1. 7 Starting and stopping libvirtd
    2. 8 Preparing the VM Host Server
    3. 9 Guest installation
    4. 10 Basic VM Guest management
    5. 11 Connecting and authorizing
    6. 12 Advanced storage topics
    7. 13 Configuring virtual machines with Virtual Machine Manager
    8. 14 Configuring virtual machines with virsh
    9. 15 Managing virtual machines with Vagrant
    10. 16 Xen to KVM migration guide
  4. III Hypervisor-independent features
    1. 17 Disk cache modes
    2. 18 VM Guest clock settings
    3. 19 libguestfs
    4. 20 QEMU guest agent
    5. 21 Software TPM emulator
  5. IV Managing virtual machines with Xen
    1. 22 Setting up a virtual machine host
    2. 23 Virtual networking
    3. 24 Managing a virtualization environment
    4. 25 Block devices in Xen
    5. 26 Virtualization: configuration options and settings
    6. 27 Administrative tasks
    7. 28 XenStore: configuration database shared between domains
    8. 29 Xen as a high-availability virtualization host
    9. 30 Xen: converting a paravirtual (PV) guest into a fully virtual (FV/HVM) guest
  6. V Managing virtual machines with QEMU
    1. 31 QEMU overview
    2. 32 Setting up a KVM VM Host Server
    3. 33 Guest installation
    4. 34 Running virtual machines with qemu-system-ARCH
    5. 35 Virtual machine administration using QEMU monitor
  7. VI Troubleshooting
    1. 36 Integrated help and package documentation
    2. 37 Gathering system information and logs
  8. Glossary
  9. A Configuring GPU Pass-Through for NVIDIA cards
  10. B GNU licenses
Navigation
Applies to openSUSE Leap 15.3

15 Managing virtual machines with Vagrant Edit source

Abstract

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 Edit source

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 Edit source

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.

15.1.2 Vagrant example Edit source

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 Edit source

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

15.3 Further reading Edit source

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

Print this page