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

Add virtio-rng support #1260

Closed
fabiand opened this Issue Jul 3, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@fabiand
Member

fabiand commented Jul 3, 2018

As a user I want to be able to provide my guest with good random numbers. One way to achieve this is by using a virtio RNG device.

Design: https://docs.google.com/document/d/1G75lPm0dCf3ZcFnG6NJpUDZgTaQnFKKM7_glpXzH9uc/edit#

This issue is about adding a virtio rng device type including it's knbos, and two configuration profiles which reflect the oVirt and OpenStack configuration.

The device can be added by a user on demand (thus is not automatically added to each VM).

The device should expose all the detailed settings you can configure on the the virtio-rng device.
And in addition it must expose a profile field which will set the knobs (i.e. backend, rate period and byets) according to profiles derived from oVirt and OpenStack.
A user can eitehr set the knbos himself, or choose from these two options.

The backend should be /dev/random if available or dev/urandom as a fallback.

API

kind: VMI
spec:
  domain:
    devices:
      rng:
        profile: ovirt  # DEFAULT
        # OR
        profile: openstack
        # OR
        rate: 
          period: 2000
          bytes: 1234
      

libvirt reference. https://libvirt.org/formatdomain.html#elementsRng

Open Questions

  • Is hardware RNG slower? Wouldn’t it be better to use /dev/urandom?
  • If we know explicitly that a hardware RNG is present, we should request it (device plugins?), otherwise don’t request it and use /dev/random
    • This can be a follow up a) expose hwrng via DP, add virt controller awareness for hwrng devies
  • How can we schedule nodes?
  • How do we accommodate device plugins (unlimited devices?)
  • A daemonset might need to prepare something?
@michalskrivanek

This comment was marked as outdated.

Show comment
Hide comment
@michalskrivanek

michalskrivanek Jul 3, 2018

Member

@fabiand
why openstack/ovirt flavor? this should use virtuned, worst case presets until we have virtuned.
For low level kubevirt API why do we need anything else than libvirt-level attributes?

Member

michalskrivanek commented Jul 3, 2018

@fabiand
why openstack/ovirt flavor? this should use virtuned, worst case presets until we have virtuned.
For low level kubevirt API why do we need anything else than libvirt-level attributes?

@fabiand

This comment was marked as outdated.

Show comment
Hide comment
@fabiand

fabiand Jul 3, 2018

Member

@michalskrivanek the "flavors" can be implemented by virtuned - we just do not have it right now, nothing is stopping us on using it on the longer run.

My point is that we do not want to expose all of the low-level knobs. But expose "flavors" which will set the internal (libvirt) knobs to the values.

I.e. openstack has values for ( backend, rate period and bytes), and ovirt as well. Selecting "flavor: ovirt" will set the libvirt knobs to the values which ovirt currently has.

Member

fabiand commented Jul 3, 2018

@michalskrivanek the "flavors" can be implemented by virtuned - we just do not have it right now, nothing is stopping us on using it on the longer run.

My point is that we do not want to expose all of the low-level knobs. But expose "flavors" which will set the internal (libvirt) knobs to the values.

I.e. openstack has values for ( backend, rate period and bytes), and ovirt as well. Selecting "flavor: ovirt" will set the libvirt knobs to the values which ovirt currently has.

@fabiand fabiand added this to the v2 milestone Jul 3, 2018

@petrkotas petrkotas referenced this issue Jul 27, 2018

Merged

Virtiorng #1385

@petrkotas

This comment has been minimized.

Show comment
Hide comment
@petrkotas

petrkotas Jul 27, 2018

Member

Lets split this issue into three separate ones.

  1. Implement the API support, which is done in #1385,
  2. Implement new presents with default for the virtio RNG,
  3. Tackle the challenge with hardware RNG device.
Member

petrkotas commented Jul 27, 2018

Lets split this issue into three separate ones.

  1. Implement the API support, which is done in #1385,
  2. Implement new presents with default for the virtio RNG,
  3. Tackle the challenge with hardware RNG device.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment