-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Vagrant files and scripts for HW installation (#150)
* Add vagrantfile * Change setup.sh file permission * Fix setup.sh * Add sudo command in setup.sh * Fix vagrantfile * create directory for each VM * Change vagrant file name and add run.sh file * Change vagrantfile name * Update run_vms.sh file to run each sh * Add vcmd shell script * Change vcmd sh permission * Add shell command for each Vagrantfile startup script * bugfix - fix ric Vagrantfile ID * Add true in inline command in Vagrantfile * Update Vagrantfiles and infra * Add vagrant halt and destroy scripts
- Loading branch information
1 parent
db4cb5c
commit b7203ea
Showing
19 changed files
with
259 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Run OMEC node | ||
pushd omec | ||
sudo vagrant destroy | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Run RAN node | ||
pushd ran | ||
sudo vagrant destroy | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Run RIC node | ||
pushd ric | ||
sudo vagrant destroy | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
./destroy_ran_vm.sh | ||
|
||
./destroy_ric_vm.sh | ||
|
||
./destroy_omec_vm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Run OMEC node | ||
pushd omec | ||
sudo vagrant halt | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Run RAN node | ||
pushd ran | ||
sudo vagrant halt | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Run RIC node | ||
pushd ric | ||
sudo vagrant halt | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
./halt_ran_vm.sh | ||
|
||
./halt_ric_vm.sh | ||
|
||
./halt_omec_vm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <[email protected]> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
Vagrant.configure(2) do |config| | ||
config.vm.define "omec" do |omec| | ||
omec.vm.box = "generic/ubuntu1804" | ||
omec.vm.disk :disk, size: "30GB", primary: true | ||
omec.vm.hostname = "omec" | ||
omec.vm.network :public_network, :dev => "br0", :ovs => true, :mode => "bridge", :type => "bridge" | ||
omec.vm.provider "libvirt" do |v| | ||
v.cpus = 4 | ||
v.memory = 8192 | ||
end | ||
|
||
omec.vm.provision "shell", inline: <<-SHELL | ||
sudo apt update -y | ||
sudo apt install -y software-properties-common python3-pip jq httpie ipvsadm ethtool | ||
sudo bash -c 'echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf' | ||
SHELL | ||
|
||
omec.vm.provision "shell", run: 'always', inline: <<-SHELL | ||
sudo ifconfig eth1 192.168.10.21/24 up || true | ||
route add -net 192.168.11.0/24 dev eth1 || true | ||
route add -net 192.168.13.0/24 dev eth1 || true | ||
SHELL | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <[email protected]> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
Vagrant.configure(2) do |config| | ||
config.vm.define "ran" do |ran| | ||
ran.vm.box = "generic/ubuntu1804" | ||
ran.vm.disk :disk, size: "30GB", primary: true | ||
ran.vm.hostname = "ran" | ||
ran.vm.network :public_network, :dev => "br0", :ovs => true, :mode => "bridge", :type => "bridge" | ||
ran.vm.provider "libvirt" do |v| | ||
v.cpus = 4 | ||
v.memory = 8192 | ||
end | ||
|
||
ran.vm.provision "shell", inline: <<-SHELL | ||
sudo apt update -y | ||
sudo apt install -y software-properties-common python3-pip jq httpie ipvsadm ethtool | ||
sudo bash -c 'echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf' | ||
SHELL | ||
|
||
ran.vm.provision "shell", run: 'always', inline: <<-SHELL | ||
sudo ifconfig eth1 192.168.13.21/24 up || true | ||
sudo route add -net 192.168.10.0/24 dev eth1 || true | ||
sudo route add -net 192.168.11.0/24 dev eth1 || true | ||
SHELL | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <[email protected]> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
Vagrant.configure(2) do |config| | ||
config.vm.define "ric" do |ric| | ||
ric.vm.box = "generic/ubuntu1804" | ||
ric.vm.disk :disk, size: "30GB", primary: true | ||
ric.vm.hostname = "ric" | ||
ric.vm.network :public_network, :dev => "br0", :ovs => true, :mode => "bridge", :type => "bridge" | ||
ric.vm.provider "libvirt" do |v| | ||
v.cpus = 4 | ||
v.memory = 8192 | ||
end | ||
|
||
ric.vm.provision "shell", inline: <<-SHELL | ||
sudo apt update -y | ||
sudo apt install -y software-properties-common python3-pip jq httpie ipvsadm ethtool | ||
sudo bash -c 'echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf' | ||
SHELL | ||
|
||
ric.vm.provision "shell", run: 'always', inline: <<-SHELL | ||
sudo ifconfig eth1 192.168.10.22/24 up || true | ||
route add -net 192.168.11.0/24 dev eth1 || true | ||
route add -net 192.168.13.0/24 dev eth1 || true | ||
SHELL | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Run OMEC node | ||
pushd omec | ||
sudo vagrant up | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Run RAN node | ||
pushd ran | ||
sudo vagrant up | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Run RIC node | ||
pushd ric | ||
sudo vagrant up | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
./run_ran_vm.sh | ||
|
||
./run_ric_vm.sh | ||
|
||
./run_omec_vm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
echo Install VM hypervisor and OpenVSwitch | ||
sudo apt update | ||
sudo apt install qemu libvirt-daemon-system libvirt-clients libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev ruby-libvirt ebtables dnsmasq-base qemu-kvm libvirt-bin bridge-utils virt-manager openvswitch-switch -y | ||
|
||
echo Install Vagrant | ||
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - | ||
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | ||
sudo apt-get update && sudo apt-get install vagrant -y | ||
|
||
echo Add Vagrant plugins | ||
vagrant plugin install vagrant-libvirt | ||
vagrant plugin install vagrant-mutate | ||
|
||
echo Add OVS | ||
sudo ovs-vsctl --may-exist add-br br0 | ||
sudo ovs-vsctl show | ||
|
||
./run_vms.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022-present Open Networking Foundation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
pushd $1 | ||
sudo vagrant $2 | ||
popd |