X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=Vagrantfile;h=ea8593d244c71adc6fad7cb0ff4aea8444f75e1c;hb=41776ab3743c491e4ff4c31e7a2ea48abe6451a2;hp=abc29f1e055986713b85168560d5d4dc9d0d2c65;hpb=95ca9e9192a22bb3172c373cdb611297fef5cfd6;p=icn.git diff --git a/Vagrantfile b/Vagrantfile index abc29f1..ea8593d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -18,7 +18,7 @@ with_jenkins = ENV['WITH_JENKINS'] || false # virtual environment is emulated by virtualbmc listening on the host. baremetal_cidr = nil registry_mirrors = nil -Dir.glob("deploy/site/#{site}/*.yaml") do |file| +Dir.glob("deploy/site/#{site}/deployment/*.yaml") do |file| YAML.load_stream(File.read(file)) do |document| values = document.fetch('spec', {}).fetch('values', {}) unless values['bmcAddress'].nil? @@ -34,6 +34,7 @@ if baremetal_cidr.nil? puts "Missing bmcAddress value in site definition, can't determine baremetal network address" exit 1 end +baremetal_gw = IPAddr.new(baremetal_cidr).succ $post_up_message = < "#{site}-provisioning", :type => 'dhcp' - # IPMI control of machines is provided by vbmc on the host + # BMC control of machines is provided by sushy-emulator on the host m.trigger.after [:up] do |trigger| - trigger.name = 'Starting virtualbmc for IPMI network' - trigger.run = {inline: "./tools/vagrant/start_vbmc.sh"} + trigger.name = 'Starting sushy for BMC network' + trigger.run = {inline: "./tools/vagrant/start_sushy.sh #{baremetal_gw}"} end m.trigger.after [:destroy] do |trigger| - trigger.name = 'Stopping virtualbmc for IPMI network' - trigger.run = {inline: "./tools/vagrant/stop_vbmc.sh"} + trigger.name = 'Stopping sushy for BMC network' + trigger.run = {inline: "./tools/vagrant/stop_sushy.sh #{baremetal_gw}"} end m.trigger.after [:up] do |trigger| @@ -132,16 +133,18 @@ Vagrant.configure("2") do |config| # the values dictionary. This will provide the values needed to # create the machine pool. legacy_machine_args = "" - Dir.glob("deploy/site/#{site}/*.yaml") do |file| + Dir.glob("deploy/site/#{site}/deployment/*.yaml") do |file| YAML.load_stream(File.read(file)) do |document| values = document.fetch('spec', {}).fetch('values', {}) next if values['machineName'].nil? || values['bootMACAddress'].nil? machine_name = values['machineName'] boot_mac_address = values['bootMACAddress'] bmc_port = URI.parse(values['bmcAddress']).port + uuid = URI.parse(values['bmcAddress']).path.split('/').last config.vm.define machine_name do |m| m.vm.hostname = machine_name m.vm.provider :libvirt do |libvirt| + libvirt.uuid = "#{uuid}" libvirt.graphics_ip = '0.0.0.0' libvirt.default_prefix = "#{site}-" libvirt.cpu_mode = 'host-passthrough' @@ -165,16 +168,6 @@ Vagrant.configure("2") do |config| m.vm.network :private_network, :libvirt__network_name => "#{site}-baremetal", :type => 'dhcp' - - # IPMI control - m.trigger.after [:up] do |trigger| - trigger.name = 'Adding machine to IPMI network' - trigger.run = {inline: "./tools/vagrant/add_machine_to_vbmc.sh #{site} #{machine_name} #{bmc_port}"} - end - m.trigger.after [:destroy] do |trigger| - trigger.name = 'Removing machine from IPMI network' - trigger.run = {inline: "./tools/vagrant/remove_machine_from_vbmc.sh #{site} #{machine_name} #{bmc_port}"} - end end end end