-
Notifications
You must be signed in to change notification settings - Fork 34
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 #676
Conversation
2b6d825
to
a6ef6ee
Compare
I see that it's already in progress, doesn't it make more sense to wait for it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, looks good overall
virt-v2v/cold/entrypoint
Outdated
if [ -d "/etc/luks" ]; then | ||
IFS=$'\n' | ||
for line in $(cat /etc/luks/luks); do | ||
args+=(--key "$line") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I commented at the top-level, I think we can wait to get the all
option because otherwise, users would have to specify the name or the UIID of the device that may be different for different VMs in the plan (we can find the device UID probably, not sure about OVAs though, but as the all
option is just around the corner...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since a selector of all devices will probably not be available for forklift 2.6, we decided not to wait for it
but I talked with @dankenigsberg, and he raised a vaild point that users that provide such input may expect us to support key per-devices also when that selector would be available.
@liranr23 can we save the user from specifying the device IDs, as we're supposed to have them in the inventory, and ask only for the encryption keys from users?
BTW, need to check if the support for LUKS exists in el8 but if we rely on the |
yeah we can. |
it's not as written in the 3rd commit |
if we like to consider the option of specifying devices, we need to see how to make it practical, especially in scale - specifying UUIDs/names is problematic, users would rather need to select disk(s) and a practical way... |
ok, so need to add it to the plan admitter |
OK, so we can wait for virt-v2v and change the commits + in the virt-v2v to handle it by adding |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
pkg/forklift-api/webhooks/validating-webhook/admitters/plan-admitter.go
Outdated
Show resolved
Hide resolved
pkg/forklift-api/webhooks/validating-webhook/admitters/plan-admitter.go
Outdated
Show resolved
Hide resolved
pkg/forklift-api/webhooks/validating-webhook/admitters/plan-admitter.go
Outdated
Show resolved
Hide resolved
the |
virt-v2v/cold/entrypoint
Outdated
if [ -d "/etc/luks" ]; then | ||
IFS=$'\n' | ||
for line in $(cat /etc/luks/luks); do | ||
args+=(--key "$line") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since a selector of all devices will probably not be available for forklift 2.6, we decided not to wait for it
but I talked with @dankenigsberg, and he raised a vaild point that users that provide such input may expect us to support key per-devices also when that selector would be available.
@liranr23 can we save the user from specifying the device IDs, as we're supposed to have them in the inventory, and ask only for the encryption keys from users?
8c3b642
to
1274d6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to summarize an offline discussion about this - it would be better to switch back to passing the keys with a volume and ask virt-v2v to get it from the file, so that the keys won't be included in logs that are gathered from the cluster
e649f52
to
6afd76a
Compare
d49e5e3
to
480d139
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made some cleanup, besides the comment inside it looks good
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]>
Quality Gate passedIssues Measures |
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
selectoroption 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 tovirt-v2v, such as:
Fixes #567