2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# -*- mode: ruby -*-
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Vagrant.configure("2") do |config|
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									# Get the VagrantFile directory
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									vagrant_root = File.dirname(__FILE__)
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 20:35:29 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        	
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-17 16:18:30 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									# Trigger the Vagrant pre-up script before uping the first VM only
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 09:05:06 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									# Shell provisionner for all VMs
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-18 23:31:52 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									config.vm.provision "ceph-preflight", type: "shell", path: "scripts/provision.sh"
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									# All VMs are based on the same box
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 09:05:06 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									config.vm.box = "generic/ubuntu1804"
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-17 16:18:30 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									# Use nfs for shared folder
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									config.vm.synced_folder ".", "/vagrant",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  		nfs: true,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										linux__nfs_options: ['rw','no_subtree_check','all_squash','async'],
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										nfs_version: 4,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										nfs_udp: false
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									# Public host bridge
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									# config.vm.network "public_network", 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									#	network_name: "public-network",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									#	dev: "br0", 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									#	type: "bridge", 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									#	mode: "bridge"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									# Standard configuration for all VMs
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									config.vm.provider :libvirt do |libvirt|
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-18 23:31:52 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										libvirt.memory = 2048
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										libvirt.volume_cache = "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										libvirt.graphics_type = "spice"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										libvirt.video_type = "qxl"
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 20:35:29 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										libvirt.storage_pool_name="cephlab"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#		libvirt.snapshot_pool_name="cephlab"
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									# admin VM
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									config.vm.define "node-admin", primary: true do |admin|
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-16 00:14:48 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										admin.vm.hostname = "node-admin"
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-18 23:31:52 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										admin.vm.provision "ceph-install", type: "shell", keep_color: true, path: "scripts/provision-admin.sh"
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 09:05:06 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                admin.trigger.before :up do |trigger|
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                  trigger.run = {path: "scripts/pre-up.sh"}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                end
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									# osd1 VM with private cluster network
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-17 16:18:30 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									# 3 additional disks: 1 for journals and 2 for osd
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									config.vm.define "node-osd1" do |osd1|
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										osd1.vm.hostname = "node-osd1"
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										osd1.vm.network :private_network,
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-17 16:18:30 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											:type => "dhcp",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											:mac => "52:54:00:79:1e:b0",  
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      		:libvirt__dhcp_start => "172.28.128.10",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      		:libvirt__dhcp_stop => "172.28.128.250",
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											:libvirt__network_address => "172.28.128.0",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											:libvirt__netmask => "255.255.255.0",
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-17 16:18:30 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      		:libvirt__network_name => "cluster-network"
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										osd1.vm.provider :libvirt do |libvirt|
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											libvirt.storage :file, 
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 20:35:29 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												:size => "10G", 
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:type => "raw",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:cache => "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											libvirt.storage :file, 
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 20:35:29 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												:size => "10G", 
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:type => "raw",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:cache => "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											libvirt.storage :file, 
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 20:35:29 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												:size => "10G", 
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:type => "raw",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:cache => "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									# osd2 VM with private cluster network
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-17 16:18:30 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									# 3 additional disks: 1 for journals and 2 for osd
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-03 20:19:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									config.vm.define "node-osd2" do |osd2|
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										osd2.vm.hostname = "node-osd2"
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										osd2.vm.network :private_network,
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-17 16:18:30 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											:type => "dhcp",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											:mac => "52:54:00:dc:51:7c",  
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											:libvirt__network_name => "cluster-network"
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										osd2.vm.provider :libvirt do |libvirt|
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											libvirt.storage :file, 
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 20:35:29 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												:size => "10G", 
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:type => "raw",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:cache => "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											libvirt.storage :file, 
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 20:35:29 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												:size => "10G", 
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:type => "raw",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:cache => "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											libvirt.storage :file, 
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 20:35:29 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												:size => "10G", 
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:type => "raw",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												:cache => "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									end
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-23 20:35:29 +10:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        # osd3 VM with private cluster network
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        # 3 additional disks: 1 for journals and 2 for osd
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        config.vm.define "node-osd3" do |osd3|
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                osd3.vm.hostname = "node-osd3"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                osd3.vm.network :private_network,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        :type => "dhcp",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        :libvirt__network_name => "cluster-network"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                osd3.vm.provider :libvirt do |libvirt|
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        libvirt.storage :file,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                :size => "10G",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                :type => "raw",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                :cache => "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        libvirt.storage :file,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                :size => "10G",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                :type => "raw",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                :cache => "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        libvirt.storage :file,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                :size => "10G",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                :type => "raw",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                :cache => "writeback"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-12-01 16:30:45 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								end
							 |