Skip to content

fquesnel/vagrant-xenserver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant XenServer Provider

This is a Vagrant plugin that adds a XenServer provider, allowing Vagrant to control and provision machines on a XenServer host.

Dependencies

Installation

vagrant plugin install vagrant-xenserver

XenServer host setup

N.B. Currently this will only work on XenServer 6.5 and later:

# Install netcat
yum install --enablerepo=base,extras --disablerepo=citrix -y nc

You will also need to copy your ssh key to the Xenserver host:

ssh-copy-id root@xenserver

Make sure the default_SR is set, and that a VHD-based SR is in use. Currently the NFS SR is the recommended storage type.

Usage

Converting a VirtualBox box file

mkdir tmp
cd tmp
tar xvf ../virtualbox.box
  • Convert the disk image using qemu-img
qemu-img convert *.vmdk -O vpc box.vhd
  • Remove the other files
rm -f Vagrantfile box.ovf metadata.json 
  • Make a new metadata file
echo "{\"provider\": \"xenserver\"}" > metadata.json
  • Create the box:
tar cf ../xenserver.box .
  • Add the box:
vagrant box add ubuntu xenserver.box

Create a Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "ubuntu"

  config.vm.provider :xenserver do |xs|
  xs.xs_host = "st29.uk.xensource.com"
  xs.xs_username = "root"
  xs.xs_password = "xenroot"
  xs.pv = true
  xs.memory = 2048
  end
  config.vm.network "public_network", bridge: "xenbr0"
end

Note that by default there will be no connection to the external network, so most configurations will require a 'public_network' defined as in the above Vagrantfile. To bring the VM up, it should then be as simple as

vagrant up --provider=xenserver

About

A Vagrant provider for XenServer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%