Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Puppet Module for Virtualization Management (Xen, KVM, OpenVZ)
branch: master

This branch is 229 commits behind carlasouza:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/puppet
manifests
templates
README.rst

README.rst

Puppet Virtualization Management Module

Puppet Module to manage virtual machines using libvirt.

Overview

This module provides a new type, virt, for virtual machines installation and management like ensure running and so on. All the operations will be made using libvirt [0]. At first, only Xen fullyvirtualization, Xen paravirtualization, KVM and OpenVZ will be supported.

This module is the result of my work at GSoC 2010.

[0] The Virtualization API - http://www.libvirt.org/

Usage

This is the full specification for the new types. All have the same fields:

virt { "name":
    desc            => "My first VM",
# Basic configuration
    memory          => 1024, # MB, changeable
    cpus            => 2, # Changeable
    arch            => x86_64 | i386,
    clocksync       => UTC | localtime | timezone | variable, # Clock source

# Boot configuration
    boot_localtion  => "/path/to/vmlinuz and initrd.img",
    boot_options    => "ks=foo noacpi" # Non changeable, controls, kickstart

    #For now, only the existing .img, .qcow2 and .qcow  files will be supported
    virt_path       => "/path/foo.img" | "/opt/virt_images/" | "/dev/sd4"

# Storage configuration
    disk_size       => 100000, # MB, not changeable

# OS specification
    os_type         => linux | other | solaris | unix | windows | hvm,
    os_variant      => solaris | debian | ubuntu | ...,  # The OS distribution (there's 37 types)
    tmpl_cache      => "debian-5.0-i386-minimal" | "fedora-13-x86_64" | ...,  # This only applies to OpenVZ guests

# Virtualization parameters
    virt_type       => kvm | xen-fullyvirt | xen-paravirt | openvz | qemu  # for libvirt provider, this field is mandatory

    * If you specify openvz as a type you'd like to create, the following fields
      are the minimum requirements: `name`, `memory`, `vcpu`, `tmpl_cache`, and `xml_file` *

# Network configuration
    interfaces      => [ "eth0", "eth1" ] | "disable" # Source host interface.

# VM behaviour
    autoboot        => true | false,
    ensure          => running | stopped | installed | absent, # Default value: running
    on_poweroff     => destroy | restart | preserv | rename-restart  # Default value: destroy
    on_reboot       => destroy | restart | preserv | rename-restart
    on_crash        => destroy | restart | preserv | rename-restart

# XML configuration
    # This will allow you to create a new guest from an already defined XML configuration file.
    xml_file        => "/etc/libvirt/qemu/name.xml"

    * When creating a new openvz container this option is required - note
      please that the xml file must be named after the VEID i.e. (/etc/libvirt/qemu/101.xml) *
}

Future Work

For now, some parameters will have a few values acceptable:
  • virtpath will accept only existing .img, .qcow and .qcow2 files;
  • memory and cpus will be, initially, not changeable;
  • input devices specification like mouse and graphic will not be supported for now.
  • if virt_type is openvz, providing both tmpl_cache and xml_file are required.
Something went wrong with that request. Please try again.