one icon indicating copy to clipboard operation
one copied to clipboard

Missing docs for TM failmigrate script

Open feldsam opened this issue 6 years ago • 1 comments

Hello, I find out, that there is not documented TM failmigrate script.

feldsam avatar Nov 14 '19 22:11 feldsam

I think, that following script can be used as default

#!/bin/bash

# -------------------------------------------------------------------------- #
# Copyright 2019, FeldHostâ„¢ (feldhost.net)                                   #
#                                                                            #
# Portions copyright 2014-2016, Laurent Grawet <[email protected]>               #
# Portions copyright OpenNebula Project (OpenNebula.org), CG12 Labs          #
#                                                                            #
# 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.                                             #
# -------------------------------------------------------------------------- #

# FAILMIGRATE SOURCE DST remote_system_dir vmid dsid template
#  - SOURCE is the host where the VM is running
#  - DST is the host where the VM is to be migrated
#  - remote_system_dir is the path for the VM home in the system datastore
#  - vmid is the id of the VM
#  - dsid is the target datastore
#  - template is the template of the VM in XML and base64 encoded

SRC_HOST=$1
DST_HOST=$2
DST_PATH=$3
VM_ID=$4
DS_ID=$5
TEMPLATE_64=$(cat)

# reverse postmigrate call, should cleanup the failed host

echo "${TEMPLATE_64}" | `dirname $0`/postmigrate ${DST_HOST} ${SRC_HOST} ${DST_PATH} ${VM_ID} ${DS_ID}

feldsam avatar Jan 17 '20 00:01 feldsam

Added. We have considered the proposed default script. We reckon that in general this is right, but probably the semantics may vary for each storage driver. We have opted to leave just the driver boilerplate to be customized for third party providers

rsmontero avatar Jan 30 '23 11:01 rsmontero