Skip to content

Commit

Permalink
adapt to new base image and use nfs instead of 9p with libvirt
Browse files Browse the repository at this point in the history
  • Loading branch information
ansiwen committed Nov 4, 2015
1 parent 16e0f83 commit e78ea46
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
25 changes: 10 additions & 15 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@
VAGRANTFILE_API_VERSION = "2" if not defined? VAGRANTFILE_API_VERSION

require 'yaml'
if File.file?('config.yaml')
conf = YAML.load_file('config.yaml')
else
raise "Configuration file 'config.yaml' does not exist."
end
conf = File.file?('config.yaml') ? YAML.load_file('config.yaml') : {}

if conf["local_git_repos"]
GIT_BASE = "/repos"
else
GIT_BASE = "https://git.openstack.org"
end
GIT_BASE = conf["local_git_repos"] ? "/repos" : "https://git.openstack.org"
LOCAL_CONF = conf["local_conf"] ? conf["local_conf"] : "local.conf.default"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "devstack-vm"
Expand Down Expand Up @@ -51,7 +44,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

#config.vm.synced_folder ".", "/vagrant", type: "nfs"
#config.vm.synced_folder ".", "/vagrant", type: "9p"
config.vm.synced_folder ".", "/vagrant", disabled: true
#config.vm.synced_folder ".", "/vagrant", disabled: true

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
Expand All @@ -63,8 +56,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
domain.cpus = 2
domain.nested = true
# domain.volume_cache = 'none'
override.vm.synced_folder ".", "/vagrant", type: "nfs"
if conf["local_git_repos"]
override.vm.synced_folder conf["local_git_repos"], "/repos", type: "9p"
override.vm.synced_folder conf["local_git_repos"], "/repos", type: "nfs"
end
end

Expand All @@ -75,6 +69,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# # Customize the amount of memory on the VM:
vb.memory = 4096
vb.cpus = 2
override.vm.synced_folder ".", "/vagrant"
if conf["local_git_repos"]
override.vm.synced_folder conf["local_git_repos"], "/repos"
end
Expand All @@ -94,6 +89,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.proxy.http = conf["http_proxy"]
config.proxy.https = conf["http_proxy"]
config.proxy.no_proxy = "localhost,127.0.0.1"
config.proxy.no_proxy += ",#{conf["devpi_server"]}" if conf["devpi_server"]
config.vm.provision "shell", inline: <<-SHELL
dnf install -y git
git config --system url."https://github.com/".insteadOf [email protected]:
Expand All @@ -107,8 +103,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

if conf["devpi_server"] && conf["devpi_port"] && conf["devpi_path"]
config.vm.provision "shell", inline: <<-SHELL
cat >/etc/pip.conf <<PIPCONF
[global]
cat >>/etc/pip.conf <<PIPCONF
index-url = http://#{conf["devpi_server"]}:#{conf["devpi_port"]}/#{conf["devpi_path"]}
trusted-host = #{conf["devpi_server"]}
PIPCONF
Expand All @@ -120,7 +115,7 @@ PIPCONF
git clone #{GIT_BASE}/openstack-dev/devstack
SHELL

config.vm.provision "file", source: "local.conf", destination: "devstack/local.conf"
config.vm.provision "file", source: LOCAL_CONF, destination: "devstack/local.conf"

config.vm.provision "shell", privileged: false, inline: <<-SHELL
cd devstack
Expand Down
9 changes: 5 additions & 4 deletions config.yaml.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### if you want to clone openstack from a local repo folder, set it here
### and make sure that the vm backend has read access to it.
### (on ferdora 22 with libvirt it helps to switch off SELinux)
#local_git_repos: ./repos
### set here which local.conf file you want to use for devstack
#local_conf: my_local.conf

### if you want to clone openstack from a local repo folder, set it here.
#local_git_repos: ../repos

### if you want to use an http proxy, install the vagrant-proxyconf plugin
### ('$ vagrant plugin install vagrant-proxyconf') and set the proxy here
Expand Down
7 changes: 4 additions & 3 deletions local.conf → local.conf.default
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[[local|localrc]]
DEST=/home/vagrant/stack
DATA_DIR=$DEST/data
DEST=/vagrant/openstack
DATA_DIR=/var/openstack
SERVICE_DIR=$DEST/status
SCREEN_LOGDIR=$DATA_DIR/logs/
LOGFILE=$DATA_DIR/logs/devstacklog.txt
VERBOSE=True
USE_SCREEN=True
WHEELHOUSE=/var/wheelhouse

RABBIT_PASSWORD=123456
MYSQL_PASSWORD=123456
Expand All @@ -21,7 +22,7 @@ FIXED_NETWORK_SIZE=256
VIRT_DRIVER=libvirt
LOG_COLOR=True

ENABLED_SERVICES=g-api,g-reg,key,n-api,n-cpu,n-sch,n-cond,mysql,rabbit,dstat,quantum,q-svc,q-agt,q-dhcp,q-l3,q-meta,horizon
ENABLED_SERVICES=g-api,g-reg,key,n-crt,n-api,n-cpu,n-sch,n-cond,mysql,rabbit,dstat,quantum,q-svc,q-agt,q-dhcp,q-l3,q-meta,horizon

IMAGE_URLS="http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img"
export YUM=dnf
Expand Down

0 comments on commit e78ea46

Please sign in to comment.