5 # Generic parameters used across all ONAP components
6 'key_name' => 'ecomp_key',
8 'nexus_repo' => 'https://nexus.onap.org/content/sites/raw',
9 'nexus_repo_root' => 'https://nexus.onap.org',
10 'nexus_url_snapshot' => 'https://nexus.onap.org/content/repositories/snapshots',
11 'nexus_docker_repo' => 'nexus3.onap.org:10001',
12 'nexus_username' => 'docker',
13 'nexus_password' => 'docker',
14 'dmaap_topic' => 'AUTO',
15 'artifacts_version' => '1.0.0',
16 'docker_version' => 'latest',
17 # Parameters for DCAE instantiation
18 'dcae_zone' => 'iad4',
20 'openstack_tenant_id' => '',
21 'openstack_username' => '',
22 'openstack_api_key' => '',
23 'openstack_password' => '',
24 'odl_version' => '0.5.3-Boron-SR3',
25 # Parameters for enabling features
27 'build_image' => 'True',
28 'clone_repo' => 'True',
29 'compile_repo' => 'False',
30 'enable_oparent' => 'True',
31 'skip_get_images' => 'False',
32 'skip_install' => 'True'
36 :virtualbox => 'ubuntu/trusty64',
37 :libvirt => 'elastic/ubuntu-14.04-x86_64',
44 :ips => ['10.252.0.6', "192.168.50.6"],
49 :groups => ["individual"],
53 :name => "all-in-one",
54 :ips => ['10.252.1.3', "192.168.51.3"],
59 :groups => ["all-in-one"],
60 :flavor => 'm1.xlarge',
61 :args => ['mr', 'sdc', 'aai', 'mso', 'robot', 'vid', 'sdnc', 'portal', 'dcae', 'policy', 'appc', 'vfc', 'ccsdk', 'multicloud', 'vnfsdk', 'vpp', 'msb'],
65 :ips => ['10.252.0.14', "192.168.50.14"],
70 :groups => ["individual"],
75 :ips => ['10.252.0.19', "192.168.50.19"],
80 :groups => ["individual"],
85 :ips => ['10.252.0.12', "192.168.50.12"],
90 :groups => ["individual"],
95 :ips => ['10.252.0.3', "192.168.50.3"],
100 :groups => ["individual"],
101 :flavor => 'm1.small',
105 :name => "message-router",
106 :ips => ['10.252.0.4', "192.168.50.4"],
111 :groups => ["individual"],
116 :ips => ['10.252.0.20', "192.168.50.20"],
121 :groups => ["individual"],
126 :ips => ['10.252.0.7', "192.168.50.7"],
131 :groups => ["individual"],
135 :name => "multicloud",
136 :ips => ['10.252.0.16', "192.168.50.16"],
141 :groups => ["individual"],
142 :args => ["multicloud"],
146 :ips => ['10.252.0.13', "192.168.50.13"],
151 :groups => ["individual"],
156 :ips => ['10.252.0.11', "192.168.50.11"],
161 :groups => ["individual"],
166 :ips => ['10.252.0.8', "192.168.50.8"],
171 :groups => ["individual"],
176 :ips => ['10.252.0.5', "192.168.50.5"],
181 :groups => ["individual"],
186 :ips => ['10.252.0.10', "192.168.50.10"],
191 :groups => ["individual"],
196 :ips => ['10.252.2.3', "192.168.52.3"],
201 :groups => ["testing"],
202 :flavor => 'm1.small',
207 :ips => ['10.252.0.15', "192.168.50.15"],
212 :groups => ["individual"],
217 :ips => ['10.252.0.9', "192.168.50.9"],
222 :groups => ["individual"],
227 :ips => ['10.252.0.18', "192.168.50.18"],
232 :groups => ["individual"],
237 :ips => ['10.252.0.17', "192.168.50.17"],
242 :groups => ["individual"],
246 :name => "openstack",
247 :ips => ['10.252.3.3', "192.168.53.3"],
252 :groups => ["individual"],
253 :args => ['openstack'],
257 run_path = 'vagrant_utils/postinstall.sh'
258 sdc_volume = 'vol1-sdc-data.vdi'
260 Vagrant.require_version ">= 1.8.6"
262 # Determine the provider used
263 provider = (ENV['VAGRANT_DEFAULT_PROVIDER'] || :virtualbox).to_sym
264 puts "[INFO] Provider: #{provider} "
266 vd_conf = ENV.fetch('VD_CONF', 'etc/settings.yaml')
267 if File.exist?(vd_conf)
269 user_conf = YAML.load_file(vd_conf)
270 configuration.update(user_conf)
273 # Set network interface
274 net_interface = 'vboxnet0'
275 is_windows = Gem.win_platform?
277 net_interface = 'VirtualBox Host-Only Ethernet Adapter #2'
279 puts "[INFO] Net interface: #{net_interface}"
282 # If argument is given use it. Otherwise use Env: DEPLOY_MODE else use default
283 requested_machine = ARGV[1]
285 deploy_mode = ENV.fetch('DEPLOY_MODE', 'individual')
286 if requested_machine != nil
287 if requested_machine.include?("all-in-one") || requested_machine.include?("testing")
288 deploy_mode = requested_machine
292 # Catch the status of all machines
293 if ARGV[0] == 'status' || ARGV[0] == 'destroy'
297 puts "[INFO] Deploy Mode: #{deploy_mode}"
299 # In case of all-in-one or testing clean the nodes list
302 nodes.select! do |node|
303 if node[:name].include?("all-in-one")
309 nodes.select! do |node|
310 if node[:groups][0].include?("individual")
316 nodes.select! do |node|
317 if node[:name].include?("testing")
323 Vagrant.configure("2") do |config|
326 if ENV['http_proxy'] != nil and ENV['https_proxy'] != nil and ENV['no_proxy'] != nil
327 if not Vagrant.has_plugin?('vagrant-proxyconf')
328 system 'vagrant plugin install vagrant-proxyconf'
329 raise 'vagrant-proxyconf was installed but it requires to execute again'
331 config.proxy.http = ENV['http_proxy']
332 config.proxy.https = ENV['https_proxy']
333 config.proxy.no_proxy = ENV['no_proxy']
334 configuration['socks_proxy'] = ENV['socks_proxy']
337 if Vagrant.has_plugin?('vagrant-vbguest')
338 puts 'vagrant-vbguest auto_update feature will be disable to avoid sharing conflicts'
339 config.vbguest.auto_update = false
342 if provider == :libvirt
343 if not Vagrant.has_plugin?('vagrant-libvirt')
344 system 'vagrant plugin install vagrant-libvirt'
345 raise 'vagrant-libvirt was installed but it requires to execute again'
349 if provider == :openstack
350 config.ssh.username = 'ubuntu'
351 if not Vagrant.has_plugin?('vagrant-openstack-provider')
352 system 'vagrant plugin install vagrant-openstack-provider'
353 raise 'vagrant-openstack-provider was installed but it requires to execute again'
358 config.vm.define node[:name] do |nodeconfig|
362 nodeconfig.vm.provider "virtualbox" do |vbox|
363 vbox.customize ['modifyvm', :id, '--nictype1', 'virtio']
364 vbox.customize ['modifyvm', :id, '--audio', 'none']
365 vbox.customize ['modifyvm', :id, '--vram', '1']
366 vbox.customize ['modifyvm', :id, "--cpuhotplug", "off"]
367 vbox.customize ['modifyvm', :id, "--cpuexecutioncap", node[:cpu]]
368 vbox.customize ['modifyvm', :id, "--cpus", node[:cpus]]
369 vbox.customize ["modifyvm", :id, "--memory", node[:ram]]
372 nodeconfig.vm.network :private_network,
374 :name => net_interface,
377 nodeconfig.vm.network :private_network,
379 :ip => node[:ips][1],
383 nodeconfig.vm.provider "libvirt" do |lbox|
384 lbox.memory = node[:ram]
386 lbox.cpu_mode = 'host-passthrough'
389 nodeconfig.vm.network :private_network,
392 nodeconfig.vm.network :private_network,
393 :ip => node[:ips][1],
397 nodeconfig.vm.provider :openstack do |obox|
398 obox.openstack_auth_url = ENV.fetch('OS_AUTH_URL', '')
399 obox.tenant_name = ENV.fetch('OS_TENANT_NAME', '')
400 obox.username = ENV.fetch('OS_USERNAME', '')
401 obox.password = ENV.fetch('OS_PASSWORD', '')
402 obox.region = ENV.fetch('OS_REGION_NAME', '')
403 obox.identity_api_version = ENV.fetch('OS_IDENTITY_API_VERSION', '')
404 obox.domain_name = ENV.fetch('OS_PROJECT_DOMAIN_ID', '')
405 obox.project_name = ENV.fetch('OS_PROJECT_NAME', '')
406 obox.floating_ip_pool = ENV.fetch('OS_FLOATING_IP_POOL', '')
407 obox.floating_ip_pool_always_allocate = (ENV['OS_FLOATING_IP_ALWAYS_ALLOCATE'] == 'true')
408 obox.image = ENV.fetch('OS_IMAGE', '')
409 obox.security_groups = [ENV.fetch('OS_SEC_GROUP', '')]
410 obox.networks = ENV.fetch('OS_NETWORK', '')
411 obox.flavor = node[:flavor]
412 obox.server_name = node[:name]
416 if "openstack" == node[:name]
418 :virtualbox => 'ubuntu/xenial64',
419 :libvirt => 'elastic/ubuntu-16.04-x86_64'
422 nodeconfig.vm.box = box[provider]
425 nodeconfig.vm.hostname = node[:name]
428 nodeconfig.vm.synced_folder ".", "/vagrant", disabled: true
429 nodeconfig.vm.synced_folder './opt', '/opt/', create: true
430 nodeconfig.vm.synced_folder './lib', '/var/onap/', create: true
432 nodeconfig.vm.synced_folder '~/.m2', '/root/.m2/', create: true
437 # Set Storage (For SDC or All-in-one)
438 if node[:name].include?("all-in-one") || node[:name].include?("sdc")
439 nodeconfig.vm.provider "virtualbox" do |v|
440 unless File.exist?(sdc_volume)
441 v.customize ['createhd', '--filename', sdc_volume, '--size', 20 * 1024]
443 v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', sdc_volume]
446 nodeconfig.vm.provider "libvirt" do |v|
447 v.storage :file, path: sdc_volume, bus: 'sata', device: 'vdb', size: '2G'
451 if node[:name].include? "testing"
452 nodeconfig.vm.synced_folder './tests', '/var/onap_tests/', create: true
453 test_suite = ENV.fetch('TEST_SUITE', '*')
454 test_case = ENV.fetch('TEST_CASE', '*')
456 run_path = 'vagrant_utils/unit_testing.sh'
457 node[:args] = [test_suite, test_case]
459 configuration['skip_get_images'] = ENV.fetch('SKIP_GET_IMAGES', configuration['skip_get_images'])
460 configuration['skip_install'] = ENV.fetch('SKIP_INSTALL', configuration['skip_install'])
463 if node[:name].include? "vfc"
464 nodeconfig.vm.provision 'docker'
467 nodeconfig.vm.provision 'shell' do |s|
470 s.env = configuration