mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Remove EH installation from the core distribution
See http://dev.opennebula.org/projects/elastichosts in order to get the ElasticHosts drivers.
This commit is contained in:
parent
2bf89b9143
commit
de97b5d249
40
install.sh
40
install.sh
@ -150,9 +150,7 @@ SHARE_DIRS="$SHARE_LOCATION/examples \
|
||||
ETC_DIRS="$ETC_LOCATION/im_kvm \
|
||||
$ETC_LOCATION/im_xen \
|
||||
$ETC_LOCATION/im_ec2 \
|
||||
$ETC_LOCATION/im_eh \
|
||||
$ETC_LOCATION/vmm_ec2 \
|
||||
$ETC_LOCATION/vmm_eh \
|
||||
$ETC_LOCATION/vmm_sh \
|
||||
$ETC_LOCATION/tm_nfs \
|
||||
$ETC_LOCATION/tm_ssh \
|
||||
@ -242,20 +240,18 @@ INSTALL_OCCI_CLIENT_FILES[2]="OCCI_BIN_CLIENT_FILES:$BIN_LOCATION"
|
||||
|
||||
INSTALL_ETC_FILES[0]="ETC_FILES:$ETC_LOCATION"
|
||||
INSTALL_ETC_FILES[1]="VMM_EC2_ETC_FILES:$ETC_LOCATION/vmm_ec2"
|
||||
INSTALL_ETC_FILES[2]="VMM_EH_ETC_FILES:$ETC_LOCATION/vmm_eh"
|
||||
INSTALL_ETC_FILES[3]="VMM_SH_ETC_FILES:$ETC_LOCATION/vmm_sh"
|
||||
INSTALL_ETC_FILES[4]="IM_EC2_ETC_FILES:$ETC_LOCATION/im_ec2"
|
||||
INSTALL_ETC_FILES[5]="IM_EH_ETC_FILES:$ETC_LOCATION/im_eh"
|
||||
INSTALL_ETC_FILES[6]="TM_NFS_ETC_FILES:$ETC_LOCATION/tm_nfs"
|
||||
INSTALL_ETC_FILES[7]="TM_SSH_ETC_FILES:$ETC_LOCATION/tm_ssh"
|
||||
INSTALL_ETC_FILES[8]="TM_DUMMY_ETC_FILES:$ETC_LOCATION/tm_dummy"
|
||||
INSTALL_ETC_FILES[9]="TM_LVM_ETC_FILES:$ETC_LOCATION/tm_lvm"
|
||||
INSTALL_ETC_FILES[10]="HM_ETC_FILES:$ETC_LOCATION/hm"
|
||||
INSTALL_ETC_FILES[11]="AUTH_ETC_FILES:$ETC_LOCATION/auth"
|
||||
INSTALL_ETC_FILES[14]="ECO_ETC_FILES:$ETC_LOCATION"
|
||||
INSTALL_ETC_FILES[15]="ECO_ETC_TEMPLATE_FILES:$ETC_LOCATION/ec2query_templates"
|
||||
INSTALL_ETC_FILES[16]="OCCI_ETC_FILES:$ETC_LOCATION"
|
||||
INSTALL_ETC_FILES[17]="OCCI_ETC_TEMPLATE_FILES:$ETC_LOCATION/occi_templates"
|
||||
INSTALL_ETC_FILES[2]="VMM_SH_ETC_FILES:$ETC_LOCATION/vmm_sh"
|
||||
INSTALL_ETC_FILES[3]="IM_EC2_ETC_FILES:$ETC_LOCATION/im_ec2"
|
||||
INSTALL_ETC_FILES[4]="TM_NFS_ETC_FILES:$ETC_LOCATION/tm_nfs"
|
||||
INSTALL_ETC_FILES[5]="TM_SSH_ETC_FILES:$ETC_LOCATION/tm_ssh"
|
||||
INSTALL_ETC_FILES[6]="TM_DUMMY_ETC_FILES:$ETC_LOCATION/tm_dummy"
|
||||
INSTALL_ETC_FILES[7]="TM_LVM_ETC_FILES:$ETC_LOCATION/tm_lvm"
|
||||
INSTALL_ETC_FILES[8]="HM_ETC_FILES:$ETC_LOCATION/hm"
|
||||
INSTALL_ETC_FILES[9]="AUTH_ETC_FILES:$ETC_LOCATION/auth"
|
||||
INSTALL_ETC_FILES[10]="ECO_ETC_FILES:$ETC_LOCATION"
|
||||
INSTALL_ETC_FILES[11]="ECO_ETC_TEMPLATE_FILES:$ETC_LOCATION/ec2query_templates"
|
||||
INSTALL_ETC_FILES[12]="OCCI_ETC_FILES:$ETC_LOCATION"
|
||||
INSTALL_ETC_FILES[13]="OCCI_ETC_TEMPLATE_FILES:$ETC_LOCATION/occi_templates"
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Binary files, to be installed under $BIN_LOCATION
|
||||
@ -325,16 +321,12 @@ MADS_LIB_FILES="src/mad/sh/madcommon.sh \
|
||||
src/vmm_mad/sh/one_vmm_sh \
|
||||
src/vmm_mad/ec2/one_vmm_ec2.rb \
|
||||
src/vmm_mad/ec2/one_vmm_ec2 \
|
||||
src/vmm_mad/eh/one_vmm_eh.rb \
|
||||
src/vmm_mad/eh/one_vmm_eh \
|
||||
src/vmm_mad/dummy/one_vmm_dummy.rb \
|
||||
src/vmm_mad/dummy/one_vmm_dummy \
|
||||
src/im_mad/im_ssh/one_im_ssh.rb \
|
||||
src/im_mad/im_ssh/one_im_ssh \
|
||||
src/im_mad/ec2/one_im_ec2.rb \
|
||||
src/im_mad/ec2/one_im_ec2 \
|
||||
src/im_mad/eh/one_im_eh.rb \
|
||||
src/im_mad/eh/one_im_eh \
|
||||
src/im_mad/dummy/one_im_dummy.rb \
|
||||
src/im_mad/dummy/one_im_dummy \
|
||||
src/tm_mad/one_tm \
|
||||
@ -429,21 +421,16 @@ ETC_FILES="share/etc/oned.conf \
|
||||
#-------------------------------------------------------------------------------
|
||||
# Virtualization drivers config. files, to be installed under $ETC_LOCATION
|
||||
# - ec2, $ETC_LOCATION/vmm_ec2
|
||||
# - eh, $ETC_LOCATION/vmm_eh
|
||||
# - sh, $ETC_LOCATION/vmm_sh
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
VMM_EC2_ETC_FILES="src/vmm_mad/ec2/vmm_ec2rc \
|
||||
src/vmm_mad/ec2/vmm_ec2.conf"
|
||||
|
||||
VMM_EH_ETC_FILES="src/vmm_mad/eh/vmm_ehrc \
|
||||
src/vmm_mad/eh/vmm_eh.conf"
|
||||
|
||||
VMM_SH_ETC_FILES="src/vmm_mad/sh/vmm_shrc \
|
||||
src/vmm_mad/sh/vmm_sh_kvm.conf \
|
||||
src/vmm_mad/sh/vmm_sh_xen.conf"
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Information drivers config. files, to be installed under $ETC_LOCATION
|
||||
# - ec2, $ETC_LOCATION/im_ec2
|
||||
@ -452,9 +439,6 @@ VMM_SH_ETC_FILES="src/vmm_mad/sh/vmm_shrc \
|
||||
IM_EC2_ETC_FILES="src/im_mad/ec2/im_ec2rc \
|
||||
src/im_mad/ec2/im_ec2.conf"
|
||||
|
||||
IM_EH_ETC_FILES="src/im_mad/eh/im_ehrc \
|
||||
src/im_mad/eh/im_eh.conf"
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Storage drivers config. files, to be installed under $ETC_LOCATION
|
||||
# - nfs, $ETC_LOCATION/tm_nfs
|
||||
|
@ -1,7 +0,0 @@
|
||||
# Max memory that can be provided by ElasticHosts
|
||||
# These defaults allows for two machines with MEMORY=1024 and using 1 CPU
|
||||
|
||||
TOTAL_MEMORY=2048
|
||||
TOTAL_CPU=2
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
if [ -z "${ONE_LOCATION}" ]; then
|
||||
EHRC=/etc/one/im_eh/im_ehrc
|
||||
EHCONF=/etc/one/im_eh/im_eh.conf
|
||||
MADCOMMON=/usr/lib/one/mads/madcommon.sh
|
||||
VAR_LOCATION=/var/lib/one
|
||||
else
|
||||
EHRC=$ONE_LOCATION/etc/im_eh/im_ehrc
|
||||
EHCONF=$ONE_LOCATION/etc/im_eh/im_eh.conf
|
||||
MADCOMMON=$ONE_LOCATION/lib/mads/madcommon.sh
|
||||
VAR_LOCATION=$ONE_LOCATION/var
|
||||
fi
|
||||
|
||||
. $MADCOMMON
|
||||
|
||||
# Export the vmm_mad specific rc
|
||||
export_rc_vars $EHRC
|
||||
|
||||
# Export max instance type usages
|
||||
export_rc_vars $EHCONF
|
||||
|
||||
# Go to var directory ONE_LOCATION/var or /var/lib/one
|
||||
cd $VAR_LOCATION
|
||||
|
||||
# Execute the actual MAD
|
||||
execute_mad $*
|
@ -1,61 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
ONE_LOCATION=ENV["ONE_LOCATION"]
|
||||
|
||||
if !ONE_LOCATION
|
||||
RUBY_LIB_LOCATION="/usr/lib/one/ruby"
|
||||
else
|
||||
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
|
||||
end
|
||||
|
||||
$: << RUBY_LIB_LOCATION
|
||||
|
||||
require 'pp'
|
||||
require 'one_mad'
|
||||
|
||||
################
|
||||
# EC2 IM MAD #
|
||||
################
|
||||
|
||||
class IM < ONEMad
|
||||
|
||||
def initialize(sensors=nil)
|
||||
super(3, 4)
|
||||
end
|
||||
|
||||
def action_init(args)
|
||||
STDOUT.puts "INIT SUCCESS"
|
||||
STDOUT.flush
|
||||
end
|
||||
|
||||
def action_monitor(args)
|
||||
|
||||
totalmemory = ENV["TOTAL_MEMORY"].to_i
|
||||
totalcpu = 100 * ENV["TOTAL_CPU"].to_i
|
||||
|
||||
|
||||
STDOUT.puts "MONITOR SUCCESS " + args[1].to_s +
|
||||
"HOSTNAME=#{args[2]},TOTALMEMORY=#{totalmemory},TOTALCPU=#{totalcpu},CPUSPEED=1000,FREEMEMORY=#{totalmemory},FREECPU=#{totalcpu}"
|
||||
STDOUT.flush
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
im=IM.new(nil)
|
||||
im.loop
|
@ -1,38 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
if [ -z "${ONE_LOCATION}" ]; then
|
||||
DRIVERRC=/etc/one/vmm_eh/vmm_ehrc
|
||||
MADCOMMON=/usr/lib/one/mads/madcommon.sh
|
||||
VAR_LOCATION=/var/lib/one
|
||||
else
|
||||
DRIVERRC=$ONE_LOCATION/etc/vmm_eh/vmm_ehrc
|
||||
MADCOMMON=$ONE_LOCATION/lib/mads/madcommon.sh
|
||||
VAR_LOCATION=$ONE_LOCATION/var
|
||||
fi
|
||||
|
||||
. $MADCOMMON
|
||||
|
||||
# Export the vmm_mad specific rc
|
||||
export_rc_vars $DRIVERRC
|
||||
|
||||
# Go to ONE_LOCATION
|
||||
cd $VAR_LOCATION
|
||||
|
||||
# Execute the actual MAD
|
||||
execute_mad $*
|
@ -1,178 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
EHAUTH = ENV["EHAUTH"]
|
||||
|
||||
if !EHAUTH
|
||||
puts "EHAUTH not set"
|
||||
exit -1
|
||||
end
|
||||
|
||||
ONE_LOCATION=ENV["ONE_LOCATION"]
|
||||
|
||||
if !ONE_LOCATION
|
||||
RUBY_LIB_LOCATION="/usr/lib/one/ruby"
|
||||
else
|
||||
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
|
||||
end
|
||||
|
||||
$: << RUBY_LIB_LOCATION
|
||||
|
||||
require 'pp'
|
||||
require 'one_mad'
|
||||
require 'open3'
|
||||
|
||||
class DM < ONEMad
|
||||
|
||||
def initialize
|
||||
super(5, 4)
|
||||
end
|
||||
|
||||
def action_init(args)
|
||||
|
||||
send_message("INIT", "SUCCESS")
|
||||
|
||||
end
|
||||
|
||||
def action_deploy(args)
|
||||
|
||||
action_number=args[1]
|
||||
action_host=args[2]
|
||||
remote_deployment_file=args[3]
|
||||
|
||||
# Get local deployment file
|
||||
local_deployment_file=get_local_deployment_file(remote_deployment_file)
|
||||
|
||||
std_action("DEPLOY", "elastichosts -f #{local_deployment_file} servers create", args)
|
||||
|
||||
end
|
||||
|
||||
def action_shutdown(args)
|
||||
|
||||
std_action("SHUTDOWN", "elastichosts servers #{args[3]} shutdown", args)
|
||||
|
||||
end
|
||||
|
||||
def action_cancel(args)
|
||||
|
||||
std_action("SHUTDOWN", "elastichosts servers #{args[3]} destroy", args)
|
||||
|
||||
end
|
||||
|
||||
def action_checkpoint(args)
|
||||
|
||||
send_message("CHECKPOINT", "FAILURE", args[1], "action not supported for ElasticHost")
|
||||
|
||||
end
|
||||
|
||||
def action_save(args)
|
||||
|
||||
send_message("SAVE", "FAILURE", args[1], "action not supported for ElasticHost")
|
||||
|
||||
end
|
||||
|
||||
def action_restore(args)
|
||||
|
||||
send_message("RESTORE", "FAILURE", args[1], "action not supported for ElasticHost")
|
||||
|
||||
end
|
||||
|
||||
def action_poll(args)
|
||||
|
||||
std = Open3.popen3("elastichosts servers #{args[3]} info; echo ExitCode: $? 1>&2")
|
||||
|
||||
stdout=std[1].read
|
||||
stderr=std[2].read
|
||||
|
||||
exit_code=get_exit_code(stderr)
|
||||
|
||||
tx=0
|
||||
rx=0
|
||||
|
||||
if exit_code=="0"
|
||||
stdout.each_line{|line|
|
||||
cols=line.split(" ")
|
||||
case cols[0]
|
||||
when "rx"
|
||||
rx=cols[1]
|
||||
when "tx"
|
||||
tx=cols[1]
|
||||
end
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
send_message("POLL", "SUCCESS", args[1],"USEDCPU=0.0 NETTX=#{tx} NETRX=#{rx} USEDMEMORY=0")
|
||||
|
||||
end
|
||||
|
||||
###########################
|
||||
# Common action functions #
|
||||
###########################
|
||||
|
||||
def std_action(action, command, args)
|
||||
|
||||
std= Open3.popen3("#{command} ; echo ExitCode: $? 1>&2")
|
||||
|
||||
stdout=std[1].read
|
||||
stderr=std[2].read
|
||||
|
||||
exit_code=get_exit_code(stderr)
|
||||
|
||||
if exit_code=="0"
|
||||
domain_name=args[3]
|
||||
if action=="DEPLOY"
|
||||
remote_deployment_file=args[3]
|
||||
|
||||
# Get local deployment file
|
||||
local_deployment_file=get_local_deployment_file(remote_deployment_file)
|
||||
|
||||
domain_name = stdout
|
||||
end
|
||||
send_message(action, "SUCCESS", args[1], domain_name)
|
||||
else
|
||||
error_message=get_error_message(stderr)
|
||||
send_message(action, "FAILURE", args[1], error_message)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
#########################################
|
||||
# Get information form xm create output #
|
||||
#########################################
|
||||
|
||||
# From STDERR if exit code == 1
|
||||
def get_exit_code(str)
|
||||
tmp=str.scan(/^ExitCode:.*$/)[0]
|
||||
if tmp
|
||||
return tmp.split(' ')[1]
|
||||
else
|
||||
return -1
|
||||
end
|
||||
end
|
||||
|
||||
# From STDERR if exit code == 1
|
||||
def get_error_message(str)
|
||||
tmp=str.split(/\n/)
|
||||
return "Unknown error" if !tmp[0]
|
||||
tmp[0]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
dm=DM.new
|
||||
dm.loop
|
@ -1 +0,0 @@
|
||||
# Default configuration attributes for the ElasticHost driver
|
@ -1,25 +0,0 @@
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- ##
|
||||
|
||||
# May be needed in some setups
|
||||
# CLASSPATH=""
|
||||
|
||||
#
|
||||
# Note: elastichosts command line script (download it here http://www.elastichosts.com/downloads/elastichosts)
|
||||
# MUST be in the PATH
|
||||
#
|
||||
|
||||
EHAUTH="<user uuid>:<secret_key>"
|
Loading…
x
Reference in New Issue
Block a user