Change how volume disk location is detected
the name of the attached volume disk (like 'vdb') is in fact
quite inconsistent. It actually depends on if config drive is enabled
or not, and what format does it have, plus it may change on reboot
or rebuild.
The only valid hint at the device name of the volume is to find a block
device with a serial number corresponding to the volume UUID.
On full-featured systems like Ubuntu this could be found in
`/dev/disk/by-id/`, but on Cirros one has to search for a 'serial'
file in /sys dir with the appropriate content (luckily, that also works
on full systems too).
Also, add a sync call before unmounting to be sure the written data
was flushed to the remote disk.
Related-Issue: PRODX-37480
Change-Id: I7e4c5bc7df5d4ee2d489c3a0edc197fecc5782a2
(cherry picked from commit 5639bafeab86a5e5ec36aa7d3e12d278db28334a)
2 files changed