mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
M #-: Return UUID in kvm/deploy (#380)
This commit is contained in:
parent
2233d0da5b
commit
9acbbb71a3
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user