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' => '1.0-STAGING-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
26 'build_image' => 'True',
27 'clone_repo' => 'True',
28 'compile_repo' => 'False',
29 'enable_oparent' => 'True',
30 'skip_get_images' => 'False',
31 'skip_install' => 'True'
35 :virtualbox => 'ubuntu/trusty64',
36 :libvirt => 'sputnik13/trusty64',
43 :ips => ['10.252.0.6', "192.168.50.6"],
48 :groups => ["individual"],
52 :name => "all-in-one",
53 :ips => ['10.252.0.3', "192.168.50.3"],
58 :groups => ["all-in-one"],
59 :flavor => 'm1.xlarge',
60 :args => ['mr', 'sdc', 'aai', 'mso', 'robot', 'vid', 'sdnc', 'portal', 'dcae', 'policy', 'appc', 'vfc', 'ccsdk'],
64 :ips => ['10.252.0.14', "192.168.50.14"],
69 :groups => ["individual"],
74 :ips => ['10.252.0.14', "192.168.50.17"],
79 :groups => ["individual"],
84 :ips => ['10.252.0.12', "192.168.50.12"],
89 :groups => ["individual"],
94 :ips => ['10.252.0.3', "192.168.50.3"],
99 :groups => ["individual"],
100 :flavor => 'm1.small',
104 :name => "message-router",
105 :ips => ['10.252.0.4', "192.168.50.4"],
110 :groups => ["individual"],
115 :ips => ['10.252.0.7', "192.168.50.7"],
120 :groups => ["individual"],
124 :name => "multicloud",
125 :ips => ['10.252.0.16', "192.168.50.16"],
130 :groups => ["individual"],
131 :args => ["multicloud"],
135 :ips => ['10.252.0.13', "192.168.50.13"],
140 :groups => ["individual"],
145 :ips => ['10.252.0.11', "192.168.50.11"],
150 :groups => ["individual"],
155 :ips => ['10.252.0.8', "192.168.50.8"],
160 :groups => ["individual"],
165 :ips => ['10.252.0.5', "192.168.50.5"],
170 :groups => ["individual"],
175 :ips => ['10.252.0.10', "192.168.50.10"],
180 :groups => ["individual"],
185 :ips => ['10.252.0.3', "192.168.50.3"],
190 :groups => ["testing"],
191 :flavor => 'm1.small',
196 :ips => ['10.252.0.15', "192.168.50.15"],
201 :groups => ["individual"],
206 :ips => ['10.252.0.9', "192.168.50.9"],
211 :groups => ["individual"],
216 run_path = 'vagrant_utils/postinstall.sh'
217 sdc_volume = 'vol1-sdc-data.vdi'
219 Vagrant.require_version ">= 1.8.6"
221 # Determine the provider used
222 provider = (ENV['VAGRANT_DEFAULT_PROVIDER'] || :virtualbox).to_sym
223 puts "[INFO] Provider: #{provider} "
225 vd_conf = ENV.fetch('VD_CONF', 'etc/settings.yaml')
226 if File.exist?(vd_conf)
228 user_conf = YAML.load_file(vd_conf)
229 configuration.update(user_conf)
232 # Set network interface
233 net_interface = 'vboxnet0'
234 is_windows = Gem.win_platform?
236 net_interface = 'VirtualBox Host-Only Ethernet Adapter #2'
238 puts "[INFO] Net interface: #{net_interface}"
241 # If argument is given use it. Otherwise use Env: DEPLOY_MODE else use default
242 requested_machine = ARGV[1]
244 deploy_mode = ENV.fetch('DEPLOY_MODE', 'individual')
245 if requested_machine != nil
246 if requested_machine.include?("all-in-one") || requested_machine.include?("testing")
247 deploy_mode = requested_machine
251 # Catch the status of all machines
252 if ARGV[0] == 'status' || ARGV[0] == 'destroy'
256 puts "[INFO] Deploy Mode: #{deploy_mode}"
258 # In case of all-in-one or testing clean the nodes list
261 nodes.select! do |node|
262 if node[:name].include?("all-in-one")
268 nodes.select! do |node|
269 if node[:groups][0].include?("individual")
275 nodes.select! do |node|
276 if node[:name].include?("testing")
282 Vagrant.configure("2") do |config|
285 if ENV['http_proxy'] != nil and ENV['https_proxy'] != nil and ENV['no_proxy'] != nil
286 if not Vagrant.has_plugin?('vagrant-proxyconf')
287 system 'vagrant plugin install vagrant-proxyconf'
288 raise 'vagrant-proxyconf was installed but it requires to execute again'
290 config.proxy.http = ENV['http_proxy']
291 config.proxy.https = ENV['https_proxy']
292 config.proxy.no_proxy = ENV['no_proxy']
295 if Vagrant.has_plugin?('vagrant-vbguest')
296 puts 'vagrant-vbguest auto_update feature will be disable to avoid sharing conflicts'
297 config.vbguest.auto_update = false
300 if provider == :libvirt
301 if not Vagrant.has_plugin?('vagrant-libvirt')
302 system 'vagrant plugin install vagrant-libvirt'
303 raise 'vagrant-libvirt was installed but it requires to execute again'
307 if provider == :openstack
308 config.ssh.username = 'ubuntu'
309 if not Vagrant.has_plugin?('vagrant-openstack-provider')
310 system 'vagrant plugin install vagrant-openstack-provider'
311 raise 'vagrant-openstack-provider was installed but it requires to execute again'
316 config.vm.define node[:name] do |nodeconfig|
320 nodeconfig.vm.provider "virtualbox" do |vbox|
321 vbox.customize ['modifyvm', :id, '--nictype1', 'virtio']
322 vbox.customize ['modifyvm', :id, '--audio', 'none']
323 vbox.customize ['modifyvm', :id, '--vram', '1']
324 vbox.customize ['modifyvm', :id, "--cpuhotplug", "off"]
325 vbox.customize ['modifyvm', :id, "--cpuexecutioncap", node[:cpu]]
326 vbox.customize ['modifyvm', :id, "--cpus", node[:cpus]]
327 vbox.customize ["modifyvm", :id, "--memory", node[:ram]]
330 nodeconfig.vm.provider "libvirt" do |lbox|
331 lbox.memory = node[:ram]
335 nodeconfig.vm.provider :openstack do |obox|
336 obox.openstack_auth_url = ENV.fetch('OS_AUTH_URL', '')
337 obox.tenant_name = ENV.fetch('OS_TENANT_NAME', '')
338 obox.username = ENV.fetch('OS_USERNAME', '')
339 obox.password = ENV.fetch('OS_PASSWORD', '')
340 obox.region = ENV.fetch('OS_REGION_NAME', '')
341 obox.identity_api_version = ENV.fetch('OS_IDENTITY_API_VERSION', '')
342 obox.domain_name = ENV.fetch('OS_PROJECT_DOMAIN_ID', '')
343 obox.project_name = ENV.fetch('OS_PROJECT_NAME', '')
344 obox.floating_ip_pool = ENV.fetch('OS_FLOATING_IP_POOL', '')
345 obox.floating_ip_pool_always_allocate = (ENV['OS_FLOATING_IP_ALWAYS_ALLOCATE'] == 'true')
346 obox.image = ENV.fetch('OS_IMAGE', '')
347 obox.security_groups = [ENV.fetch('OS_SEC_GROUP', '')]
348 obox.networks = ENV.fetch('OS_NETWORK', '')
349 obox.flavor = node[:flavor]
350 obox.server_name = node[:name]
354 nodeconfig.vm.box = box[provider]
357 nodeconfig.vm.hostname = node[:name]
360 nodeconfig.vm.synced_folder ".", "/vagrant", disabled: true
361 nodeconfig.vm.synced_folder './opt', '/opt/', create: true
362 nodeconfig.vm.synced_folder './lib', '/var/onap/', create: true
364 nodeconfig.vm.synced_folder '~/.m2', '/root/.m2/', create: true
368 nodeconfig.vm.network :private_network,
370 :name => net_interface,
373 nodeconfig.vm.network :private_network,
375 :ip => node[:ips][1],
380 # Set Storage (For SDC or All-in-one)
381 if node[:name].include?("all-in-one") || node[:name].include?("sdc")
382 nodeconfig.vm.provider "virtualbox" do |v|
383 unless File.exist?(sdc_volume)
384 v.customize ['createhd', '--filename', sdc_volume, '--size', 20 * 1024]
386 v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', sdc_volume]
389 nodeconfig.vm.provider "libvirt" do |v|
390 v.storage :file, path: sdc_volume, bus: 'sata', device: 'vdb', size: '2G'
394 if node[:name].include? "testing"
395 nodeconfig.vm.synced_folder './tests', '/var/onap_tests/', create: true
396 test_suite = ENV.fetch('TEST_SUITE', '*')
397 test_case = ENV.fetch('TEST_CASE', '*')
399 run_path = 'vagrant_utils/unit_testing.sh'
400 node[:args] = [test_suite, test_case]
402 configuration['skip_get_images'] = ENV.fetch('SKIP_GET_IMAGES', configuration['skip_get_images'])
403 configuration['skip_install'] = ENV.fetch('SKIP_INSTALL', configuration['skip_install'])
406 if node[:name].include? "vfc"
407 nodeconfig.vm.provision 'docker'
410 nodeconfig.vm.provision 'shell' do |s|
413 s.env = configuration