Skip to content

Commit

Permalink
B #: Fix minor issues of Firecracker provision (#840)
Browse files Browse the repository at this point in the history
- set `opennebula_ssh_deploy_private_key` to make sure HVs can see each other.
- Add network hooks remote execution (clean)
- Rename Elastic.rb to elastic.rb
  • Loading branch information
Christian González committed Feb 18, 2021
1 parent 6c89879 commit f6e3c4e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ NETWORK_VCENTER_FILES="src/vnm_mad/remotes/vcenter/pre \
src/vnm_mad/remotes/vcenter/clean \
src/vnm_mad/remotes/vcenter/update_sg"

NETWORK_ELASTIC_FILES="src/vnm_mad/remotes/elastic/Elastic.rb \
NETWORK_ELASTIC_FILES="src/vnm_mad/remotes/elastic/elastic.rb \
src/vnm_mad/remotes/elastic/clean \
src/vnm_mad/remotes/elastic/post \
src/vnm_mad/remotes/elastic/pre \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
defaults:
configuration:
oneprovision_hypervisor: 'firecracker'

# required for copying recovery VM snaphosts to the replica host
opennebula_ssh_deploy_private_key: true
5 changes: 3 additions & 2 deletions src/vnm_mad/remotes/elastic/clean
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ $LOAD_PATH << File.dirname(__FILE__)
$LOAD_PATH << File.join(File.dirname(__FILE__), '..')
$LOAD_PATH << LIB_LOCATION + '/oneprovision/lib'

require 'Elastic'
require 'elastic'
require 'CommandManager'

template64 = STDIN.read
hostname = ARGV[0]
Expand All @@ -52,7 +53,7 @@ begin

drv.unassign

drv.run_hooks(ARGV, template64) if drv.deactivate == 0
drv.run_hooks_remote(ARGV, template64) if drv.deactivate == 0
rescue StandardError => e
OpenNebula.log_error(e.message)
OpenNebula.log_error(e.backtrace)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/vnm_mad/remotes/elastic/post
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $LOAD_PATH << File.dirname(__FILE__)
$LOAD_PATH << File.join(File.dirname(__FILE__), '..')
$LOAD_PATH << LIB_LOCATION + '/oneprovision/lib'

require 'Elastic'
require 'elastic'

template64 = STDIN.read

Expand Down
10 changes: 10 additions & 0 deletions src/vnm_mad/remotes/lib/vnm_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,16 @@ def run_hooks(args, stdin)
0
end

def run_hooks_remote(args, stdin)
hostname = args[0]

cmd = "run-parts #{$PROGRAM_NAME}.d".gsub('/var/lib/one/remotes',
'/var/tmp/one')
args.each {|arg| cmd << " --arg=\"#{arg}\"" }

SSHCommand.run(cmd, hostname, nil, stdin, 60)
end

private

# returns files sorted alphabetically
Expand Down

0 comments on commit f6e3c4e

Please sign in to comment.