aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-minimal-onap
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2020-01-24 17:52:23 +0100
committerPawel Wieczorek <p.wieczorek2@samsung.com>2020-01-29 17:12:32 +0100
commit3fbeaf029e392a829ab81ea7e87e18c90c58545f (patch)
treeca8ed907a45900dad54f189598226615738717aa /bootstrap/vagrant-minimal-onap
parent73862e4ea030de857927c23f8f88263f8d3365e3 (diff)
Increase minimal Worker storage size
At least 40GiB disk is required for Worker VM to store all necessary Docker images, otherwise it runs out of storage. VM resize can be done only during its creation (see "machine_virtual_size" [1]). VM data hashes no longer fitted in single lines nicely, hence they were broken into several lines. [1] https://github.com/vagrant-libvirt/vagrant-libvirt#domain-specific-options Issue-ID: ONAPARC-551 Change-Id: Ib267fd8097b51f53565e0c8f3be7c86c2b3c68ad Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'bootstrap/vagrant-minimal-onap')
-rw-r--r--bootstrap/vagrant-minimal-onap/Vagrantfile50
1 files changed, 45 insertions, 5 deletions
diff --git a/bootstrap/vagrant-minimal-onap/Vagrantfile b/bootstrap/vagrant-minimal-onap/Vagrantfile
index 3fe7322ab..e3b2c950d 100644
--- a/bootstrap/vagrant-minimal-onap/Vagrantfile
+++ b/bootstrap/vagrant-minimal-onap/Vagrantfile
@@ -20,11 +20,41 @@ vm_memory_onap = 20 * 1024
vm_cpu = 1
vm_cpus = 4
vm_box = "generic/ubuntu1804"
-
-operation = { name: 'operator', hostname: 'operator', ip: '172.17.4.254', cpus: vm_cpu, memory: vm_memory }
-devstack = { name: 'devstack', hostname: 'devstack', ip: '172.17.4.200', cpus: vm_cpu, memory: vm_memory_os }
-control = { name: 'control', hostname: 'control', ip: '172.17.4.100', cpus: vm_cpu, memory: vm_memory }
-worker = { name: 'worker', hostname: 'worker', ip: '172.17.4.101', cpus: vm_cpus, memory: vm_memory_onap }
+vm_disk = 32
+vm_disk_onap = 64
+
+operation = {
+ name: 'operator',
+ hostname: 'operator',
+ ip: '172.17.4.254',
+ cpus: vm_cpu,
+ memory: vm_memory,
+ disk: vm_disk
+}
+devstack = {
+ name: 'devstack',
+ hostname: 'devstack',
+ ip: '172.17.4.200',
+ cpus: vm_cpu,
+ memory: vm_memory_os,
+ disk: vm_disk
+}
+control = {
+ name: 'control',
+ hostname: 'control',
+ ip: '172.17.4.100',
+ cpus: vm_cpu,
+ memory: vm_memory,
+ disk: vm_disk
+}
+worker = {
+ name: 'worker',
+ hostname: 'worker',
+ ip: '172.17.4.101',
+ cpus: vm_cpus,
+ memory: vm_memory_onap,
+ disk: vm_disk_onap
+}
cluster = [] << control << worker
all = cluster.dup << operation << devstack
@@ -73,6 +103,14 @@ $install_make = <<-SCRIPT
apt-get install make
SCRIPT
+$resize_disk = <<-SCRIPT
+ DEV=${1:-sda}
+ PART=${2:-3}
+ echo ", +" | sfdisk -N "$PART" "/dev/$DEV" --no-reread
+ partprobe
+ resize2fs "/dev/${DEV}${PART}"
+SCRIPT
+
$generate_key = <<-SCRIPT
KEY_FILE="$1"
echo "Generating SSH key (${KEY_FILE})"
@@ -174,6 +212,7 @@ Vagrant.configure('2') do |config|
config.vm.provider :libvirt do |v|
v.memory = machine[:memory]
v.cpus = machine[:cpus]
+ v.machine_virtual_size = machine[:disk] # set at VM creation
end
config.vm.network :private_network, ip: machine[:ip]
@@ -194,6 +233,7 @@ Vagrant.configure('2') do |config|
if machine[:name] == 'worker'
config.vm.provision "customize_worker", type: :shell, path: "tools/imported/openstack-k8s-workernode.sh"
config.vm.provision "fix_group_worker", type: :shell, inline: $add_to_docker_group, args: vagrant_user
+ config.vm.provision "resize_disk", type: :shell, inline: $resize_disk
end
if machine[:name] == 'operator'