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

M #-: Return UUID in kvm/deploy (#380)

This commit is contained in:
Jan Orel 2020-10-30 12:07:20 +01:00 committed by GitHub
parent f148c3fa65
commit a9ee10aab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,13 +30,12 @@ DATA=`virsh --connect $LIBVIRT_URI create $DEP_FILE`
if [ "x$?" = "x0" ]; then
DOMAIN_ID=$(echo $DATA | sed 's/Domain //' | sed 's/ created from .*$//')
echo $DOMAIN_ID
UUID=$(virsh --connect $LIBVIRT_URI dominfo $DOMAIN_ID | grep UUID: | awk '{print $2}')
echo $UUID
# redefine potential snapshots
for SNAPSHOT_MD_XML in $(ls ${DEP_FILE_LOCATION}/snap-*.xml 2>/dev/null); do
# query UUID, but only once
UUID=${UUID:-$(virsh --connect $LIBVIRT_URI dominfo $DOMAIN_ID | grep UUID: | awk '{print $2}')}
# replace uuid in the snapshot metadata xml
sed -i "s%<uuid>[[:alnum:]-]*</uuid>%<uuid>$UUID</uuid>%" $SNAPSHOT_MD_XML