I was looking at this question which was asking something sort of similar for help and is the closest thing I could find to helping, but it doesn't solve my issue: export XenServer snapshot as file via console
What I specifically need is a way to make it so that in a script either through something like curl or sed to pull just the UUID itself from the snapshot-list info and store it as a variable in the script (we'll only have one per machine at any time, but any answer that scales to encompass multiple UUIDs will also be more than acceptable).
To put it in simpler terms, I need only the UUID itself to store as a variable in a .sh script from this output or any output like it that has a UUID:
uuid ( RO) : 30820e58-886e-972e-8435-c5cf83140446
name-label ( RW): xgdc00-7-20
name-description ( RW):
is-vmss-snapshot ( RO): false
This will mostly be needed on servers with Xenserver 7.0 or possibly a bit newer, I would definitely appreciate help on this as I can't seem to figure out a way to properly do this as the UUID changes for the snapshots so that I can put the variable in this command or a command like this in the script:
xe vm-export vm=SNAPSHOT_UUID filename=/mnt/anything