summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaibin Huang <haibin.huang@intel.com>2019-09-03 10:27:42 +0800
committersonggongjun <gongjun.song@intel.com>2019-09-03 15:34:49 +0800
commit65c7c6a5801df1c118a87f8741bc06b67dfaa919 (patch)
tree3618a87fc4c530df146dcc71a193aa0032bb2a93
parentce4644f69838660c02afba6f6393e9705cddee40 (diff)
Merge onap and openstack_pike.
Issue-ID: MULTICLOUD-798 Signed-off-by: songgongjun <gongjun.song@intel.com> Change-Id: I13fe7461c0d9c173970b080cdd2cb73dbae930b0
-rw-r--r--pike/vagrant/Vagrantfile22
-rw-r--r--pike/vagrant/bootstrap.sh16
-rw-r--r--pike/vagrant/compute.conf20
-rw-r--r--pike/vagrant/control.conf29
-rwxr-xr-xpike/vagrant/create_vm.sh9
-rw-r--r--pike/vagrant/setup_compute.sh10
-rw-r--r--pike/vagrant/setup_control.sh7
7 files changed, 112 insertions, 1 deletions
diff --git a/pike/vagrant/Vagrantfile b/pike/vagrant/Vagrantfile
index d35f8abf..1de73afa 100644
--- a/pike/vagrant/Vagrantfile
+++ b/pike/vagrant/Vagrantfile
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 Intel Corporation.
+# Copyright (c) 2019 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+$num_compute_nodes = 1
+
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
@@ -25,6 +27,24 @@ Vagrant.configure("2") do |config|
vb.customize "post-boot",["controlvm", :id, "setlinkstate1", "on"]
end
+ config.vm.provision "shell", path: "bootstrap.sh", privileged: false
+
+ config.vm.define "control" do |config|
+ config.vm.hostname = "control"
+ config.vm.network "private_network", ip: "192.168.0.10"
+ config.vm.network :private_network, ip: "192.168.1.10"
+ config.vm.provision "shell", path: "setup_control.sh", privileged: false
+ end
+
+ (1 .. $num_compute_nodes).each do |n|
+ config.vm.define vm_name = "compute-#{n}" do |config|
+ config.vm.hostname = vm_name
+ config.vm.network "private_network", ip: "192.168.0.#{n+20}"
+ config.vm.network :private_network, ip: "192.168.1.#{n+20}"
+ config.vm.provision "shell", path: "setup_compute.sh", privileged: false
+ end
+ end
+
config.vm.define "onap" do |config|
config.vm.hostname = "onap"
config.vm.synced_folder "../..", "/openstack"
diff --git a/pike/vagrant/bootstrap.sh b/pike/vagrant/bootstrap.sh
new file mode 100644
index 00000000..6393353e
--- /dev/null
+++ b/pike/vagrant/bootstrap.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+set -e
+
+sudo apt-get update -y
+sudo apt-get install git -y
+git clone https://github.com/openstack-dev/devstack
+cd devstack; git checkout stable/pike
+sudo apt-get install openvswitch-switch -y
+sudo ovs-vsctl add-br br-ex
+ip=$(ip a s eth2 | grep inet | grep -v inet6 | sed "s/.*inet//" | cut -f2 -d' ')
+sudo ip address flush eth2
+sudo ovs-vsctl add-port br-ex eth2
+sudo ip a a $ip dev br-ex
+sudo ip link set dev br-ex up
+sudo ip link set dev eth2 up
diff --git a/pike/vagrant/compute.conf b/pike/vagrant/compute.conf
new file mode 100644
index 00000000..f6c19eaa
--- /dev/null
+++ b/pike/vagrant/compute.conf
@@ -0,0 +1,20 @@
+[[local|localrc]]
+SCREEN_LOGDIR=/opt/stack/log
+LOGFILE=stack.sh.log
+LOG_COLOR=False
+
+HOST_IP=HOSTIP
+HOST_NAME=HOSTNAME
+SERVICE_HOST=192.168.0.10
+SERVICE_HOST_NAME=control
+
+ADMIN_PASSWORD=admin
+SERVICE_PASSWORD=admin
+DATABASE_PASSWORD=mysql
+RABBIT_PASSWORD=rabbit
+
+ENABLED_SERVICES=rabbit,n-cpu,n-novnc,placement-client,q-agt
+LIBVIRT_TYPE=qemu
+
+OVS_BRIDGE_MAPPINGS=public:br-ex
+OVS_PHYSICAL_BRIDGE=br-ex
diff --git a/pike/vagrant/control.conf b/pike/vagrant/control.conf
new file mode 100644
index 00000000..5b551211
--- /dev/null
+++ b/pike/vagrant/control.conf
@@ -0,0 +1,29 @@
+[[local|localrc]]
+SCREEN_LOGDIR=/opt/stack/log
+LOGFILE=stack.sh.log
+LOG_COLOR=False
+
+HOST_IP=192.168.0.10
+HOST_NAME=control
+SERVICE_HOST=192.168.0.10
+SERVICE_HOST_NAME=control
+
+ADMIN_PASSWORD=admin
+SERVICE_PASSWORD=admin
+DATABASE_PASSWORD=mysql
+RABBIT_PASSWORD=rabbit
+
+enable_plugin heat https://git.openstack.org/openstack/heat stable/ocata
+disable_service n-net
+disable_service tempest
+ENABLED_SERVICES+=,placement-api,q-svc,q-dhcp,q-meta,q-l3
+ENABLED_SERVICES+=,h-eng,h-api,h-api-cfn,h-api-cw
+
+## Neutron options
+FLOATING_RANGE="192.168.1.0/24"
+PUBLIC_NETWORK_GATEWAY="192.168.1.1"
+FIXED_RANGE="10.0.0.0/24"
+Q_FLOATING_ALLOCATION_POOL=start=192.168.1.200,end=192.168.1.250
+Q_USE_SECGROUP=False
+Q_L3_ENABLED=True
+Q_USE_PROVIDERNET_FOR_PUBLIC=True
diff --git a/pike/vagrant/create_vm.sh b/pike/vagrant/create_vm.sh
new file mode 100755
index 00000000..c41c5dae
--- /dev/null
+++ b/pike/vagrant/create_vm.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+source ~/devstack/openrc admin admin
+nova-manage cell_v2 discover_hosts
+nova-manage cell_v2 map_cell_and_hosts
+netid=$(openstack network list --name private -f value | cut -f1 -d' ')
+openstack server create --flavor 1 --image=cirros-0.3.4-x86_64-uec --nic net-id=$netid vm1
diff --git a/pike/vagrant/setup_compute.sh b/pike/vagrant/setup_compute.sh
new file mode 100644
index 00000000..3fa0bc8f
--- /dev/null
+++ b/pike/vagrant/setup_compute.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+set -e
+
+cd devstack
+cp /vagrant/compute.conf local.conf
+ip=$(ip a s eth1 | grep inet | grep -v inet6 | sed "s/.*inet //" | cut -f1 -d'/')
+host=$(hostname)
+sed -i -e "s/HOSTIP/$ip/" -e "s/HOSTNAME/$host/" local.conf
+./stack.sh
diff --git a/pike/vagrant/setup_control.sh b/pike/vagrant/setup_control.sh
new file mode 100644
index 00000000..fb7ef8ac
--- /dev/null
+++ b/pike/vagrant/setup_control.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+set -e
+
+cd devstack
+cp /vagrant/control.conf local.conf
+./stack.sh