1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

feature #1223: Send target_index as well to both attach and detach VMM commands

This commit is contained in:
Jaime Melis 2012-06-15 17:43:23 +02:00
parent da5a18a886
commit 1ddf0e281b
3 changed files with 20 additions and 3 deletions

View File

@ -516,6 +516,8 @@ class ExecDriver < VirtualMachineDriver
disk_xpath = "VM/TEMPLATE/DISK[DISK_ID='#{disk_id}']/TARGET"
target = ensure_xpath(xml_data, id, action, disk_xpath) || return
target_index = target.downcase[-1..-1].unpack('c').first - 97
action = VmmAction.new(self, id, :attach_disk, drv_message)
steps = [
@ -529,7 +531,12 @@ class ExecDriver < VirtualMachineDriver
{
:driver => :vmm,
:action => :attach_disk,
:parameters => [:deploy_id, :disk_target_path, target]
:parameters => [
:deploy_id,
:disk_target_path,
target,
target_index
]
}
]
@ -549,6 +556,8 @@ class ExecDriver < VirtualMachineDriver
disk_xpath = "VM/TEMPLATE/DISK[DISK_ID='#{disk_id}']/TARGET"
target = ensure_xpath(xml_data, id, action, disk_xpath) || return
target_index = target.downcase[-1..-1].unpack('c').first - 97
action = VmmAction.new(self, id, :detach_disk, drv_message)
steps = [
@ -556,7 +565,12 @@ class ExecDriver < VirtualMachineDriver
{
:driver => :vmm,
:action => :attach_disk,
:parameters => [:deploy_id, target]
:parameters => [
:deploy_id,
:disk_target_path,
target,
target_index
]
},
# Perform an EPILOG on the disk
{

View File

@ -22,6 +22,7 @@ source $(dirname $0)/../../scripts_common.sh
DOMAIN="$1"
SOURCE="$2"
TARGET="$3"
TARGET_INDEX="$4"
ATTACH_PARAMS="--domain $DOMAIN --source $SOURCE --target $TARGET"

View File

@ -20,7 +20,9 @@ source $(dirname $0)/kvmrc
source $(dirname $0)/../../scripts_common.sh
DOMAIN="$1"
TARGET="$2"
SOURCE="$2"
TARGET="$3"
TARGET_INDEX="$4"
DETACH_PARAMS="--domain $DOMAIN --target $TARGET"