diff --git a/opennebula-ceph-cpds-clone.diff b/opennebula-ceph-cpds-clone.diff new file mode 100644 index 0000000..39204e0 --- /dev/null +++ b/opennebula-ceph-cpds-clone.diff @@ -0,0 +1,18 @@ +--- /var/lib/one/remotes/tm/ceph/cpds 2018-11-21 22:48:44.497052898 +0300 ++++ /var/lib/one/remotes/tm/ceph/cpds 2018-11-21 23:17:49.293548923 +0300 +@@ -161,11 +161,13 @@ else + fi + + RBD_DST=\$RBD_DST@$SNAP_ID ++ ++ $RBD clone \$RBD_DST $DST + else + RBD_DST=$RBD_DST +- fi + +- $RBD ${EC_POOL_OPT} copy \$RBD_DST $DST ++ $RBD $EC_POOL_OPT copy \$RBD_DST $DST ++ fi + EOF + ) + fi diff --git a/opennebula-ceph-ec-revert.patch b/opennebula-ceph-ec-revert.patch new file mode 100644 index 0000000..e58de90 --- /dev/null +++ b/opennebula-ceph-ec-revert.patch @@ -0,0 +1,82 @@ +index 25c88f8bf..82d0ee0a3 100755 +--- a/remotes/tm/ceph/snap_revert ++++ b/remotes/tm/ceph/snap_revert +@@ -80,6 +80,19 @@ else + RBD_DST="${RBD_SRC}-${VM_ID}-${DISK_ID}" + fi + ++#------------------------------------------------------------------------------- ++# Get Datastore information ++#------------------------------------------------------------------------------- ++ ++unset i j XPATH_ELEMENTS ++ ++while IFS= read -r -d '' element; do ++ XPATH_ELEMENTS[i++]="$element" ++done < <(onedatastore show -x $DS_ID | $XPATH \ ++ /DATASTORE/TEMPLATE/EC_POOL_NAME) ++ ++EC_POOL_NAME="${XPATH_ELEMENTS[j++]}" ++ + #------------------------------------------------------------------------------- + # Revert to Snapshot. Using the following tree structure + # +@@ -115,6 +128,10 @@ if [ -n "$CEPH_CONF" ]; then + RBD="$RBD --conf ${CEPH_CONF}" + fi + ++if [ -n "$EC_POOL_NAME" ]; then ++ EC_POOL_OPT="--data-pool ${EC_POOL_NAME}" ++fi ++ + if [ "${TYPE}" != 'RBD' ]; then + error_message "$script_name: Operation not supported on disk type ${TYPE}" + exit 1 +@@ -134,7 +151,7 @@ SNAP_REVERT_CMD=$(cat <