Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support LUKS keys for cold migrations from vSphere (backport) #925

Merged
merged 7 commits into from
Jun 9, 2024

Conversation

liranr23
Copy link
Member

@liranr23 liranr23 commented Jun 9, 2024

Add LUKS key to the vm
This patch adds the LUKS keys to the VM specs using a secret ref. It
expected to have list of strings. Each value will use the all selector
option based on virt-v2v docs
(https://www.libguestfs.org/virt-v2v.1.html).

The secret should be provided in the destination namespace, the key
should be luks and the values should be the arguments provided to
virt-v2v, such as:

passphrase1
passphrase2
...

Backport of #676

liranr23 and others added 7 commits June 9, 2024 16:28
This patch adds the LUKS keys to the VM specs using a secret ref. It
expected to have list of strings. Each value will use the `all` selector
option based on virt-v2v docs
(https://www.libguestfs.org/virt-v2v.1.html).

The secret should be provided in the destination namespace, the key
should be `luks` and the values should be the arguments provided to
virt-v2v, such as:

```
passphrase1
passphrase2
...
```

Signed-off-by: Liran Rotenberg <[email protected]>
This patch will set the expected LUKS secret to virt-v2v pod as a volume
mounted to the virt-v2v container. This will later allow us to read the
secret and provide the arguments to the migration.

Signed-off-by: Liran Rotenberg <[email protected]>
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.
It uses the `all` selector to each passphrase.

Signed-off-by: Liran Rotenberg <[email protected]>
When importing from vSphere or OVA and using EL8 virt-v2v (warm
migration), LUKS encryption is not supported.
In case the plan is set with LUKS secret, fail to validate such plan.

Signed-off-by: Liran Rotenberg <[email protected]>
Instead of the plan keep being running and the conversion pod try to
init, we can query and check the secret existence for LUKS keys before.
In the case it's doesn't exist, fail the migration properly. If it does
exist, post it on the target namespace for the conversion pod.

Signed-off-by: Liran Rotenberg <[email protected]>
Signed-off-by: Arik Hadas <[email protected]>
Signed-off-by: Arik Hadas <[email protected]>
Copy link

sonarcloud bot commented Jun 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@ahadas ahadas merged commit c782e11 into kubev2v:release-v2.6.3 Jun 9, 2024
7 checks passed
@liranr23 liranr23 deleted the luks branch June 9, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants