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

feature #1223: Add kvm attach_disk and detach_disk remote scripts

This commit is contained in:
Jaime Melis 2012-06-12 13:11:36 +02:00
parent 0866d4cbf2
commit 7fe0794c63
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,29 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, 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. #
#--------------------------------------------------------------------------- #
source $(dirname $0)/kvmrc
source $(dirname $0)/../../scripts_common.sh
DOMAIN="$1"
SOURCE="$2"
TARGET="$3"
ATTACH_PARAMS="--domain $DOMAIN --source $SOURCE --target $TARGET"
exec_and_log "virsh --connect $LIBVIRT_URI attach-disk $ATTACH_PARAMS" \
"Could not attach $SOURCE ($TARGET) to $DOMAIN"

View File

@ -0,0 +1,28 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, 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. #
#--------------------------------------------------------------------------- #
source $(dirname $0)/kvmrc
source $(dirname $0)/../../scripts_common.sh
DOMAIN="$1"
TARGET="$2"
DETACH_PARAMS="--domain $DOMAIN --target $TARGET"
exec_and_log "virsh --connect $LIBVIRT_URI detach-disk $DETACH_PARAMS" \
"Could not detach $TARGET from $DOMAIN"