Skip to content

Commit

Permalink
Virt-v2v: read LUKS keys
Browse files Browse the repository at this point in the history
This patch will read the given LUKS key provided to the container and
add them as arguments to the virt-v2v command. Since virt-v2v supports
this feature only since 2.2, it applies only for cold migrations.

Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 committed Dec 10, 2023
1 parent 4d38d50 commit 70c5caf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions virt-v2v/cold/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ for disk in /dev/block[0-9]* ; do
ln -s "$disk" "$DIR/$V2V_vmName-sd$(gen_name "$((num+1))")"
done

# Adds LUKS keys, if exist.
if [ -d "/etc/luks" ]; then
IFS=$'\n'
for line in $(cat /etc/luks/luks); do
args+=(--key "$line")
done
fi

if [ "$V2V_source" == "vCenter" ] ; then
# Store password to file
echo -n "$V2V_secretKey" > "$DIR/vmware.pw"
Expand Down

0 comments on commit 70c5caf

Please sign in to comment.