Vagrant StartCloud Plugin
A Vagrant plugin that provides support for provisioning machines using YAML configuration with multi-provider support.
Overview
This plugin allows you to define your Vagrant configuration in a YAML file (Hosts.yml) instead of a Ruby-based Vagrantfile. It supports both VirtualBox and Zones providers, and handles network configuration, disk management, shared folders, and more.
Installation
vagrant plugin install vagrant-startcloud
Usage
- Create a minimal Vagrantfile:
# Vagrantfile
Vagrant.configure('2') do |config|
StartCloud.configure(config)
end
- Define your configuration in Hosts.yml:
hosts:
- settings:
hostname: web
domain: example.com
server_id: "1001"
box: ubuntu/focal64
provider_type: virtualbox
memory: 2048
vcpus: 2
setup_wait: 300
vagrant_user: vagrant
networks:
- type: private_network
address: 192.168.56.10
netmask: 255.255.255.0
gateway: 192.168.56.1
dhcp4: false
autoconf: true
disks:
boot:
size: 40G
data:
size: 100G
mount: /data
folders:
- map: ./app
to: /var/www/app
type: rsync
owner: www-data
group: www-data
Configuration Reference
Settings
hostname
: VM hostnamedomain
: Domain nameserver_id
: Unique identifier for the VMbox
: Vagrant box to useprovider_type
: Provider to use (virtualbox or zones)memory
: Memory allocation in MBvcpus
: Number of virtual CPUssetup_wait
: Boot timeout in secondsvagrant_user
: SSH username
Networks
networks:
- type: private_network # or public_network
address: 192.168.56.10
netmask: 255.255.255.0
gateway: 192.168.56.1
dhcp4: false
autoconf: true
mac: "00:11:22:33:44:55" # optional
nic_type: "82540EM" # optional
Disks
disks:
boot:
size: 40G
additional_disks:
- volume_name: data
size: 100G
port: 1
Shared Folders
folders:
- map: ./local/path
to: /vm/path
type: rsync # or nfs, virtualbox
owner: vagrant
group: vagrant
mount_options: [] # optional
Provider-Specific Settings
VirtualBox
settings:
provider_type: virtualbox
show_console: false
firmware_type: UEFI # optional
vbox:
directives: # optional
- directive: usb
value: "on"
Zones
settings:
provider_type: zones
zones:
brand: bhyve
autostart: true
Converting from Traditional Vagrantfile
This plugin replaces complex Vagrantfile configurations with a structured YAML format. For example, instead of:
Vagrant.configure("2") do |config|
config.vm.define "web" do |web|
web.vm.box = "ubuntu/focal64"
web.vm.network "private_network", ip: "192.168.56.10"
web.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
end
end
You can use:
hosts:
- settings:
hostname: web
domain: example.com
box: ubuntu/focal64
provider_type: virtualbox
memory: 2048
vcpus: 2
networks:
- type: private_network
address: 192.168.56.10
License
AGPL-3.0