1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-08 21:17:43 +03:00

B #5991: Ensure VM snapshots are redefined in order (#2306)

(cherry picked from commit a963d3ac26)
This commit is contained in:
Christian González 2022-10-17 18:48:21 +02:00 committed by Ruben S. Montero
parent 714b4de2db
commit 46b571387b
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
3 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ if [ "x$?" = "x0" ]; then
echo $UUID
# redefine potential snapshots
for SNAPSHOT_MD_XML in $(ls ${DEP_FILE_LOCATION}/snap-*.xml 2>/dev/null); do
for SNAPSHOT_MD_XML in $(ls -v ${DEP_FILE_LOCATION}/snap-*.xml 2>/dev/null); do
# replace uuid in the snapshot metadata xml

View File

@ -258,7 +258,7 @@ if [ "$SHARED" = "YES" ] && [ -n "$SNAP_CUR" ]; then
DISK_PATH=$(virsh --connect $QEMU_PROTOCOL://$DEST_HOST/system domblklist $DEPLOY_ID | awk '/disk.0/ {print $2}')
DISK_DIR=$(dirname $DISK_PATH)
for SNAPSHOT_MD_XML in $(ls ${DISK_DIR}/snap-*.xml 2>/dev/null); do
for SNAPSHOT_MD_XML in $(ls -v ${DISK_DIR}/snap-*.xml 2>/dev/null); do
# replace uuid in the snapshot metadata xml
sed -i "s%<uuid>[[:alnum:]-]*</uuid>%<uuid>$UUID</uuid>%" $SNAPSHOT_MD_XML

View File

@ -116,7 +116,7 @@ rm "$FILE"
rm "$FILE_XML"
# redefine potential snapshots
for SNAPSHOT_MD_XML in $(ls ${VM_DIR}/snap-*.xml 2>/dev/null); do
for SNAPSHOT_MD_XML in $(ls -v ${VM_DIR}/snap-*.xml 2>/dev/null); do
# query UUID, but only once
UUID=${UUID:-$(virsh --connect $LIBVIRT_URI dominfo $DEPLOY_ID | grep UUID: | awk '{print $2}')}