Add vagrant as a contrib folder
This should enable quickly getting Searchlight up in a devstack env with a configured glance Change-Id: I007f003025eaddb97e49cc9c2ca46a3d89740c6e Co-Authored-By: Trinh Nguyen <dangtrinhnt@gmail.com>
This commit is contained in:
parent
bfc274fc4a
commit
3044cc35f3
77
contrib/vagrant/Vagrantfile
vendored
Normal file
77
contrib/vagrant/Vagrantfile
vendored
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
VAGRANTFILE_API_VERSION = "2"
|
||||||
|
GITCONFIG = `cat $HOME/.gitconfig`
|
||||||
|
|
||||||
|
Vagrant.require_version ">= 1.5"
|
||||||
|
|
||||||
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
|
config.ssh.forward_agent = true
|
||||||
|
|
||||||
|
config.vm.provider "virtualbox" do |vb, override|
|
||||||
|
vb.customize ["modifyvm", :id, "--memory", "6144"]
|
||||||
|
if not RUBY_PLATFORM.downcase.include?("mswin")
|
||||||
|
vb.customize ["modifyvm", :id, "--cpus", `awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp ]
|
||||||
|
end
|
||||||
|
vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
|
||||||
|
|
||||||
|
override.vm.synced_folder "../..", "/opt/stack/searchlight"
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.provider :libvirt do |lv, override|
|
||||||
|
lv.graphics_ip = '0.0.0.0'
|
||||||
|
lv.nested = true
|
||||||
|
lv.memory = 8192
|
||||||
|
if not RUBY_PLATFORM.downcase.include?("mswin")
|
||||||
|
lv.cpus = `awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp
|
||||||
|
end
|
||||||
|
|
||||||
|
override.vm.synced_folder ".", "/vagrant", type: "nfs"
|
||||||
|
override.vm.synced_folder "../..", "/opt/stack/searchlight", type: "nfs"
|
||||||
|
end
|
||||||
|
|
||||||
|
$script = <<SCRIPT
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Fixup permissions on /opt/stack/
|
||||||
|
sudo chown vagrant:vagrant /opt/stack/
|
||||||
|
|
||||||
|
# Copy over git config
|
||||||
|
cat << EOF > /home/vagrant/.gitconfig
|
||||||
|
#{GITCONFIG}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Clone DevStack
|
||||||
|
if [ ! -d "/home/vagrant/devstack" ]; then
|
||||||
|
git clone https://git.openstack.org/openstack-dev/devstack.git /home/vagrant/devstack
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install Vagrant localrc sample
|
||||||
|
cd /opt/stack/searchlight/contrib/vagrant
|
||||||
|
|
||||||
|
if [ ! -f "/home/vagrant/devstack/local.conf" ]; then
|
||||||
|
cp local.conf /home/vagrant/devstack/local.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
SCRIPT
|
||||||
|
|
||||||
|
config.vm.define "searchlight-ubuntu" do |ubuntu|
|
||||||
|
ubuntu.vm.box = "ubuntu/trusty64"
|
||||||
|
|
||||||
|
ubuntu.vm.network :private_network, ip: "192.168.27.100"
|
||||||
|
|
||||||
|
ubuntu.vm.provision :shell, :privileged => true, :inline => "DEBIAN_FRONTEND=noninteractive apt-get update"
|
||||||
|
ubuntu.vm.provision :shell, :privileged => true, :inline => "DEBIAN_FRONTEND=noninteractive apt-get install --yes git lvm2"
|
||||||
|
|
||||||
|
ubuntu.vm.provision :shell, :privileged => false, :inline => $script
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "searchlight-fedora" do |fedora|
|
||||||
|
fedora.vm.box = "box-cutter/fedora20"
|
||||||
|
|
||||||
|
fedora.vm.network :private_network, ip: "192.168.27.101"
|
||||||
|
|
||||||
|
fedora.vm.provision :shell, :privileged => true, :inline => "yum update -y vim-minimal" # RH Bug 1066983
|
||||||
|
fedora.vm.provision :shell, :privileged => true, :inline => "yum install -y git-core MySQL-python"
|
||||||
|
|
||||||
|
fedora.vm.provision :shell, :privileged => false, :inline => $script
|
||||||
|
end
|
||||||
|
end
|
77
contrib/vagrant/local.conf
Normal file
77
contrib/vagrant/local.conf
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
[[local|localrc]]
|
||||||
|
#########################
|
||||||
|
# General DevStack Config
|
||||||
|
# =======================
|
||||||
|
# IP Address for services to bind to (Should match IP from Vagrantfile)
|
||||||
|
HOST_IP=192.168.27.101
|
||||||
|
SERVICE_HOST=$HOST_IP
|
||||||
|
|
||||||
|
ADMIN_PASSWORD=devstack
|
||||||
|
MYSQL_PASSWORD=devstack
|
||||||
|
RABBIT_PASSWORD=devstack
|
||||||
|
SERVICE_PASSWORD=$ADMIN_PASSWORD
|
||||||
|
SERVICE_TOKEN=devstack
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
LOGFILE=$DEST/logs/stack.sh.log
|
||||||
|
VERBOSE=True
|
||||||
|
ENABLE_DEBUG_LOG_LEVEL=True
|
||||||
|
ENABLE_VERBOSE_LOG_LEVEL=True
|
||||||
|
|
||||||
|
# Enable Searchlight plugin
|
||||||
|
enable_plugin searchlight https://git.openstack.org/openstack/searchlight master
|
||||||
|
|
||||||
|
# Enable the basic services we require
|
||||||
|
enable_service rabbit mysql key
|
||||||
|
|
||||||
|
#############################
|
||||||
|
# Searchlight Devstack Config
|
||||||
|
# ===========================
|
||||||
|
# Enable Searchlight services
|
||||||
|
enable_service searchlight-api
|
||||||
|
enable_service searchlight-listener
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# Other Devstack Config
|
||||||
|
# =====================
|
||||||
|
# Optional TLS Proxy
|
||||||
|
#enable_service tls-proxy
|
||||||
|
|
||||||
|
# Optional Tempest
|
||||||
|
#enable_service tempest
|
||||||
|
|
||||||
|
# Optional Rally
|
||||||
|
#enable_service rally
|
||||||
|
|
||||||
|
# Optional Horizon
|
||||||
|
#enable_service horizon
|
||||||
|
|
||||||
|
# Optional Glance
|
||||||
|
enable_service g-api g-reg
|
||||||
|
|
||||||
|
# Optional Nova
|
||||||
|
#enable_service n-api n-cpu n-net n-cond n-sch n-novnc
|
||||||
|
|
||||||
|
# Optional Neutron
|
||||||
|
#disable_service n-net
|
||||||
|
#enable_service q-svc q-agt q-dhcp q-l3 q-meta
|
||||||
|
|
||||||
|
[[post-config|$NOVA_CONF]]
|
||||||
|
[DEFAULT]
|
||||||
|
notification_driver=messagingv2
|
||||||
|
notification_topics=searchlight_indexer
|
||||||
|
notify_on_state_change=vm_and_task_state
|
||||||
|
notify_on_any_change=True
|
||||||
|
instance_usage_audit=True
|
||||||
|
instance_usage_audit_period=hour
|
||||||
|
|
||||||
|
[[post-config|$NEUTRON_CONF]]
|
||||||
|
[DEFAULT]
|
||||||
|
notification_driver=messagingv2
|
||||||
|
notification_topics=searchlight_indexer
|
||||||
|
|
||||||
|
[[post-config|$GLANCE_API_CONF]]
|
||||||
|
[DEFAULT]
|
||||||
|
notification_driver=messagingv2
|
||||||
|
notification_topics=searchlight_indexer
|
||||||
|
rpc_backend = 'rabbit'
|
Loading…
Reference in New Issue
Block a user